Update README.md
Browse files
README.md
CHANGED
|
@@ -88,12 +88,13 @@ This setup lets one checkpoint handle both analysis (populism flag) and explanat
|
|
| 88 |
|
| 89 |
## Usage:
|
| 90 |
|
| 91 |
-
install dependency:
|
| 92 |
-
|
|
|
|
| 93 |
|
| 94 |
then run:
|
| 95 |
|
| 96 |
-
import torch
|
| 97 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 98 |
|
| 99 |
MODEL_ID = "tdickson17/Populism_detection"
|
|
@@ -147,15 +148,17 @@ def classify_populism_label(text: str, threshold: float = THRESHOLD, include_pro
|
|
| 147 |
text = """<Insert Text here>"""
|
| 148 |
print(classify_populism_label(text))
|
| 149 |
print("\nSummary:\n", summarize(text))
|
|
|
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
## Citation:
|
| 154 |
|
| 155 |
-
@article{dickson2024going,
|
| 156 |
title={Going against the grain: Climate change as a wedge issue for the radical right},
|
| 157 |
author={Dickson, Zachary P and Hobolt, Sara B},
|
| 158 |
journal={Comparative Political Studies},
|
| 159 |
year={2024},
|
| 160 |
publisher={SAGE Publications Sage CA: Los Angeles, CA}
|
| 161 |
}
|
|
|
|
|
|
| 88 |
|
| 89 |
## Usage:
|
| 90 |
|
| 91 |
+
install dependency (Bash):
|
| 92 |
+
|
| 93 |
+
```pip install transformers```
|
| 94 |
|
| 95 |
then run:
|
| 96 |
|
| 97 |
+
```import torch
|
| 98 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 99 |
|
| 100 |
MODEL_ID = "tdickson17/Populism_detection"
|
|
|
|
| 148 |
text = """<Insert Text here>"""
|
| 149 |
print(classify_populism_label(text))
|
| 150 |
print("\nSummary:\n", summarize(text))
|
| 151 |
+
```
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
## Citation:
|
| 156 |
|
| 157 |
+
```@article{dickson2024going,
|
| 158 |
title={Going against the grain: Climate change as a wedge issue for the radical right},
|
| 159 |
author={Dickson, Zachary P and Hobolt, Sara B},
|
| 160 |
journal={Comparative Political Studies},
|
| 161 |
year={2024},
|
| 162 |
publisher={SAGE Publications Sage CA: Los Angeles, CA}
|
| 163 |
}
|
| 164 |
+
```
|