Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,17 +5,17 @@ from datasets import load_dataset
|
|
| 5 |
dataset = load_dataset("marksverdhei/wordnet-definitions-en-2021")
|
| 6 |
|
| 7 |
# Streamlit app
|
| 8 |
-
st.title("
|
| 9 |
|
| 10 |
# Input question
|
| 11 |
question = st.text_input("Enter your question:")
|
| 12 |
|
| 13 |
# Search for the corresponding definition
|
| 14 |
if question:
|
| 15 |
-
definitions = dataset["train"].filter(lambda example: question.lower() in example["
|
| 16 |
if len(definitions) > 0:
|
| 17 |
st.write("Definitions:")
|
| 18 |
for i, definition in enumerate(definitions):
|
| 19 |
-
st.write(f"{i+1}. {definition['
|
| 20 |
else:
|
| 21 |
st.write("Sorry, the answer to your question is not available.")
|
|
|
|
| 5 |
dataset = load_dataset("marksverdhei/wordnet-definitions-en-2021")
|
| 6 |
|
| 7 |
# Streamlit app
|
| 8 |
+
st.title("TouchDown Buddy Chatbot")
|
| 9 |
|
| 10 |
# Input question
|
| 11 |
question = st.text_input("Enter your question:")
|
| 12 |
|
| 13 |
# Search for the corresponding definition
|
| 14 |
if question:
|
| 15 |
+
definitions = dataset["train"].filter(lambda example: question.lower() in example["gloss"].lower())
|
| 16 |
if len(definitions) > 0:
|
| 17 |
st.write("Definitions:")
|
| 18 |
for i, definition in enumerate(definitions):
|
| 19 |
+
st.write(f"{i+1}. {definition['gloss']}")
|
| 20 |
else:
|
| 21 |
st.write("Sorry, the answer to your question is not available.")
|