-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
40 lines (32 loc) · 1.12 KB
/
Copy pathapp.py
File metadata and controls
40 lines (32 loc) · 1.12 KB
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
31
32
33
34
35
36
37
38
39
40
from sklearn import svm
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
import numpy as np
import asyncio
import numpy as np
import pandas as pd
import streamlit as st
import chat
prediction_label = chat.predicted_label()
def main():
st.title("🧠 Project.Budd-e()")
# Use a container to keep chat history
container = st.container()
user_input = st.text_input("You: ")
containerStat = st.container()
if prediction_label == ' [Positive]':
containerStat.write(f":green[{prediction_label}]")
elif prediction_label == ' [Neutral]':
containerStat.write(f":orange[{prediction_label}]")
elif prediction_label == ' [Negative]':
containerStat.write(f":red[{prediction_label}]")
if st.button("Send"):
# Display user message
#container.write(f"You: {user_input}")
# Get chatbot response
response = chat.chatbot_response(user_input)
# Display chatbot message
#container.write(f"{response}")
chat.display_messages(container)
if __name__ == "__main__":
(main())