justinqbui
commited on
Commit
•
23b3273
1
Parent(s):
a575c9b
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
|
4 |
+
model-index:
|
5 |
+
- name: bertweet-covid--vaccine-tweets-finetuned
|
6 |
+
results: []
|
7 |
+
---
|
8 |
+
|
9 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
10 |
+
should probably proofread and complete it, then remove this comment. -->
|
11 |
+
|
12 |
+
# bertweet-covid19-base-uncased-pretraining-covid-vaccine-tweets
|
13 |
+
|
14 |
+
This model is a fine-tuned version of [justinqbui/bertweet-covid19-base-uncased-pretraining-covid-vaccine-tweets](https://huggingface.co/justinqbui/bertweet-covid19-base-uncased-pretraining-covid-vaccine-tweets) which was finetuned by using [this google fact check](https://huggingface.co/datasets/justinqbui/covid_fact_checked_google_api) ~3k dataset size and webscraped data from [polifact covid info](https://huggingface.co/datasets/justinqbui/covid_fact_checked_polifact) ~ 1200 dataset size and ~1200 tweets pulled from the CDC with tweets containing the words covid or vaccine.
|
15 |
+
It achieves the following results on the evaluation set (20% from the dataset randomly shuffled and selected to serve as a test set):
|
16 |
+
- Validation Loss: 0.246620
|
17 |
+
- Accuracy: 0.902417%
|
18 |
+
|
19 |
+
To use the model, use the inference API.
|
20 |
+
|
21 |
+
Alternatively, to run locally
|
22 |
+
```
|
23 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
24 |
+
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained("justinqbui/bertweet-pretraining-covid-vaccine-tweets-finetuned")
|
26 |
+
|
27 |
+
model = AutoModelForSequenceClassification.from_pretrained("justinqbui/bertweet-pretraining-covid-vaccine-tweets-finetuned")
|
28 |
+
|
29 |
+
```
|
30 |
+
|
31 |
+
## Model description
|
32 |
+
|
33 |
+
This model is a fine-tuned version of pretrained version [justinqbui/bertweet-covid19-base-uncased-pretraining-covid-vaccine-tweets](https://huggingface.co/justinqbui/bertweet-covid19-base-uncased-pretraining-covid-vaccine-tweets). Click on [this](https://huggingface.co/justinqbui/bertweet-covid19-base-uncased-pretraining-covid-vaccine-tweets) to see how the pre-training was done.
|
34 |
+
|
35 |
+
This model was fine-tuned with a dataset of ~5500. A web scraper was used to scrape polifact and a script was used to pull from the google fact check API. Because ~80% of both these datasets were either false or misleading, I pulled about ~1200 tweets from the CDC related to covid and labelled them as true. ~30% of this dataset is considered true and the rest false or misleading. Please see the published datasets above for more detailed information.
|
36 |
+
|
37 |
+
The tokenizer requires the emoji library to be installed.
|
38 |
+
```
|
39 |
+
!pip install nltk emoji
|
40 |
+
```
|
41 |
+
|
42 |
+
## Intended uses & limitations
|
43 |
+
|
44 |
+
The intended use of this model is to detect if the contents of a covid tweet is potentially false or misleading. This model is not an end all be all. It has many limitations. For example, if someone makes a post containing an image, but has attached a satirical image, this model would not be able to distinguish this. If a user links a website, the tokenizer allocates a special token for links, meaning the contents of the linked website is completely lost. If someone tweets a reply, this model can't look at the parent tweets, and will lack context.
|
45 |
+
|
46 |
+
This model's dataset relies on the crowd-sourcing annotations being accurate.
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
## Training and evaluation data
|
52 |
+
|
53 |
+
This model was finetuned by using [this google fact check](https://huggingface.co/datasets/justinqbui/covid_fact_checked_google_api) ~3k dataset size and webscraped data from [polifact covid info](https://huggingface.co/datasets/justinqbui/covid_fact_checked_polifact) ~ 1200 dataset size and ~1200 tweets pulled from the CDC with tweets containing the words covid or vaccine.
|
54 |
+
|
55 |
+
|
56 |
+
### Training hyperparameters
|
57 |
+
|
58 |
+
The following hyperparameters were used during training:
|
59 |
+
- learning_rate: 2e-5
|
60 |
+
- train_batch_size: 128
|
61 |
+
- eval_batch_size: 128
|
62 |
+
- seed: 42
|
63 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
64 |
+
- lr_scheduler_type: linear
|
65 |
+
- num_epochs: 3.0
|
66 |
+
-
|
67 |
+
|
68 |
+
### Training results
|
69 |
+
|
70 |
+
| Training Loss | Epoch | Validation Loss | Accuracy |
|
71 |
+
|:-------------:|:-----:|:---------------:|:--------:|
|
72 |
+
| 0.435500 | 1.0 | 0.401900 | 0.906893 |
|
73 |
+
| 0.309700 | 2.0 | 0.265500 | 0.907789 |
|
74 |
+
| 0.266200 | 3.0 | 0.216500 | 0.911370 |
|
75 |
+
|
76 |
+
|
77 |
+
### Framework versions
|
78 |
+
|
79 |
+
- Transformers 4.13.0
|
80 |
+
- Pytorch 1.10.0+cu111
|
81 |
+
- Datasets 1.16.1
|
82 |
+
- Tokenizers 0.10.3
|