Update README.md
This commit is contained in:
parent
8eacbc59c0
commit
34a6247c25
18
README.md
18
README.md
|
@ -6,15 +6,6 @@ To evaluate this and other models on Twitter-specific data, please refer to the
|
|||
|
||||
## Example of classification
|
||||
|
||||
# Preprocess text (username and link placeholders)
|
||||
def preprocess(text):
|
||||
new_text = []
|
||||
for t in text.split(" "):
|
||||
t = '@user' if t.startswith('@') and len(t) > 1 else t
|
||||
t = 'http' if t.startswith('http') else t
|
||||
new_text.append(t)
|
||||
return " ".join(new_text)
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForSequenceClassification
|
||||
from transformers import TFAutoModelForSequenceClassification
|
||||
|
@ -24,6 +15,15 @@ from scipy.special import softmax
|
|||
import csv
|
||||
import urllib.request
|
||||
|
||||
# Preprocess text (username and link placeholders)
|
||||
def preprocess(text):
|
||||
new_text = []
|
||||
for t in text.split(" "):
|
||||
t = '@user' if t.startswith('@') and len(t) > 1 else t
|
||||
t = 'http' if t.startswith('http') else t
|
||||
new_text.append(t)
|
||||
return " ".join(new_text)
|
||||
|
||||
# Tasks:
|
||||
# emoji, emotion, hate, irony, offensive, sentiment
|
||||
# stance/abortion, stance/atheism, stance/climate, stance/feminist, stance/hillary
|
||||
|
|
Loading…
Reference in New Issue