Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,18 +5,18 @@ 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 |
for example in dataset["train"]:
|
| 16 |
-
if
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
else:
|
| 22 |
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 |
+
found = False
|
| 16 |
for example in dataset["train"]:
|
| 17 |
+
if question.lower() in example["word"].lower():
|
| 18 |
+
st.write("Definition:", example["gloss"])
|
| 19 |
+
found = True
|
| 20 |
+
break
|
| 21 |
+
if not found:
|
|
|
|
| 22 |
st.write("Sorry, the answer to your question is not available.")
|