german roberta sentence transformer v2
T-Systems-onsiteIntroduction
The german-roberta-sentence-transformer-v2
is a model designed for sentence embeddings in the German language. It is built using the RoBERTa architecture and is fine-tuned on the STSbenchmark dataset to optimize for feature extraction tasks such as sentence embedding, search, and paraphrase detection.
Architecture
The model leverages the RoBERTa architecture, specifically utilizing the xlm-r-distilroberta-base-paraphrase-v1
variant. This architecture is well-suited for multilingual tasks and is implemented in PyTorch, with compatibility for TensorFlow and Safetensors. The model is optimized for both Spearman’s rank correlation and cosine similarity metrics.
Training
The model is fine-tuned on the STSbenchmark dataset, which is a standard benchmark for sentence similarity analysis. This dataset helps the model achieve high performance in tasks requiring nuanced understanding of sentence semantics.
Guide: Running Locally
To run the model locally, follow these steps:
-
Setup Environment: Ensure Python is installed and set up a virtual environment.
python -m venv env source env/bin/activate
-
Install Dependencies: Install the required libraries, such as
transformers
andtorch
.pip install transformers torch
-
Download the Model: Use the Hugging Face Transformers library to download and load the model.
from transformers import AutoModel, AutoTokenizer model_name = "T-Systems-onsite/german-roberta-sentence-transformer-v2" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModel.from_pretrained(model_name)
-
Run Inference: Use the model to perform sentence embeddings or other feature extraction tasks.
inputs = tokenizer("Ein Beispieltext.", return_tensors='pt') embeddings = model(**inputs)
-
Cloud GPUs: For more intensive computations, consider using cloud GPU services like AWS, Google Cloud, or Azure to enhance performance.
License
The model is distributed under the MIT License, allowing for free use, modification, and distribution.