kyled commited on
Commit
4d85e89
1 Parent(s): 1e6c35c

added bart-large-mnli

Browse files
Files changed (2) hide show
  1. app.py +11 -2
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,4 +1,13 @@
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 as t
3
 
4
+ st.title("Phrase Feeling Analysis")
5
+ classifier = t.pipeline("zero-shot-classification",
6
+ model="facebook/bart-large-mnli")
7
+
8
+ x = st.text_input("Enter your title here:")
9
+
10
+ candidate_labels = ['anger', 'sadness', 'fear', 'joy', 'interest',
11
+ 'surprise', 'disgust', 'shame', 'guilt', 'compassion', 'other']
12
+ output = classifier(x, candidate_labels)
13
+ st.write(output)
requirements.txt CHANGED
@@ -1,3 +1,4 @@
1
  streamlit
 
2
  pandas
3
  plotly
 
1
  streamlit
2
+ transformers
3
  pandas
4
  plotly