Files changed (1) hide show
  1. README.md +84 -7
README.md CHANGED
@@ -4,22 +4,99 @@ license: apache-2.0
4
  datasets:
5
  - hatexplain
6
  ---
7
- The model is used for classifying a text as **Hatespeech**, **Offensive**, or **Normal**. The model is trained using data from Gab and Twitter and *Human Rationales* were included as part of the training data to boost the performance.
 
 
 
 
 
 
 
 
8
 
9
- The dataset and models are available here: https://github.com/punyajoy/HateXplain
 
 
10
 
11
 
12
- **For more details about our paper**
 
 
 
 
 
 
 
13
 
14
- 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.
15
 
16
- ***Please cite our paper in any published work that uses any of these resources.***
 
17
 
18
- ~~~
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  @article{mathew2020hatexplain,
20
  title={HateXplain: A Benchmark Dataset for Explainable Hate Speech Detection},
21
  author={Mathew, Binny and Saha, Punyajoy and Yimam, Seid Muhie and Biemann, Chris and Goyal, Pawan and Mukherjee, Animesh},
22
  journal={arXiv preprint arXiv:2012.10289},
23
  year={2020}
 
24
  }
25
- ~~~
 
4
  datasets:
5
  - hatexplain
6
  ---
7
+ ## Table of Contents
8
+ - [Model Details](#model-details)
9
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
10
+ - [Uses](#uses)
11
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
12
+ - [Training](#training)
13
+ - [Evaluation](#evaluation)
14
+ - [Technical Specifications](#technical-specifications)
15
+ - [Citation Information](#citation-information)
16
 
17
+ ## Model Details
18
+ **Model Description:**
19
+ The model is used for classifying a text as **Hatespeech**, **Offensive**, or **Normal**. The model is trained using data from Gab and Twitter and *Human Rationales* were included as part of the training data to boost the performance. The model also has a rationale predictor head that can predict the rationales given an abusive sentence
20
 
21
 
22
+ - **Developed by:** Binny Mathew, Punyajoy Saha, Seid Muhie Yimam, Chris Biemann, Pawan Goyal, and Animesh Mukherjee
23
+ - **Model Type:** Text Classification
24
+ - **Language(s):** English
25
+ - **License:** Apache-2.0
26
+ - **Parent Model:** See the [BERT base uncased model](https://huggingface.co/bert-base-uncased) for more information about the BERT base model.
27
+ - **Resources for more information:**
28
+ - [Research Paper](https://arxiv.org/abs/2012.10289) Accepted at AAAI 2021.
29
+ - [GitHub Repo with datatsets and models](https://github.com/punyajoy/HateXplain)
30
 
 
31
 
32
+
33
+ ## How to Get Started with the Model
34
 
35
+ **Details of usage**
36
+
37
+ 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.
38
+
39
+ ```python
40
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
41
+ ### from models.py
42
+ from models import *
43
+ tokenizer = AutoTokenizer.from_pretrained("Hate-speech-CNERG/bert-base-uncased-hatexplain-rationale-two")
44
+ model = Model_Rational_Label.from_pretrained("Hate-speech-CNERG/bert-base-uncased-hatexplain-rationale-two")
45
+ inputs = tokenizer('He is a great guy", return_tensors="pt")
46
+ prediction_logits, _ = model(input_ids=inputs['input_ids'],attention_mask=inputs['attention_mask'])
47
+ ```
48
+
49
+ ## Uses
50
+
51
+ #### Direct Use
52
+
53
+ This model can be used for Text Classification
54
+
55
+
56
+ #### Downstream Use
57
+
58
+ [More information needed]
59
+
60
+ #### Misuse and Out-of-scope Use
61
+
62
+ The model should not be used to intentionally create hostile or alienating environments for people. In addition, the model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.
63
+
64
+ ## Risks, Limitations and Biases
65
+
66
+ **CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes.**
67
+
68
+ Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)).
69
+
70
+ (and if you can generate an example of a biased prediction, also something like this):
71
+
72
+ Predictions generated by the model can include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups. For ![example:](https://github.com/hate-alert/HateXplain/blob/master/Figures/dataset_example.png)
73
+
74
+ The model author's also note in their HateXplain paper that they
75
+ > *have not considered any external context such as profile bio, user gender, history of posts etc., which might be helpful in the classification task. Also, in this work we have focused on the English language. It does not consider multilingual hate speech into account.*
76
+
77
+
78
+ #### Training Procedure
79
+
80
+ ##### Preprocessing
81
+
82
+ The authors detail their preprocessing procedure in the [Github repository](https://github.com/hate-alert/HateXplain/tree/master/Preprocess)
83
+
84
+
85
+ ## Evaluation
86
+ The mode authors detail the Hidden layer size and attention for the HateXplain fien tuned models in the [associated paper](https://arxiv.org/pdf/2012.10289.pdf)
87
+
88
+ #### Results
89
+
90
+ The model authors both in their paper and in the git repository provide the illustrative output of the BERT - HateXplain in comparison to BERT and and other HateXplain fine tuned ![models]( https://github.com/hate-alert/HateXplain/blob/master/Figures/bias-subgroup.pdf)
91
+
92
+ ## Citation Information
93
+
94
+ ```bibtex
95
  @article{mathew2020hatexplain,
96
  title={HateXplain: A Benchmark Dataset for Explainable Hate Speech Detection},
97
  author={Mathew, Binny and Saha, Punyajoy and Yimam, Seid Muhie and Biemann, Chris and Goyal, Pawan and Mukherjee, Animesh},
98
  journal={arXiv preprint arXiv:2012.10289},
99
  year={2020}
100
+
101
  }
102
+ ```