Ash808 commited on
Commit
c51307f
·
verified ·
1 Parent(s): af60de9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,9 +1,13 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
 
4
  pipe = pipeline('sentiment-analysis')
 
 
5
  text = st.text_area('Enter some Text')
6
 
 
7
  if text:
8
  out = pipe(text)
9
- st.json(out)
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+ # Initialize the sentiment analysis pipeline
5
  pipe = pipeline('sentiment-analysis')
6
+
7
+ # Create a text area in the Streamlit app for user input
8
  text = st.text_area('Enter some Text')
9
 
10
+ # If the user has entered text, perform sentiment analysis and display the results
11
  if text:
12
  out = pipe(text)
13
+ st.json(out)