Views
No views yet
1from transformers import AutoTokenizer, pipeline,RobertaForSequenceClassification
2
3tokenizer = AutoTokenizer.from_pretrained("climatebert/distilroberta-base-climate-f")
4climateattention = RobertaForSequenceClassification.from_pretrained('kruthof/climateattention-ctw',num_labels=2)
5
6ClimateAttention = pipeline("text-classification", model=climateattention, tokenizer=tokenizer)
7
8ClimateAttention('Emissions have increased during the last several months')
9
10>> [{'label': 'Yes', 'score': 0.9993829727172852}]
11| Accuracy | Precision | Recall | F1 |
|---|---|---|---|
| 0.8834 | 0.8717 | 0.8991 | 0.8852 |
# References:
Varini, F. S., Boyd-Graber, J., Ciaramita, M., & Leippold, M. (2020).
ClimaText: A dataset for climate change topic detection. arXiv preprint arXiv:2012.00483.
Webersinke, N., Kraus, M., Bingler, J. A., & Leippold, M. (2021).
Climatebert: A pretrained language model for climate-related text. arXiv preprint arXiv:2110.12010.
------------------------------
https://kruthof.github.io