Spaces:
Sleeping
Sleeping
updated app
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ image = st.image("images.png", width=200)
|
|
| 30 |
|
| 31 |
# Get user input
|
| 32 |
text = st.text_input("Type here:")
|
| 33 |
-
|
| 34 |
# d = {
|
| 35 |
|
| 36 |
# 0:'Negative',
|
|
@@ -79,7 +79,7 @@ def get_model():
|
|
| 79 |
return tokenizer,model
|
| 80 |
tokenizer, model = get_model()
|
| 81 |
|
| 82 |
-
if text:
|
| 83 |
text_sample = tokenizer(text, padding = 'max_length',return_tensors = 'pt')
|
| 84 |
# print(text_sample)
|
| 85 |
output = model(**text_sample)
|
|
@@ -88,6 +88,6 @@ if text:
|
|
| 88 |
|
| 89 |
labels = ['Negative','Neutral','Positive']
|
| 90 |
scores = {l:float(s) for (l,s) in zip(labels,scores_)}
|
| 91 |
-
|
| 92 |
# y_pred = np.argmax(output.logits.detach().numpy(),axis =1)
|
| 93 |
-
st.write("Prediction :",scores)
|
|
|
|
| 30 |
|
| 31 |
# Get user input
|
| 32 |
text = st.text_input("Type here:")
|
| 33 |
+
button = st.button('Analyze')
|
| 34 |
# d = {
|
| 35 |
|
| 36 |
# 0:'Negative',
|
|
|
|
| 79 |
return tokenizer,model
|
| 80 |
tokenizer, model = get_model()
|
| 81 |
|
| 82 |
+
if text and button:
|
| 83 |
text_sample = tokenizer(text, padding = 'max_length',return_tensors = 'pt')
|
| 84 |
# print(text_sample)
|
| 85 |
output = model(**text_sample)
|
|
|
|
| 88 |
|
| 89 |
labels = ['Negative','Neutral','Positive']
|
| 90 |
scores = {l:float(s) for (l,s) in zip(labels,scores_)}
|
| 91 |
+
st.write("Logits: ",output.logits)
|
| 92 |
# y_pred = np.argmax(output.logits.detach().numpy(),axis =1)
|
| 93 |
+
# st.write("Prediction :",scores)
|