kawaa99 commited on
Commit
d16f094
·
verified ·
1 Parent(s): f9760bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- found = detect_idioms_ai(text, idiom_map)
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