Daniel Tse
commited on
Commit
·
4ebf6a9
1
Parent(s):
ab58fb5
Add sentiment analysis
Browse files
app.py
CHANGED
@@ -1,4 +1,12 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
x = st.slider('Select a value')
|
4 |
st.write(x, 'squared is', x * x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import transformers import pipeline
|
3 |
|
4 |
x = st.slider('Select a value')
|
5 |
st.write(x, 'squared is', x * x)
|
6 |
+
|
7 |
+
pipe = pipeline('sentiment-analysis')
|
8 |
+
text = st.text_area('enter some text')
|
9 |
+
|
10 |
+
if text:
|
11 |
+
out = pipe(text)
|
12 |
+
st.json(out)
|