Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def preprocess_text(x):
|
|
28 |
x = re.sub(r"@\S+", " ", x) # mentions
|
29 |
x = re.sub(r"#\S+", " ", x) # hastags
|
30 |
x = re.sub(r"\s{2,}", " ", x) # over spaces
|
31 |
-
|
32 |
|
33 |
return x
|
34 |
|
|
|
28 |
x = re.sub(r"@\S+", " ", x) # mentions
|
29 |
x = re.sub(r"#\S+", " ", x) # hastags
|
30 |
x = re.sub(r"\s{2,}", " ", x) # over spaces
|
31 |
+
x = re.sub("[^.,!'?A-Za-z0-9]+", " ", x) # special charachters except .,!?
|
32 |
|
33 |
return x
|
34 |
|