Merge branch 'main' of https://huggingface.co/krishnagarg09/stance-detection-semeval2016 into main
Browse files
README.md
CHANGED
@@ -1,75 +1,3 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
The goal is to identify the stance (AGAINST, NONE, FAVOR) of a user towards a given target.
|
5 |
-
|
6 |
-
Sample:
|
7 |
-
|
8 |
-
```
|
9 |
-
Input: Lord, You are my Hope! In You I will always trust.
|
10 |
-
Target: Atheism
|
11 |
-
Stance: AGAINST
|
12 |
-
```
|
13 |
-
|
14 |
-
The model is pretrained on SemEval2016-Task6 stance detection dataset. The dataset is available at https://huggingface.co/datasets/krishnagarg09/SemEval2016Task6.
|
15 |
-
|
16 |
-
Ref: https://aclanthology.org/S16-1003/ for more details about the dataset
|
17 |
-
|
18 |
-
- **Developed by:** Krishna Garg
|
19 |
-
- **Shared by [Optional]:** Krishna Garg
|
20 |
-
- **Model type:** Language model
|
21 |
-
- **Language(s) (NLP):** en
|
22 |
-
- **License:** mit
|
23 |
-
- **Resources for more information:**
|
24 |
-
- [Associated Paper](https://aclanthology.org/S16-1003/)
|
25 |
-
|
26 |
-
## Direct Use
|
27 |
-
```
|
28 |
-
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
29 |
-
from datasets import load_dataset
|
30 |
-
|
31 |
-
# load model and tokenizer
|
32 |
-
tokenizer = AutoTokenizer.from_pretrained("krishnagarg09/stance-detection-semeval2016")
|
33 |
-
model = AutoModelForSequenceClassification.from_pretrained("krishnagarg09/stance-detection-semeval2016")
|
34 |
-
|
35 |
-
# load dataset
|
36 |
-
dataset = load_dataset("krishnagarg09/SemEval2016Task6")
|
37 |
-
|
38 |
-
# prepare input
|
39 |
-
text = dataset['test']['Tweet']
|
40 |
-
encoded_input = tokenizer(text, return_tensors='pt', add_special_tokens = True, max_length=128, padding=True, truncation=True)
|
41 |
-
|
42 |
-
# forward pass
|
43 |
-
output = model(**encoded_input)
|
44 |
-
```
|
45 |
-
|
46 |
-
## Dataset
|
47 |
-
The dataset is available at https://huggingface.co/datasets/krishnagarg09/SemEval2016Task6.
|
48 |
-
```
|
49 |
-
dataset = load_dataset("krishnagarg09/SemEval2016Task6")
|
50 |
-
```
|
51 |
-
|
52 |
-
## Training Details
|
53 |
-
optimizer: Adam
|
54 |
-
lr: 2e-5
|
55 |
-
loss: crossentropy
|
56 |
-
epochs: 5 (best weights chosen over validation)
|
57 |
-
batch_size: 32
|
58 |
-
|
59 |
-
### Preprocessing
|
60 |
-
Text lowercased, `#semst` tags removed, `p.OPT.URL,p.OPT.EMOJI,p.OPT.RESERVED` removed using `tweet-preprocessor` package, normalization done using `emnlp_dict.txt` and `noslang_data.json`
|
61 |
-
|
62 |
-
## Evaluation
|
63 |
-
Evaluation for Stance Detection is done only for 2/3 labels, i.e., FAVOR and AGAINST.
|
64 |
-
|
65 |
-
```
|
66 |
-
Precision: 62.69
|
67 |
-
Recall: 69.43
|
68 |
-
F1: 65.56
|
69 |
-
```
|
70 |
-
|
71 |
-
## Hardware
|
72 |
-
Nvidia RTX A5000 24GB
|
73 |
-
|
74 |
-
## Model Card Contact
|
75 |
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|