krishnagarg09
commited on
Commit
•
71a2c39
1
Parent(s):
436a66e
Add model card and gitignore
Browse files- README.md +87 -0
- gitignore._ +1 -0
README.md
CHANGED
@@ -1,3 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
1 |
+
<<<<<<< HEAD
|
2 |
+
# Model Card for krishnagarg09/stance-detection-semeval2016
|
3 |
+
|
4 |
+
## Model Description
|
5 |
+
The goal is to identify the stance (AGAINST, NONE, FAVOR) of a user towards a given target.
|
6 |
+
|
7 |
+
Sample:
|
8 |
+
|
9 |
+
```
|
10 |
+
Input: Lord, You are my Hope! In You I will always trust.
|
11 |
+
Target: Atheism
|
12 |
+
Stance: AGAINST
|
13 |
+
```
|
14 |
+
|
15 |
+
The model is pretrained on SemEval2016-Task6 stance detection dataset. The dataset is available at https://huggingface.co/datasets/krishnagarg09/SemEval2016Task6.
|
16 |
+
|
17 |
+
Ref: https://aclanthology.org/S16-1003/ for more details about the dataset
|
18 |
+
|
19 |
+
- **Developed by:** Krishna Garg
|
20 |
+
- **Shared by [Optional]:** Krishna Garg
|
21 |
+
- **Model type:** Language model
|
22 |
+
- **Language(s) (NLP):** en
|
23 |
+
- **License:** mit
|
24 |
+
- **Resources for more information:**
|
25 |
+
- [Associated Paper](https://aclanthology.org/S16-1003/)
|
26 |
+
|
27 |
+
## Direct Use
|
28 |
+
```
|
29 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
30 |
+
from datasets import load_dataset
|
31 |
+
|
32 |
+
# load model and tokenizer
|
33 |
+
tokenizer = AutoTokenizer.from_pretrained("krishnagarg09/stance-detection-semeval2016")
|
34 |
+
model = AutoModelForSequenceClassification.from_pretrained("krishnagarg09/stance-detection-semeval2016")
|
35 |
+
|
36 |
+
# load dataset
|
37 |
+
dataset = load_dataset("krishnagarg09/SemEval2016Task6")
|
38 |
+
|
39 |
+
# prepare input
|
40 |
+
text = dataset['test']['Tweet']
|
41 |
+
encoded_input = tokenizer(text, return_tensors='pt', add_special_tokens = True, max_length=128, padding=True, truncation=True)
|
42 |
+
|
43 |
+
# forward pass
|
44 |
+
output = model(**encoded_input)
|
45 |
+
```
|
46 |
+
|
47 |
+
## Dataset
|
48 |
+
The dataset is available at https://huggingface.co/datasets/krishnagarg09/SemEval2016Task6.
|
49 |
+
```
|
50 |
+
dataset = load_dataset("krishnagarg09/SemEval2016Task6")
|
51 |
+
```
|
52 |
+
|
53 |
+
## Training Details
|
54 |
+
optimizer: Adam
|
55 |
+
lr: 2e-5
|
56 |
+
loss: crossentropy
|
57 |
+
epochs: 5 (best weights chosen over validation)
|
58 |
+
batch_size: 32
|
59 |
+
|
60 |
+
### Preprocessing
|
61 |
+
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`
|
62 |
+
|
63 |
+
## Evaluation
|
64 |
+
Evaluation for Stance Detection is done only for 2/3 labels, i.e., FAVOR and AGAINST.
|
65 |
+
|
66 |
+
```
|
67 |
+
Precision: 62.69
|
68 |
+
Recall: 69.43
|
69 |
+
F1: 65.56
|
70 |
+
```
|
71 |
+
|
72 |
+
## Hardware
|
73 |
+
Nvidia RTX A5000 24GB
|
74 |
+
|
75 |
+
## Model Card Contact
|
76 |
+
krishnakantgarg@gmail.com
|
77 |
+
=======
|
78 |
---
|
79 |
license: mit
|
80 |
+
datasets:
|
81 |
+
- krishnagarg09/SemEval2016Task6
|
82 |
+
language:
|
83 |
+
- en
|
84 |
+
metrics:
|
85 |
+
- f1
|
86 |
+
pipeline_tag: text-classification
|
87 |
+
tags:
|
88 |
+
- stance-detection
|
89 |
---
|
90 |
+
>>>>>>> 99d010d9c3077fa4c11c1e4fde96695b5c48a5cf
|
gitignore._
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
*._
|