Compare commits

..

No commits in common. "d38ef7b8626347c12363d3058a8db28fe6dbcdb4" and "856553beaaaf559c029023df1e1af05a35723b77" have entirely different histories.

2 changed files with 14 additions and 15 deletions

View File

@ -1,23 +1,21 @@
---
language: multilingual
widget:
- text: "🤗"
- text: "T'estimo! ❤️"
- text: "T'estimo!"
- text: "I love you!"
- text: "I hate you 🤮"
- text: "I hate you"
- text: "Mahal kita!"
- text: "사랑해!"
- text: "난 너가 싫어"
- text: "😍😍😍"
---
# twitter-XLM-roBERTa-base for Sentiment Analysis
This is a multilingual XLM-roBERTa-base model trained on ~198M tweets and finetuned for sentiment analysis. The sentiment fine-tuning was done on 8 languages (Ar, En, Fr, De, Hi, It, Sp, Pt) but it can be used for more languages (see paper for details).
This is a XLM-roBERTa-base model trained on ~198M tweets and finetuned for sentiment analysis in
- Paper: [XLM-T: A Multilingual Language Model Toolkit for Twitter](https://arxiv.org/abs/2104.12250).
- Git Repo: [XLM-T official repository](https://github.com/cardiffnlp/xlm-t).
- Paper: [XLM-T: A Multilingual Language Model Toolkit for Twitter](https://...).
- Git Repo: [Tweeteval official repository](https://github.com/cardiffnlp/xlm-t).
## Example Pipeline
```python
@ -26,8 +24,9 @@ model_path = "cardiffnlp/twitter-xlm-roberta-base-sentiment"
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("T'estimo!")
```
Output:
```
[{'label': 'Positive', 'score': 0.6600581407546997}]
[{'label': 'LABEL_2', 'score': 0.6600581407546997}]
```
## Full classification example
@ -35,7 +34,7 @@ sentiment_task("T'estimo!")
```python
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer, AutoConfig
from transformers import AutoTokenizer
import numpy as np
from scipy.special import softmax

View File

@ -11,16 +11,16 @@
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"id2label": {
"0": "negative",
"1": "neutral",
"2": "positive"
"0": "Negative",
"1": "Neutral",
"2": "Positive"
},
"initializer_range": 0.02,
"intermediate_size": 3072,
"label2id": {
"negative": 0,
"neutral": 1,
"positive": 2
"Negative": 0,
"Neutral": 1,
"Positive": 2
},
"layer_norm_eps": 1e-05,
"max_position_embeddings": 514,