user_id eliminated from gui
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from inference import Inference
|
|
7 |
class QueryInputForm:
|
8 |
def __init__(self):
|
9 |
# Title of the Streamlit form
|
10 |
-
st.title("Query
|
11 |
|
12 |
# Predefined options for channel and device type
|
13 |
self.channel_options = [
|
@@ -23,7 +23,6 @@ class QueryInputForm:
|
|
23 |
]
|
24 |
|
25 |
# Default values for the form
|
26 |
-
self.default_user_id = "b7485193f4e7f5b8ac3c94f71f4456a9"
|
27 |
self.default_query_text = "pizza"
|
28 |
|
29 |
# Initialize the recommender engine
|
@@ -31,7 +30,6 @@ class QueryInputForm:
|
|
31 |
|
32 |
def display_form(self):
|
33 |
# Input fields for user ID, channel, device type, and query text
|
34 |
-
self.user_id = st.text_input("User ID", value=self.default_user_id)
|
35 |
self.channel = st.selectbox("Channel", options=self.channel_options)
|
36 |
self.device_type = st.selectbox("Device Type", options=self.device_type_options)
|
37 |
self.query_text = st.text_input("Query Text", value=self.default_query_text)
|
@@ -43,11 +41,11 @@ class QueryInputForm:
|
|
43 |
def submit(self):
|
44 |
# Pass the query information to the recommender engine
|
45 |
raw_query = {
|
46 |
-
'user_id':
|
47 |
'channel': self.channel,
|
48 |
'device_type': self.device_type,
|
49 |
'query_text': self.query_text,
|
50 |
-
'time': datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"),
|
51 |
}
|
52 |
|
53 |
# Get recommendations
|
|
|
7 |
class QueryInputForm:
|
8 |
def __init__(self):
|
9 |
# Title of the Streamlit form
|
10 |
+
st.title("Query Form")
|
11 |
|
12 |
# Predefined options for channel and device type
|
13 |
self.channel_options = [
|
|
|
23 |
]
|
24 |
|
25 |
# Default values for the form
|
|
|
26 |
self.default_query_text = "pizza"
|
27 |
|
28 |
# Initialize the recommender engine
|
|
|
30 |
|
31 |
def display_form(self):
|
32 |
# Input fields for user ID, channel, device type, and query text
|
|
|
33 |
self.channel = st.selectbox("Channel", options=self.channel_options)
|
34 |
self.device_type = st.selectbox("Device Type", options=self.device_type_options)
|
35 |
self.query_text = st.text_input("Query Text", value=self.default_query_text)
|
|
|
41 |
def submit(self):
|
42 |
# Pass the query information to the recommender engine
|
43 |
raw_query = {
|
44 |
+
'user_id': "new_user", # any user will be considered as a new user
|
45 |
'channel': self.channel,
|
46 |
'device_type': self.device_type,
|
47 |
'query_text': self.query_text,
|
48 |
+
'time': datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"), # querytime
|
49 |
}
|
50 |
|
51 |
# Get recommendations
|