kmanoj commited on
Commit
3064b0d
1 Parent(s): e56c4c7

second commit

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -4,8 +4,15 @@ from transformers import pipeline
4
  pipe=pipeline('sentiment-analysis')
5
  # Set the title
6
  st.title("Sentiment Analysis")
7
- text=st.text_area('Enter you text here......')
 
8
 
9
  if text:
10
  out=pipe(text)
11
- st.json(out)
 
 
 
 
 
 
 
4
  pipe=pipeline('sentiment-analysis')
5
  # Set the title
6
  st.title("Sentiment Analysis")
7
+ # Input for text to analyze sentiment
8
+ text = st.text_area("Enter text for sentiment analysis:")
9
 
10
  if text:
11
  out=pipe(text)
12
+ result=st.json(out)
13
+ sentiment = result["label"]
14
+ score = result["score"]
15
+ st.write(f"Sentiment: {sentiment}")
16
+ st.write(f"Sentiment Score: {score}")
17
+ else:
18
+ st.error(f"Error: {response.status_code}, {response.text}")