
# svalabs/german-gpl-adapted-covid

This is a german on covid adapted [sentence-transformers](https://www.SBERT.net) model: 
It is adapted on covid related documents using the [GPL](https://github.com/UKPLab/gpl) integration of [Haystack](https://github.com/deepset-ai/haystack). We used the [svalabs/cross-electra-ms-marco-german-uncased](https://huggingface.co/svalabs/cross-electra-ms-marco-german-uncased) as CrossEncoder and [svalabs/mt5-large-german-query-gen-v1](https://huggingface.co/svalabs/mt5-large-german-query-gen-v1) for query generation.


<!--- Describe your model here -->

## Usage (Sentence-Transformers)

Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:

```
pip install -U sentence-transformers
```

Then you can use the model like this:


```python
from sentence_transformers import SentenceTransformer, util
from transformers import AutoTokenizer, AutoModel


org_model = SentenceTransformer("sentence-transformers/msmarco-distilbert-multilingual-en-de-v2-tmp-trained-scratch")
org_model.max_seq_length = max_seq_length

model = SentenceTransformer('svalabs/german-gpl-adapted-covid')

def show_examples(model):
    query = "Wie wird Covid-19 übermittelt"
    docs = [
        "Corona ist sehr ansteckend",
        "Corona wird über die Luft verbreitet",
        "Ebola wird durch direkten Kontakt mit Blut übertragen",
        "HIV wird durch Sex oder den Austausch von Nadeln übertragen",
        "Polio wird durch kontaminiertes Wasser oder Lebensmittel übertragen",
    ]

    query_emb = model.encode(query)
    docs_emb = model.encode(docs)
    scores = util.dot_score(query_emb, docs_emb)[0]
    doc_scores = sorted(zip(docs, scores), key=lambda x: x[1], reverse=True)

    print("Query:", query)
    for doc, score in doc_scores:
        # print(doc, score)
        print(f"{score:0.02f}\t{doc}")
        
        
print("Original Model")
show_examples(org_model)

print("\n\nAdapted Model")
show_examples(model)
```
## Evaluation Results
```
Original Model
Query: Wie wird Covid-19 übermittelt
33.01	HIV wird durch Sex oder den Austausch von Nadeln übertragen
32.78	Polio wird durch kontaminiertes Wasser oder Lebensmittel übertragen
29.10	Corona wird über die Luft verbreitet
24.41	Ebola wird durch direkten Kontakt mit Blut übertragen
10.85	Corona ist sehr ansteckend


Adapted Model
Query: Wie wird Covid-19 übermittelt
29.82	Corona wird über die Luft verbreitet
27.44	Polio wird durch kontaminiertes Wasser oder Lebensmittel übertragen
24.89	Ebola wird durch direkten Kontakt mit Blut übertragen
23.81	HIV wird durch Sex oder den Austausch von Nadeln übertragen
20.03	Corona ist sehr ansteckend
```




## Training
The model was trained with the parameters:

**DataLoader**:

`torch.utils.data.dataloader.DataLoader` of length 125 with parameters:
```
{'batch_size': 16, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
```

**Loss**:

`sentence_transformers.losses.MarginMSELoss.MarginMSELoss` 

Parameters of the fit()-Method:
```
{
    "epochs": 1,
    "evaluation_steps": 0,
    "evaluator": "NoneType",
    "max_grad_norm": 1,
    "optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
    "optimizer_params": {
        "lr": 2e-05
    },
    "scheduler": "WarmupLinear",
    "steps_per_epoch": null,
    "warmup_steps": 12,
    "weight_decay": 0.01
}
```


## Full Model Architecture
```
SentenceTransformer(
  (0): Transformer({'max_seq_length': 200, 'do_lower_case': False}) with Transformer model: DistilBertModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
)
```

## Citing & Authors

<!--- Describe where people can find more information -->
{"tags": ["sentence-transformers", "feature-extraction", "sentence-similarity", "transformers"], "pipeline_tag": "sentence-similarity"}
sentence-transformers pytorch distilbert feature-extraction sentence-similarity transformers endpoints_compatible region:us
TAGS
#sentence-transformers #pytorch #distilbert #feature-extraction #sentence-similarity #transformers #endpoints_compatible #region-us 


# svalabs/german-gpl-adapted-covid

This is a german on covid adapted sentence-transformers model: 
It is adapted on covid related documents using the GPL integration of Haystack. We used the svalabs/cross-electra-ms-marco-german-uncased as CrossEncoder and svalabs/mt5-large-german-query-gen-v1 for query generation.




## Usage (Sentence-Transformers)

Using this model becomes easy when you have sentence-transformers installed:



Then you can use the model like this:



## Evaluation Results





## Training
The model was trained with the parameters:

DataLoader:

'URL.dataloader.DataLoader' of length 125 with parameters:


Loss:

'sentence_transformers.losses.MarginMSELoss.MarginMSELoss' 

Parameters of the fit()-Method:



## Full Model Architecture


## Citing & Authors


# svalabs/german-gpl-adapted-covid

This is a german on covid adapted sentence-transformers model: 
It is adapted on covid related documents using the GPL integration of Haystack. We used the svalabs/cross-electra-ms-marco-german-uncased as CrossEncoder and svalabs/mt5-large-german-query-gen-v1 for query generation. ## Usage (Sentence-Transformers)

Using this model becomes easy when you have sentence-transformers installed:



Then you can use the model like this: ## Evaluation Results ## Training
The model was trained with the parameters:

DataLoader:

'URL.dataloader.DataLoader' of length 125 with parameters:


Loss:

'sentence_transformers.losses.MarginMSELoss.MarginMSELoss' 

Parameters of the fit()-Method: ## Full Model Architecture ## Citing & Authors
TAGS
#sentence-transformers #pytorch #distilbert #feature-extraction #sentence-similarity #transformers #endpoints_compatible #region-us 
 # svalabs/german-gpl-adapted-covid

This is a german on covid adapted sentence-transformers model: 
It is adapted on covid related documents using the GPL integration of Haystack. We used the svalabs/cross-electra-ms-marco-german-uncased as CrossEncoder and svalabs/mt5-large-german-query-gen-v1 for query generation. ## Usage (Sentence-Transformers)

Using this model becomes easy when you have sentence-transformers installed:



Then you can use the model like this: ## Evaluation Results ## Training
The model was trained with the parameters:

DataLoader:

'URL.dataloader.DataLoader' of length 125 with parameters:


Loss:

'sentence_transformers.losses.MarginMSELoss.MarginMSELoss' 

Parameters of the fit()-Method: ## Full Model Architecture ## Citing & Authors
passage: TAGS
#sentence-transformers #pytorch #distilbert #feature-extraction #sentence-similarity #transformers #endpoints_compatible #region-us 
# svalabs/german-gpl-adapted-covid

This is a german on covid adapted sentence-transformers model: 
It is adapted on covid related documents using the GPL integration of Haystack. We used the svalabs/cross-electra-ms-marco-german-uncased as CrossEncoder and svalabs/mt5-large-german-query-gen-v1 for query generation.## Usage (Sentence-Transformers)

Using this model becomes easy when you have sentence-transformers installed:



Then you can use the model like this:## Evaluation Results## Training
The model was trained with the parameters:

DataLoader:

'URL.dataloader.DataLoader' of length 125 with parameters:


Loss:

'sentence_transformers.losses.MarginMSELoss.MarginMSELoss' 

Parameters of the fit()-Method:## Full Model Architecture## Citing & Authors