Spaces:
Sleeping
Sleeping
Zack
commited on
Commit
·
197d71a
1
Parent(s):
a44005d
adding emotion classifier to the app
Browse files
app.py
CHANGED
|
@@ -1,7 +1,12 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
|
| 6 |
-
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
model="SamLowe/roberta-base-go_emotions"
|
| 5 |
|
| 6 |
+
pipe = pipeline("text-classification", model=model)
|
| 7 |
|
| 8 |
+
input_text = st.text_area('Tell me how your day was and I will guess how you are feeling...')
|
| 9 |
+
|
| 10 |
+
if input_text:
|
| 11 |
+
classification = pipe(input_text)
|
| 12 |
+
st.json(classification)
|