UAlbertaUAIS
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -1,202 +1,123 @@
|
|
1 |
---
|
2 |
library_name: peft
|
3 |
base_model: cardiffnlp/twitter-roberta-base-sentiment-latest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
8 |
-
|
|
|
9 |
|
|
|
|
|
|
|
|
|
10 |
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
|
|
15 |
|
16 |
-
<!-- Provide a longer summary of what this model is. -->
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
|
20 |
-
- **
|
21 |
-
- **
|
22 |
-
- **
|
23 |
-
- **
|
24 |
-
- **
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
-
|
28 |
-
### Model Sources [optional]
|
29 |
-
|
30 |
-
<!-- Provide the basic links for the model. -->
|
31 |
-
|
32 |
-
- **Repository:** [More Information Needed]
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
## Uses
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
### Direct Use
|
41 |
-
|
42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
-
|
54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
-
|
58 |
-
## Bias, Risks, and Limitations
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
|
72 |
-
Use the code below to get started with the model.
|
73 |
|
74 |
-
[More Information Needed]
|
75 |
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
|
103 |
## Evaluation
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
**APA:**
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
|
199 |
-
[More Information Needed]
|
200 |
|
201 |
|
202 |
### Framework versions
|
|
|
1 |
---
|
2 |
library_name: peft
|
3 |
base_model: cardiffnlp/twitter-roberta-base-sentiment-latest
|
4 |
+
license: mit
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
metrics:
|
8 |
+
- accuracy
|
9 |
+
pipeline_tag: text-classification
|
10 |
+
tags:
|
11 |
+
- NHL
|
12 |
+
- Hockey
|
13 |
+
- Sports
|
14 |
+
- roberta
|
15 |
+
- sentiment analysis
|
16 |
---
|
17 |
|
18 |
+
# Chelberta
|
19 |
|
20 |
+
This is a finetuned model of [cardiffnlp/twitter-roberta-base-sentiment-latest](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest) trained on
|
21 |
+
5168 sentiment labelled reddit comments from subreddits of NHL hockey teams in December 2023. This model is suitable for English.
|
22 |
|
23 |
+
<b>Labels</b>:
|
24 |
+
0 -> Negative;
|
25 |
+
1 -> Neutral;
|
26 |
+
2 -> Positive
|
27 |
|
28 |
+
This sentiment analysis has been used for the [NHL Positivity Index](https://uais.dev/projects/nhl-positivity-index/)
|
29 |
|
30 |
+
The full dataset can be found [here](https://www.kaggle.com/datasets/jacobwinch/nhl-reddit-comments)
|
31 |
+
## Example Pipeline
|
32 |
+
```python
|
33 |
+
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer
|
34 |
+
from peft import PeftModel
|
35 |
+
import torch
|
36 |
|
37 |
+
model_id = 'cardiffnlp/twitter-roberta-base-sentiment-latest'
|
38 |
+
peft_model_id = 'UAlbertaUAIS/Chelberta'
|
39 |
|
|
|
40 |
|
41 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_id, num_labels=3)
|
42 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, max_length=512)
|
43 |
+
model = PeftModel.from_pretrained(model, peft_model_id)
|
44 |
+
model = model.merge_and_unload()
|
45 |
+
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer, max_length = 512, truncation=True, device=0)
|
46 |
+
classifier("Connor McDavid is good at hockey!")
|
47 |
+
```
|
48 |
+
[{'label': 'positive', 'score': 0.9888942837715149}]
|
49 |
+
```
|
50 |
|
51 |
+
- **Developed by:** The Unversity of Alberta Undergraduate Artificial Intelligence Society Student Group
|
52 |
+
- **Model type:** roberta based
|
53 |
+
- **Language(s) (NLP):** English
|
54 |
+
- **License:** MIT
|
55 |
+
- **Finetuned from model [optional]:** [cardiffnlp/twitter-roberta-base-sentiment-latest](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest)
|
56 |
+
- **Repository:** https://github.com/UndergraduateArtificialIntelligenceClub/NHL-Positivity-Index
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
## Uses
|
59 |
|
60 |
+
Chelberta is inteded to be used to analysis the sentiment of sports fans on social media.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
## Evaluation
|
66 |
|
67 |
+
Chelberta was evaluated on a testing dataset of 1000 human labelled NHL Reddit comments from December 2023, the testing set can be found [here](https://github.com/UndergraduateArtificialIntelligenceClub/NHL-Positivity-Index/blob/main/data/training_data/NHL-SentiComments-1K-TEST.json).
|
68 |
+
The model had an 81.4% accuracy score.
|
69 |
+
|
70 |
+
### References
|
71 |
+
```
|
72 |
+
@inproceedings{camacho-collados-etal-2022-tweetnlp,
|
73 |
+
title = "{T}weet{NLP}: Cutting-Edge Natural Language Processing for Social Media",
|
74 |
+
author = "Camacho-collados, Jose and
|
75 |
+
Rezaee, Kiamehr and
|
76 |
+
Riahi, Talayeh and
|
77 |
+
Ushio, Asahi and
|
78 |
+
Loureiro, Daniel and
|
79 |
+
Antypas, Dimosthenis and
|
80 |
+
Boisson, Joanne and
|
81 |
+
Espinosa Anke, Luis and
|
82 |
+
Liu, Fangyu and
|
83 |
+
Mart{\'\i}nez C{\'a}mara, Eugenio" and others,
|
84 |
+
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
|
85 |
+
month = dec,
|
86 |
+
year = "2022",
|
87 |
+
address = "Abu Dhabi, UAE",
|
88 |
+
publisher = "Association for Computational Linguistics",
|
89 |
+
url = "https://aclanthology.org/2022.emnlp-demos.5",
|
90 |
+
pages = "38--49"
|
91 |
+
}
|
92 |
+
|
93 |
+
```
|
94 |
+
|
95 |
+
```
|
96 |
+
@inproceedings{loureiro-etal-2022-timelms,
|
97 |
+
title = "{T}ime{LM}s: Diachronic Language Models from {T}witter",
|
98 |
+
author = "Loureiro, Daniel and
|
99 |
+
Barbieri, Francesco and
|
100 |
+
Neves, Leonardo and
|
101 |
+
Espinosa Anke, Luis and
|
102 |
+
Camacho-collados, Jose",
|
103 |
+
booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: System Demonstrations",
|
104 |
+
month = may,
|
105 |
+
year = "2022",
|
106 |
+
address = "Dublin, Ireland",
|
107 |
+
publisher = "Association for Computational Linguistics",
|
108 |
+
url = "https://aclanthology.org/2022.acl-demo.25",
|
109 |
+
doi = "10.18653/v1/2022.acl-demo.25",
|
110 |
+
pages = "251--260"
|
111 |
+
}
|
112 |
+
|
113 |
+
```
|
114 |
+
|
115 |
+
|
116 |
+
## Citation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
**APA:**
|
118 |
|
119 |
+
Winch, J., Munjal, T., Lau, H., Bradley, A., Monaghan, A., & Subedi, Y. (2023). NHL Positivity Index. Undergraduate Artificial Intelligence Society. https://uais.dev/projects/nhl-positivity-index/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
|
|
121 |
|
122 |
|
123 |
### Framework versions
|