Spaces:
Runtime error
Runtime error
azaninello
commited on
Commit
•
e4c6728
1
Parent(s):
ea54f05
Update app.py
Browse files
app.py
CHANGED
@@ -27,16 +27,17 @@ def search_engine(target):
|
|
27 |
for i,sent in enumerate(sentences_lower):
|
28 |
if target.lower() in sent:
|
29 |
result.append(sentences[i])
|
30 |
-
return result
|
31 |
|
32 |
-
def bot(result):
|
33 |
if len(result) == 0:
|
34 |
return f"Non ho trovato la parola '{target}' nei testi.\n"
|
35 |
|
36 |
else:
|
37 |
-
return
|
38 |
|
|
|
|
|
39 |
|
|
|
40 |
def numerical(number):
|
41 |
return int(number)
|
42 |
|
@@ -68,7 +69,7 @@ with demo:
|
|
68 |
b2.click(upper, inputs=[result, number], outputs=f"""{s for s in display}""")
|
69 |
|
70 |
demo.launch()
|
71 |
-
|
72 |
'''
|
73 |
demo = gr.Interface([fn=sentence, inputs='text', outputs='text'], [n=upper, inputs=cerca_una_parola, outputs='text'])
|
74 |
demo.launch()
|
|
|
27 |
for i,sent in enumerate(sentences_lower):
|
28 |
if target.lower() in sent:
|
29 |
result.append(sentences[i])
|
|
|
30 |
|
|
|
31 |
if len(result) == 0:
|
32 |
return f"Non ho trovato la parola '{target}' nei testi.\n"
|
33 |
|
34 |
else:
|
35 |
+
return f"""Ho trovato {len(result)} {"frasi" if len(result) > 1 else "frase"} in cui è presente la parola {target}.\n {s for s in result}"""
|
36 |
|
37 |
+
demo = gr.Interface(fn=search_engine, inputs='text', outputs='text'])
|
38 |
+
demo.launch()
|
39 |
|
40 |
+
'''
|
41 |
def numerical(number):
|
42 |
return int(number)
|
43 |
|
|
|
69 |
b2.click(upper, inputs=[result, number], outputs=f"""{s for s in display}""")
|
70 |
|
71 |
demo.launch()
|
72 |
+
'''
|
73 |
'''
|
74 |
demo = gr.Interface([fn=sentence, inputs='text', outputs='text'], [n=upper, inputs=cerca_una_parola, outputs='text'])
|
75 |
demo.launch()
|