Spaces:
Runtime error
Runtime error
azaninello
commited on
Commit
•
836051d
1
Parent(s):
fd2d594
Update app.py
Browse files
app.py
CHANGED
@@ -57,11 +57,11 @@ def search_engine_collocations(target = 'scarto' , colloc = 'azioni' , nlp = nlp
|
|
57 |
|
58 |
return f"Ho trovato {len(verbs)} azioni legate a '{target}'\n{stringed_results}"
|
59 |
|
60 |
-
|
61 |
return f"Non ho trovato azioni legate a '{target}'"
|
62 |
|
63 |
|
64 |
-
|
65 |
adj_fdist = FreqDist(adjectives)
|
66 |
|
67 |
stringed_results = ''
|
@@ -70,11 +70,11 @@ def search_engine_collocations(target = 'scarto' , colloc = 'azioni' , nlp = nlp
|
|
70 |
|
71 |
return f"Ho trovato {len(adjectives)} caratteristiche legate a '{target}'\n{stringed_results}"
|
72 |
|
73 |
-
|
74 |
return f"Non ho trovato caratteristiche legate a '{target}'"
|
75 |
|
76 |
|
77 |
-
|
78 |
nouns_fdist = FreqDist(verbs)
|
79 |
|
80 |
stringed_results = ''
|
@@ -83,7 +83,7 @@ def search_engine_collocations(target = 'scarto' , colloc = 'azioni' , nlp = nlp
|
|
83 |
|
84 |
return f"Ho trovato {len(nouns)} concetti legati a '{target}'\n{stringed_results}"
|
85 |
|
86 |
-
|
87 |
return f"Non ho trovato concetti legate a '{target}'"
|
88 |
|
89 |
|
|
|
57 |
|
58 |
return f"Ho trovato {len(verbs)} azioni legate a '{target}'\n{stringed_results}"
|
59 |
|
60 |
+
elif verbs == []:
|
61 |
return f"Non ho trovato azioni legate a '{target}'"
|
62 |
|
63 |
|
64 |
+
if colloc == 'caratteristiche' and adjectives != []:
|
65 |
adj_fdist = FreqDist(adjectives)
|
66 |
|
67 |
stringed_results = ''
|
|
|
70 |
|
71 |
return f"Ho trovato {len(adjectives)} caratteristiche legate a '{target}'\n{stringed_results}"
|
72 |
|
73 |
+
elif adjectives == []:
|
74 |
return f"Non ho trovato caratteristiche legate a '{target}'"
|
75 |
|
76 |
|
77 |
+
if colloc == 'concetti' and nouns != []:
|
78 |
nouns_fdist = FreqDist(verbs)
|
79 |
|
80 |
stringed_results = ''
|
|
|
83 |
|
84 |
return f"Ho trovato {len(nouns)} concetti legati a '{target}'\n{stringed_results}"
|
85 |
|
86 |
+
elif nouns == []:
|
87 |
return f"Non ho trovato concetti legate a '{target}'"
|
88 |
|
89 |
|