Spaces:
Runtime error
Runtime error
Commit
·
9dbd96b
1
Parent(s):
1f9eb21
Update app.py
Browse files
app.py
CHANGED
@@ -171,7 +171,13 @@ text = st.text_input("Enter text:")
|
|
171 |
predict_button = st.button("Predict")
|
172 |
|
173 |
# Prediction output
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
# Get probabilities
|
177 |
negative, positive, neutral = predict_sentiment(text)
|
|
|
171 |
predict_button = st.button("Predict")
|
172 |
|
173 |
# Prediction output
|
174 |
+
def predict_sentiment(text):
|
175 |
+
|
176 |
+
inputs = tokenizer(text, return_tensors="pt")
|
177 |
+
|
178 |
+
outputs = model(**inputs)
|
179 |
+
|
180 |
+
# Rest of code to extract probabilities
|
181 |
|
182 |
# Get probabilities
|
183 |
negative, positive, neutral = predict_sentiment(text)
|