Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,10 +88,13 @@ elif mode == "Idioms in sentences":
|
|
| 88 |
|
| 89 |
if st.button("Detect"):
|
| 90 |
found = detect_idioms(text, idioms)
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
| 93 |
if not found:
|
| 94 |
st.info("No idioms detected.")
|
|
|
|
| 95 |
else:
|
| 96 |
# Highlight detected idioms in the text
|
| 97 |
highlighted_text = text
|
|
|
|
| 88 |
|
| 89 |
if st.button("Detect"):
|
| 90 |
found = detect_idioms(text, idioms)
|
| 91 |
+
# use AI if no matching idioms
|
| 92 |
+
if not found:
|
| 93 |
+
found = detect_idioms_ai(text, idiom_map)
|
| 94 |
+
|
| 95 |
if not found:
|
| 96 |
st.info("No idioms detected.")
|
| 97 |
+
|
| 98 |
else:
|
| 99 |
# Highlight detected idioms in the text
|
| 100 |
highlighted_text = text
|