APJ23 commited on
Commit
bbca308
·
1 Parent(s): 4b961ce

created app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
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")