luisespinosa commited on
Commit
34a6247
1 Parent(s): 8eacbc5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -9
README.md CHANGED
@@ -6,15 +6,6 @@ To evaluate this and other models on Twitter-specific data, please refer to the
6
 
7
  ## Example of classification
8
 
9
- # Preprocess text (username and link placeholders)
10
- def preprocess(text):
11
- new_text = []
12
- for t in text.split(" "):
13
- t = '@user' if t.startswith('@') and len(t) > 1 else t
14
- t = 'http' if t.startswith('http') else t
15
- new_text.append(t)
16
- return " ".join(new_text)
17
-
18
  ```python
19
  from transformers import AutoModelForSequenceClassification
20
  from transformers import TFAutoModelForSequenceClassification
@@ -24,6 +15,15 @@ from scipy.special import softmax
24
  import csv
25
  import urllib.request
26
 
 
 
 
 
 
 
 
 
 
27
  # Tasks:
28
  # emoji, emotion, hate, irony, offensive, sentiment
29
  # stance/abortion, stance/atheism, stance/climate, stance/feminist, stance/hillary
 
6
 
7
  ## Example of classification
8
 
 
 
 
 
 
 
 
 
 
9
  ```python
10
  from transformers import AutoModelForSequenceClassification
11
  from transformers import TFAutoModelForSequenceClassification
 
15
  import csv
16
  import urllib.request
17
 
18
+ # Preprocess text (username and link placeholders)
19
+ def preprocess(text):
20
+ new_text = []
21
+ for t in text.split(" "):
22
+ t = '@user' if t.startswith('@') and len(t) > 1 else t
23
+ t = 'http' if t.startswith('http') else t
24
+ new_text.append(t)
25
+ return " ".join(new_text)
26
+
27
  # Tasks:
28
  # emoji, emotion, hate, irony, offensive, sentiment
29
  # stance/abortion, stance/atheism, stance/climate, stance/feminist, stance/hillary