Nuthanon commited on
Commit
ec69e1d
·
verified ·
1 Parent(s): 432f311

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -2,11 +2,10 @@ import streamlit as st
2
  from transformers import pipeline
3
 
4
  st.title("Test")
5
- test_pipeline = pipeline("sentiment.analysis")
6
 
7
- prompt = st.text_area("Hi")
8
 
9
- if st.button("Analyse"):
10
- result = test_pipeline(prompt)
11
- st.write("Sentiment", result[0]["label"])
12
- st.write("Confident Score", result[0]["score"])
 
2
  from transformers import pipeline
3
 
4
  st.title("Test")
5
+ test_pipeline = pipeline("sentiment-analysis")
6
 
7
+ text = st.text_area("Enter some text")
8
 
9
+ if text:
10
+ out = test_pipeline(text)
11
+ st.json(out)