Downloads · 30 days
10
0% of all-time downloads
krishnagarg09/stance-detection-semeval2016
stance-detection-semeval2016 is a text classification model from krishnagarg09. Use it when you need a label for a piece of text. It is set up for transformers.
The goal is to identify the stance (AGAINST, NONE, FAVOR) of a user towards a given target.
Downloads · 30 days
10
0% of all-time downloads
All-time downloads
4.6K
Public
Repo size
1.6 GB
Likes
3
Public
Click a slice to open those files.
.bin540 MB · 100%
From the Hugging Face model README
The goal is to identify the stance (AGAINST, NONE, FAVOR) of a user towards a given target.
Sample:
Input: Lord, You are my Hope! In You I will always trust.
Target: Atheism
Stance: AGAINST
The model is pretrained on SemEval2016-Task6 stance detection dataset. The dataset is available at https://huggingface.co/datasets/krishnagarg09/SemEval2016Task6.
Ref: https://aclanthology.org/S16-1003/ for more details about the dataset
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from datasets import load_dataset
# load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("krishnagarg09/stance-detection-semeval2016")
model = AutoModelForSequenceClassification.from_pretrained("krishnagarg09/stance-detection-semeval2016")
# load dataset
dataset = load_dataset("krishnagarg09/SemEval2016Task6")
# prepare input
text = dataset['test']['Tweet']
encoded_input = tokenizer(text, return_tensors='pt', add_special_tokens = True, max_length=128, padding=True, truncation=True)
# forward pass
output = model(**encoded_input)
The dataset is available at https://huggingface.co/datasets/krishnagarg09/SemEval2016Task6.
dataset = load_dataset("krishnagarg09/SemEval2016Task6")
optimizer: Adam
lr: 2e-5
loss: crossentropy
epochs: 5 (best weights chosen over validation)
batch_size: 32
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
Evaluation for Stance Detection is done only for 2/3 labels, i.e., FAVOR and AGAINST.
Precision: 62.69
Recall: 69.43
F1: 65.56
Nvidia RTX A5000 24GB