Update README.md
Browse files
README.md
CHANGED
@@ -16,7 +16,8 @@ tags:
|
|
16 |
|
17 |
<!-- Provide a quick summary of what the model is/does. -->
|
18 |
|
19 |
-
This model provides the class labels either toxic or not toxic as well as the rationales predicted which indicates the explanation of why something as toxic.
|
|
|
20 |
|
21 |
|
22 |
## Model Details
|
@@ -30,8 +31,7 @@ This model provides the class labels either toxic or not toxic as well as the ra
|
|
30 |
- **Developed by:** Punyajoy Saha
|
31 |
- **Model type:** bert-base-uncased
|
32 |
- **Language(s) (NLP):** english
|
33 |
-
- **Finetuned from model [optional]:** bert-base-uncased
|
34 |
-
|
35 |
### Model Sources [optional]
|
36 |
|
37 |
<!-- Provide the basic links for the model. -->
|
@@ -49,36 +49,22 @@ This model provides the class labels either toxic or not toxic as well as the ra
|
|
49 |
|
50 |
This model can be directly used to predict some post as toxic/non-toxic and predicting the rationales behind it
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
[More Information Needed]
|
60 |
-
|
61 |
-
### Out-of-Scope Use
|
62 |
-
|
63 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
64 |
-
|
65 |
-
[More Information Needed]
|
66 |
-
|
67 |
-
## Bias, Risks, and Limitations
|
68 |
-
|
69 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
70 |
-
|
71 |
-
[More Information Needed]
|
72 |
|
73 |
-
|
74 |
|
75 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
76 |
|
77 |
-
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
[More Information Needed]
|
84 |
|
|
|
16 |
|
17 |
<!-- Provide a quick summary of what the model is/does. -->
|
18 |
|
19 |
+
This model provides the class labels either toxic or not toxic as well as the rationales predicted which indicates the explanation of why something as toxic. This model is part of the ECAI paper - "Rationale-Guided Few-Shot Classification to Detect Abusive Language
|
20 |
+
"
|
21 |
|
22 |
|
23 |
## Model Details
|
|
|
31 |
- **Developed by:** Punyajoy Saha
|
32 |
- **Model type:** bert-base-uncased
|
33 |
- **Language(s) (NLP):** english
|
34 |
+
- **Finetuned from model [optional]:** See the [BERT base uncased model](https://huggingface.co/bert-base-uncased) for more information about the BERT base model.
|
|
|
35 |
### Model Sources [optional]
|
36 |
|
37 |
<!-- Provide the basic links for the model. -->
|
|
|
49 |
|
50 |
This model can be directly used to predict some post as toxic/non-toxic and predicting the rationales behind it
|
51 |
|
52 |
+
## How to Get Started with the Model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
+
Use the code below to get started with the model.
|
55 |
|
|
|
56 |
|
57 |
+
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.
|
58 |
|
59 |
+
```python
|
60 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
61 |
+
### from models.py
|
62 |
+
from models import *
|
63 |
+
tokenizer = AutoTokenizer.from_pretrained("Hate-speech-CNERG/bert-base-uncased-hatexplain-rationale-two")
|
64 |
+
model = Model_Rational_Label.from_pretrained("Hate-speech-CNERG/bert-base-uncased-hatexplain-rationale-two")
|
65 |
+
inputs = tokenizer('He is a great guy", return_tensors="pt")
|
66 |
+
prediction_logits, _ = model(input_ids=inputs['input_ids'],attention_mask=inputs['attention_mask'])
|
67 |
+
```
|
68 |
|
69 |
[More Information Needed]
|
70 |
|