Spaces:
Runtime error
Runtime error
Tho Tran
commited on
final changes hopefully
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ from transformers import AutoTokenizer, AutoConfig
|
|
4 |
import numpy as np
|
5 |
from scipy.special import softmax
|
6 |
import streamlit as st
|
|
|
7 |
# Preprocess text (username and link placeholders)
|
8 |
-
st.title("Tho Tran Milestone2")
|
9 |
def preprocess(text):
|
10 |
new_text = []
|
11 |
for t in text.split(" "):
|
@@ -38,4 +38,7 @@ ranking = ranking[::-1]
|
|
38 |
for i in range(scores.shape[0]):
|
39 |
l = config.id2label[ranking[i]]
|
40 |
s = scores[ranking[i]]
|
41 |
-
print(f"{i+1}) {l} {np.round(float(s), 4)}")
|
|
|
|
|
|
|
|
4 |
import numpy as np
|
5 |
from scipy.special import softmax
|
6 |
import streamlit as st
|
7 |
+
st.title("Tho Tran - Milestone1")
|
8 |
# Preprocess text (username and link placeholders)
|
|
|
9 |
def preprocess(text):
|
10 |
new_text = []
|
11 |
for t in text.split(" "):
|
|
|
38 |
for i in range(scores.shape[0]):
|
39 |
l = config.id2label[ranking[i]]
|
40 |
s = scores[ranking[i]]
|
41 |
+
# print(f"{i+1}) {l} {np.round(float(s), 4)}")
|
42 |
+
st.write(l,np.round(float(s),4))
|
43 |
+
|
44 |
+
st.write("choosen model is https://huggingface.co/cardiffnlp/twitter-xlm-roberta-base-sentiment?text=T%27estimo%21")
|