davidlee1102
commited on
Commit
•
6911d6a
1
Parent(s):
f0372d1
Add user feedback
Browse files- app.py +16 -1
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
from emotion_model import emotion_predict
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
name = st.text_input("Enter your sentence here")
|
6 |
if (st.button('Submit')):
|
@@ -11,4 +16,14 @@ if (st.button('Submit')):
|
|
11 |
result_check = "Error"
|
12 |
print(E)
|
13 |
st.success(result_check)
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
from emotion_model import emotion_predict
|
4 |
+
from transformers import logging
|
5 |
+
from datetime import datetime
|
6 |
+
|
7 |
+
# Enable logging
|
8 |
+
logging.set_verbosity_info()
|
9 |
|
10 |
name = st.text_input("Enter your sentence here")
|
11 |
if (st.button('Submit')):
|
|
|
16 |
result_check = "Error"
|
17 |
print(E)
|
18 |
st.success(result_check)
|
19 |
+
|
20 |
+
user_response = st.text_input("Please give your emotion that you are thinking is correct")
|
21 |
+
if (st.button('Submit Feedback')):
|
22 |
+
if user_response:
|
23 |
+
st.success("Thank you for contributing")
|
24 |
+
logging.set_verbosity_info()
|
25 |
+
logging.info(f"{result}, {result_check}, {user_response}, {datetime.now()}")
|
26 |
+
else:
|
27 |
+
st.success("Thank you for using")
|
28 |
+
logging.set_verbosity_info()
|
29 |
+
logging.info(f"{result}, {result_check}, {datetime.now()}")
|
requirements.txt
CHANGED
@@ -210,3 +210,4 @@ widgetsnbextension==4.0.5
|
|
210 |
wrapt==1.14.1
|
211 |
zipp==3.15.0
|
212 |
https://huggingface.co/spacy/en_core_web_sm/resolve/main/en_core_web_sm-any-py3-none-any.whl
|
|
|
|
210 |
wrapt==1.14.1
|
211 |
zipp==3.15.0
|
212 |
https://huggingface.co/spacy/en_core_web_sm/resolve/main/en_core_web_sm-any-py3-none-any.whl
|
213 |
+
transformers==4.29.0
|