Zack commited on
Commit
197d71a
·
1 Parent(s): a44005d

adding emotion classifier to the app

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -1,7 +1,12 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
- model_name = ''
5
 
6
- st.text('Hello world!')
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)