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