File size: 2,138 Bytes
3be53cf
a0a49dd
3be53cf
a0a49dd
3be53cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9fa04dc
3be53cf
 
 
 
 
 
 
 
 
 
 
a0a49dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Model Card Climate-TwitterBERT-step-1 

## Overview:

Using Covid-Twitter-BERT-v2 (https://huggingface.co/digitalepidemiologylab/covid-twitter-bert-v2) as the starting model, we continued domain-adaptive pre-training on a corpus of firm tweets between 2007 and 2020. The model was then fine-tuned on the downstream task to classify whether a given tweet is related to climate change topics.

The model provides a label and probability score, indicating whether a given tweet is related to climate change topics (label = 1) or not (label = 0).

## Performance metrics:

Based on the test set, the model achieves the following results:

•	Loss: 0.0632
•	F1-weighted: 0.9778      
•	F1: 0.9148
•	Accuracy: 0.9775
•	Precision: 0. 8841
•	Recall: 0. 9477

## Example usage:

```python
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification

task_name = 'binary'
model_name = Climate-TwitterBERT/ Climate-TwitterBERT-step1'

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

pipe = pipeline(task=‘binary‘, model=model, tokenizer=tokenizer)

tweet = "We are committed to significantly cutting our carbon emissions by 30% before 2030."
result = pipe(tweet)
# The 'result' variable will contain the classification output: 0 = non-climate tweet, 1= climate tweet
```

## Citation: 

```bibtex
@article{fzz2023climatetwitter,
  title={Responding to Climate Change crisis - firms' tradeoffs},
  author={Fritsch, Felix and Zhang, Qi and Zheng, Xiang},
  journal={Working paper},
  year={2023},
  institution={University of Mannheim, the Chinese University of Hong Kong, and NHH Norwegian School of Economics},
url={https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4527255}
}
```

Fritsch, F., Zhang, Q., & Zheng, X. (2023). Responding to Climate Change crisis - firms' tradeoffs [Working paper]. University of Mannheim, the Chinese University of Hong Kong, and NHH Norwegian School of Economics.


## Framework versions
•	Transformers 4.28.1
•	Pytorch 2.0.1+cu118
•	Datasets 2.14.1
•	Tokenizers 0.13.3