Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -62,6 +62,13 @@ unsafe_allow_html=True
|
|
| 62 |
# else:
|
| 63 |
# st.warning(f"The sentiment is {sentiment} with a score of {score*100:.2f}%!")
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
@st.cache_resource()
|
| 67 |
def get_model():
|
|
|
|
| 62 |
# else:
|
| 63 |
# st.warning(f"The sentiment is {sentiment} with a score of {score*100:.2f}%!")
|
| 64 |
|
| 65 |
+
def preprocess(text):
|
| 66 |
+
new_text = []
|
| 67 |
+
for t in text.split(" "):
|
| 68 |
+
t = '@user' if t.startswith('@') and len(t) > 1 else t
|
| 69 |
+
t = 'http' if t.startswith('http') else t
|
| 70 |
+
new_text.append(t)
|
| 71 |
+
return " ".join(new_text)
|
| 72 |
|
| 73 |
@st.cache_resource()
|
| 74 |
def get_model():
|