Compare commits

..

10 Commits

Author SHA1 Message Date
Asahi Ushio d38ef7b862 Update config.json 2022-11-28 11:30:47 +00:00
Jose Camacho Collados f3e34b6c30 Update README.md 2022-06-22 19:15:32 +00:00
Cardiff NLP 88a0007355 Add reference paper 2021-04-27 15:40:10 +00:00
Cardiff NLP 083e90c883 Update README.md 2021-04-26 16:28:59 +00:00
Cardiff NLP 54186b74b2 Update README.md 2021-04-19 17:08:05 +00:00
Cardiff NLP 968fc69b26 Update README.md 2021-04-17 06:52:13 +00:00
Cardiff NLP 34227e9348 Update README.md 2021-04-17 06:43:06 +00:00
Cardiff NLP 806cad138d Update README.md 2021-04-17 06:35:23 +00:00
Cardiff NLP b8a60461af Update README.md 2021-04-17 06:30:28 +00:00
Cardiff NLP d80dae4ef8 Update README.md 2021-04-17 06:29:57 +00:00
2 changed files with 15 additions and 14 deletions

View File

@ -1,21 +1,23 @@
---
language: multilingual
widget:
- text: "T'estimo!"
- text: "🤗"
- 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 XLM-roBERTa-base model trained on ~198M tweets and finetuned for sentiment analysis in
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).
- Paper: [XLM-T: A Multilingual Language Model Toolkit for Twitter](https://...).
- Git Repo: [Tweeteval official repository](https://github.com/cardiffnlp/xlm-t).
- 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).
## Example Pipeline
```python
@ -24,9 +26,8 @@ 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': 'LABEL_2', 'score': 0.6600581407546997}]
[{'label': 'Positive', 'score': 0.6600581407546997}]
```
## Full classification example
@ -34,7 +35,7 @@ Output:
```python
from transformers import AutoModelForSequenceClassification
from transformers import TFAutoModelForSequenceClassification
from transformers import AutoTokenizer
from transformers import AutoTokenizer, AutoConfig
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,