Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,120 @@
|
|
1 |
---
|
|
|
|
|
|
|
2 |
library_name: transformers
|
3 |
-
|
|
|
|
|
4 |
---
|
5 |
|
6 |
# Model Card for Model ID
|
7 |
|
8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
## Model Details
|
13 |
|
14 |
### Model Description
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
19 |
|
20 |
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
- **Repository:** [More Information Needed]
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
## Uses
|
37 |
|
38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
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 |
-
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
|
|
|
|
51 |
|
52 |
-
|
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 |
-
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
|
62 |
-
|
|
|
|
|
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 |
-
|
73 |
|
74 |
-
[
|
|
|
75 |
|
76 |
## Training Details
|
77 |
|
78 |
### Training Data
|
79 |
|
80 |
-
|
|
|
|
|
81 |
|
82 |
-
|
|
|
83 |
|
84 |
### Training Procedure
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
|
90 |
-
[
|
91 |
|
|
|
92 |
|
93 |
-
|
94 |
|
95 |
-
|
96 |
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
|
99 |
-
|
100 |
|
101 |
-
|
|
|
102 |
|
103 |
## Evaluation
|
104 |
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
### Testing Data, Factors & Metrics
|
108 |
|
109 |
#### Testing Data
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
|
121 |
#### Metrics
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
|
127 |
### Results
|
128 |
|
129 |
-
[
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
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 |
-
[More Information Needed]
|
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]
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
license: mit
|
5 |
library_name: transformers
|
6 |
+
metrics:
|
7 |
+
- f1
|
8 |
+
pipeline_tag: text2text-generation
|
9 |
---
|
10 |
|
11 |
# Model Card for Model ID
|
12 |
|
|
|
|
|
|
|
|
|
13 |
## Model Details
|
14 |
|
15 |
### Model Description
|
16 |
|
17 |
+
- **Developed by:** Reforged by [nicolay-r](https://github.com/nicolay-r), initial credits for implementation to [scofield7419](https://github.com/scofield7419)
|
18 |
+
- **Model type:** [Flan-T5](https://huggingface.co/docs/transformers/en/model_doc/flan-t5)
|
19 |
+
- **Language(s) (NLP):** English
|
20 |
+
- **License:** [Apache License 2.0](https://github.com/scofield7419/THOR-ISA/blob/main/LICENSE.txt)
|
21 |
|
22 |
+
### Model Sources
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
- **Repository:** [Reasoning-for-Sentiment-Analysis-Framework](https://github.com/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework)
|
25 |
+
- **Paper:** https://arxiv.org/abs/2404.12342
|
26 |
+
- **Demo:** We have a [code on Google-Colab for launching the related model](https://colab.research.google.com/github/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework/blob/main/Reasoning_for_Sentiment_Analysis_Framework.ipynb)
|
|
|
|
|
|
|
|
|
27 |
|
28 |
## Uses
|
29 |
|
|
|
|
|
30 |
### Direct Use
|
31 |
|
32 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
33 |
|
34 |
+
### Downstream Use
|
35 |
|
36 |
+
Please refer to the [related section](https://github.com/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework?tab=readme-ov-file#three-hop-chain-of-thought-thor) of the **Reasoning-for-Sentiment-Analysis** Framework
|
37 |
|
38 |
+
With this example it applies this model (zero-shot-learning) in the `PROMPT` mode to the validation data of the RuSentNE-2023 competition for evaluation.
|
39 |
|
40 |
+
```sh
|
41 |
+
python thor_finetune.py -m "nicolay-r/flan-t5-tsa-prompt-xl" -r "prompt" -d "rusentne2023" -z -bs 4 -f "./config/config.yaml"
|
42 |
+
```
|
43 |
|
44 |
+
Following the [Google Colab Notebook]((https://colab.research.google.com/github/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework/blob/main/Reasoning_for_Sentiment_Analysis_Framework.ipynb)) for implementation reproduction.
|
|
|
|
|
45 |
|
|
|
46 |
|
47 |
+
### Out-of-Scope Use
|
|
|
|
|
48 |
|
49 |
+
This model represent a fine-tuned version of the Flan-T5 on RuSentNE-2023 dataset.
|
50 |
+
Since dataset represent three-scale output answers (`positive`, `negative`, `neutral`),
|
51 |
+
the behavior in general might be biased to this particular task.
|
52 |
|
53 |
### Recommendations
|
54 |
|
|
|
|
|
55 |
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
56 |
|
57 |
## How to Get Started with the Model
|
58 |
|
59 |
+
Please proceed with the code from the related [Three-Hop-Reasoning CoT](https://github.com/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework?tab=readme-ov-file#three-hop-chain-of-thought-thor) section.
|
60 |
|
61 |
+
Or following the related section on [Google Colab notebook](https://colab.research.google.com/github/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework/blob/main/Reasoning_for_Sentiment_Analysis_Framework.ipynb
|
62 |
+
)
|
63 |
|
64 |
## Training Details
|
65 |
|
66 |
### Training Data
|
67 |
|
68 |
+
We utilize `train` data which was **automatically translated into English using GoogleTransAPI**.
|
69 |
+
The initial source of the texts written in Russian, is from the following repository:
|
70 |
+
https://github.com/dialogue-evaluation/RuSentNE-evaluation
|
71 |
|
72 |
+
The translated version on the dataset in English could be automatically downloaded via the following script:
|
73 |
+
https://github.com/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework/blob/main/rusentne23_download.py
|
74 |
|
75 |
### Training Procedure
|
76 |
|
77 |
+
This model has been trained using the PROMPT-finetuning.
|
|
|
|
|
78 |
|
79 |
+
For training procedure accomplishing, the [reforged version of THoR framework](https://github.com/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework)
|
80 |
|
81 |
+
[Google-colab notebook](https://colab.research.google.com/github/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework/blob/main/Reasoning_for_Sentiment_Analysis_Framework.ipynb) could be used for reproduction.
|
82 |
|
83 |
+
The overall training process took **3 epochs**.
|
84 |
|
85 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/64e62d11d27a8292c3637f86/yemsl0unhvyOBBdbKbbaj.png)
|
86 |
|
|
|
87 |
|
88 |
+
#### Training Hyperparameters
|
89 |
|
90 |
+
- **Training regime:** All the configuration details were highlighted in the related
|
91 |
+
[config](https://github.com/nicolay-r/Reasoning-for-Sentiment-Analysis-Framework/blob/main/config/config.yaml) file
|
92 |
|
93 |
## Evaluation
|
94 |
|
|
|
|
|
95 |
### Testing Data, Factors & Metrics
|
96 |
|
97 |
#### Testing Data
|
98 |
|
99 |
+
The direct link to the `test` evaluation data:
|
100 |
+
https://github.com/dialogue-evaluation/RuSentNE-evaluation/blob/main/final_data.csv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
#### Metrics
|
103 |
|
104 |
+
For the model evaluation, two metrics were used:
|
105 |
+
1. F1_PN -- F1-measure over `positive` and `negative` classes;
|
106 |
+
2. F1_PN0 -- F1-measure over `positive`, `negative`, **and `neutral`** classes;
|
107 |
|
108 |
### Results
|
109 |
|
110 |
+
The test evaluation for this model [showcases](https://arxiv.org/abs/2404.12342) the F1_PN = 60.024
|
111 |
+
|
112 |
+
Below is the log of the training process that showcases the final peformance on the RuSentNE-2023 `test` set after 4 epochs (lines 5-6):
|
113 |
+
```tsv
|
114 |
+
F1_PN F1_PN0 default mode
|
115 |
+
0 66.678 73.838 73.838 valid
|
116 |
+
1 68.019 74.816 74.816 valid
|
117 |
+
2 67.870 74.688 74.688 valid
|
118 |
+
3 65.090 72.449 72.449 test
|
119 |
+
4 65.090 72.449 72.449 test
|
120 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|