Spaces:
Runtime error
Runtime error
added bart-large-mnli
Browse files- app.py +11 -2
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,4 +1,13 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|