Downloads · 30 days
159
0% of all-time downloads
ssary/XLM-RoBERTa-German-sentiment
XLM-RoBERTa-German-sentiment is a text classification model from ssary. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
XLM-RoBERTa-German-Sentiment model is designed to perform Sentiment Analysis for 8 Languages and more specifically German language.\ This model leverages the XLM-RoBERTa architecture, a choice inspired by the superior…
Downloads · 30 days
159
0% of all-time downloads
All-time downloads
238K
Public
Parameters
278M
1.1 GB on disk
Likes
11
Public
Click a slice to open those files.
.safetensors1.1 GB · 100%
From the Hugging Face model README
XLM-RoBERTa-German-Sentiment model is designed to perform Sentiment Analysis for 8 Languages and more specifically German language.
This model leverages the XLM-RoBERTa architecture, a choice inspired by the superior performance of Facebook's RoBERTa over Google's BERT across numerous benchmarks.
The decision to use XLM-RoBERTa stems from its multilingual capabilities. Specifically tailored for the German language, this model has been fine-tuned on over 200,000 German-language sentiment analysis samples, more on the training of the model can be found in the paper.
The dataset utilized for training, available at this GitHub repository this dataset is developed by Oliver Guhr, We extend our gratitude to him for making the dataset open source,the dataset was influential in refining the model's accuracy and responsiveness to the nuances of German sentiment.
Our model and finetuning is based on sentiment analysis model called xlm-t [https://arxiv.org/abs/2104.12250].
I have developed Python desktop application for the inference at my repository.
To use this model, you need to install the Hugging Face Transformers library and PyTorch. You can do this using pip:
pip install torch transformers
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
text = "Erneuter Streik in der S-Bahn"
model = AutoModelForSequenceClassification.from_pretrained('ssary/XLM-RoBERTa-German-sentiment')
tokenizer = AutoTokenizer.from_pretrained('ssary/XLM-RoBERTa-German-sentiment')
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
sentiment_classes = ['negative', 'neutral', 'positive']
print(sentiment_classes[predictions.argmax()]) # for the class with highest probability
print(predictions) # for each class probability
This model was developed by Sary Nasser at HTW-Berlin under supervision of Martin Steinicke.