Sentiments.py
Browse files- sentiment.py +13 -0
sentiment.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
|
5 |
+
pipe = pipeline('sentiment-analysis')
|
6 |
+
|
7 |
+
text = st.text_area("Enter some text!")
|
8 |
+
|
9 |
+
if text:
|
10 |
+
out = pipe(text)
|
11 |
+
|
12 |
+
|
13 |
+
st.json(out[0]['label'] + " : " + out[0]['score'])
|