Update README.md
Browse files
README.md
CHANGED
@@ -1,27 +1,36 @@
|
|
1 |
---
|
2 |
-
language:
|
3 |
-
- en
|
4 |
license: mit
|
5 |
datasets:
|
6 |
- cardiffnlp/super_tweeteval
|
|
|
|
|
|
|
7 |
---
|
8 |
# cardiffnlp/twitter-roberta-large-intimacy-latest
|
9 |
|
10 |
This is a RoBERTa-large model trained on 154M tweets until the end of December 2022 and finetuned for intimacy analysis (regression on a single text) on the _TweetIntimacy_ dataset of [SuperTweetEval](https://huggingface.co/datasets/cardiffnlp/super_tweeteval).
|
11 |
-
The original Twitter-
|
12 |
|
13 |
## Example
|
14 |
```python
|
15 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
|
16 |
|
17 |
model_name = "cardiffnlp/twitter-roberta-large-intimacy-latest"
|
18 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
19 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
20 |
|
21 |
-
|
22 |
text= '@user Furthermore, harassment is ILLEGAL in any form!'
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
```
|
26 |
|
27 |
## Citation Information
|
@@ -34,5 +43,4 @@ Please cite the [reference paper](https://arxiv.org/abs/2310.14757) if you use t
|
|
34 |
booktitle={Findings of the Association for Computational Linguistics: EMNLP 2023},
|
35 |
year={2023}
|
36 |
}
|
37 |
-
```
|
38 |
-
|
|
|
1 |
---
|
|
|
|
|
2 |
license: mit
|
3 |
datasets:
|
4 |
- cardiffnlp/super_tweeteval
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
pipeline_tag: text-classification
|
8 |
---
|
9 |
# cardiffnlp/twitter-roberta-large-intimacy-latest
|
10 |
|
11 |
This is a RoBERTa-large model trained on 154M tweets until the end of December 2022 and finetuned for intimacy analysis (regression on a single text) on the _TweetIntimacy_ dataset of [SuperTweetEval](https://huggingface.co/datasets/cardiffnlp/super_tweeteval).
|
12 |
+
The original Twitter-large RoBERTa model can be found [here](https://huggingface.co/cardiffnlp/twitter-roberta-large-2022-154m).
|
13 |
|
14 |
## Example
|
15 |
```python
|
16 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
17 |
+
import torch.nn.functional as F
|
18 |
|
19 |
model_name = "cardiffnlp/twitter-roberta-large-intimacy-latest"
|
20 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
21 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
22 |
|
|
|
23 |
text= '@user Furthermore, harassment is ILLEGAL in any form!'
|
24 |
+
|
25 |
+
# with pipeline
|
26 |
+
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
27 |
+
pipe(text)
|
28 |
+
>> [{'label': 'LABEL_0', 'score': 0.5246055722236633}]
|
29 |
+
|
30 |
+
# alternatively
|
31 |
+
logits = model(**tokenizer(text, return_tensors="pt"))
|
32 |
+
prob = F.sigmoid(logits.logits).item()
|
33 |
+
>> 0.5246055722236633
|
34 |
```
|
35 |
|
36 |
## Citation Information
|
|
|
43 |
booktitle={Findings of the Association for Computational Linguistics: EMNLP 2023},
|
44 |
year={2023}
|
45 |
}
|
46 |
+
```
|
|