Update app.py
Browse files
app.py
CHANGED
@@ -78,15 +78,17 @@ def get_most_similar_tag(user_query, dataframe):
|
|
78 |
def main():
|
79 |
# StreamLit Title
|
80 |
st.title("TagaCare")
|
81 |
-
|
82 |
-
doc1 = nlp("Pano gamutin ang sakit sa ngipin")
|
83 |
-
|
84 |
-
st.success(doc1)
|
85 |
|
86 |
-
#
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
if __name__ == "__main__":
|
92 |
main()
|
|
|
78 |
def main():
|
79 |
# StreamLit Title
|
80 |
st.title("TagaCare")
|
|
|
|
|
|
|
|
|
81 |
|
82 |
+
# React to user input
|
83 |
+
if prompt := st.chat_input("Magtanong ng lunas sa sakit"):
|
84 |
+
|
85 |
+
doc = nlp(prompt)
|
86 |
+
|
87 |
+
# Use the cached function to get the most similar tag
|
88 |
+
returned_tag, returned_score = get_most_similar_tag(doc, patterns_df)
|
89 |
+
|
90 |
+
st.success(returned_tag + str(returned_score))
|
91 |
+
st.success(responses_df[responses_df['tag']==returned_tag]['response'][0]))
|
92 |
|
93 |
if __name__ == "__main__":
|
94 |
main()
|