Tej19 commited on
Commit
b06f80c
1 Parent(s): c09b748

Sentiments.py

Browse files
Files changed (1) hide show
  1. 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'])