Update README.md
Browse files
README.md
CHANGED
@@ -13,6 +13,16 @@ The dataset and models are available here: https://github.com/punyajoy/HateXplai
|
|
13 |
|
14 |
Please use the **Model_Rational_Label** class inside [models.py](models.py) to load the models. The default prediction in this hosted inference API may be wrong due to the use of different class initialisations.
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
**For more details about our paper**
|
17 |
|
18 |
Binny Mathew, Punyajoy Saha, Seid Muhie Yimam, Chris Biemann, Pawan Goyal, and Animesh Mukherjee "[HateXplain: A Benchmark Dataset for Explainable Hate Speech Detection)". Accepted at AAAI 2021.
|
|
|
13 |
|
14 |
Please use the **Model_Rational_Label** class inside [models.py](models.py) to load the models. The default prediction in this hosted inference API may be wrong due to the use of different class initialisations.
|
15 |
|
16 |
+
~~~
|
17 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
18 |
+
### from models.py
|
19 |
+
from models import *
|
20 |
+
tokenizer = AutoTokenizer.from_pretrained("Hate-speech-CNERG/bert-base-uncased-hatexplain-rationale-two")
|
21 |
+
model = Model_Rational_Label.from_pretrained("Hate-speech-CNERG/bert-base-uncased-hatexplain-rationale-two")
|
22 |
+
inputs = tokenizer('He is a great guy", return_tensors="pt")
|
23 |
+
prediction_logits, _ = model(input_ids=inputs['input_ids'],attention_mask=inputs['attention_mask'])
|
24 |
+
~~~
|
25 |
+
|
26 |
**For more details about our paper**
|
27 |
|
28 |
Binny Mathew, Punyajoy Saha, Seid Muhie Yimam, Chris Biemann, Pawan Goyal, and Animesh Mukherjee "[HateXplain: A Benchmark Dataset for Explainable Hate Speech Detection)". Accepted at AAAI 2021.
|