Saleh-Asaad commited on
Commit
87ea450
·
verified ·
1 Parent(s): 2f01084

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,10 +1,13 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
 
 
4
 
5
- pipeline('sentiment-analysis')
6
  text = st.text_area('Enter Any Text That comes in Your Mind!!')
7
 
 
8
  if text:
9
- out = pipe(text)
10
- st.json(out)
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+ # Define the pipeline and assign it to `pipe`
5
+ pipe = pipeline('sentiment-analysis')
6
 
7
+ # Create a text area for input
8
  text = st.text_area('Enter Any Text That comes in Your Mind!!')
9
 
10
+ # Process the text when the user inputs it
11
  if text:
12
+ out = pipe(text) # Use the `pipe` variable here
13
+ st.json(out) # Display the result as JSON