Spaces:
Runtime error
Runtime error
created app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline as Tpipe
|
2 |
+
import streamlit as st
|
3 |
+
|
4 |
+
st.title("Text-To-Sentiment-Analysis")
|
5 |
+
Text_arr=["Hello my name is Alex.","You gotta do way better than that.","That's super cool.","I don't care!","I Hate you!","It's whatever."]
|
6 |
+
pipe = Tpipe("sentiment-analysis")
|
7 |
+
print(Text_arr)
|
8 |
+
st.markdown("This is the list of words that, the program will be testing on")
|
9 |
+
if st.button("Press the button to test"):
|
10 |
+
for text in Text_arr:
|
11 |
+
labels=pipe(text)[0]["label"]
|
12 |
+
score=pipe(text)[0]["score"]
|
13 |
+
print(f"The text \"{text}\" is labeled {labels} with a score of {score} being accurate")
|