Winnie-Kay commited on
Commit
de68813
·
1 Parent(s): e5238cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -16
app.py CHANGED
@@ -35,22 +35,15 @@ model2 = AutoModelForSequenceClassification.from_pretrained(model2_path)
35
 
36
  def preprocess(text):
37
  new_text = []
38
-
39
-     # Replace user mentions with '@user'
40
-
41
-     for t in text.split(" "):
42
-
43
-         t = '@user' if t.startswith('@') and len(t) > 1 else t
44
-
45
-         # Replace links with 'http'
46
-
47
-         t = 'http' if t.startswith('http') else t
48
-
49
-         new_text.append(t)
50
-
51
-     # Join the preprocessed text
52
-
53
-     return " ".join(new_text)
54
 
55
 
56
 
 
35
 
36
  def preprocess(text):
37
  new_text = []
38
+   # Replace user mentions with '@user'
39
+ for t in text.split(" "):
40
+ t = '@user' if t.startswith('@') and len(t) > 1 else t
41
+ # Replace links with 'http'
42
+ t = 'http' if t.startswith('http') else t
43
+ new_text.append(t)
44
+ # Join the preprocessed text
45
+
46
+ return " ".join(new_text)
 
 
 
 
 
 
 
47
 
48
 
49