File size: 916 Bytes
6360f05
 
3b096e3
6911d6a
 
 
 
 
6360f05
3b096e3
c23c5f8
6360f05
3b096e3
 
 
 
 
 
6911d6a
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import streamlit as st

from emotion_model import emotion_predict
from transformers import logging
from datetime import datetime

# Enable logging
logging.set_verbosity_info()

name = st.text_input("Enter your sentence here")
if (st.button('Submit')):
    result = name.title()
    try:
        result_check = emotion_predict(result)
    except Exception as E:
        result_check = "Error"
        print(E)
    st.success(result_check)

user_response = st.text_input("Please give your emotion that you are thinking is correct")
if (st.button('Submit Feedback')):
    if user_response:
        st.success("Thank you for contributing")
        logging.set_verbosity_info()
        logging.info(f"{result}, {result_check},  {user_response}, {datetime.now()}")
    else:
        st.success("Thank you for using")
        logging.set_verbosity_info()
        logging.info(f"{result}, {result_check}, {datetime.now()}")