Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,6 +20,7 @@ def get_nouns(text):
|
|
| 20 |
cnt=0
|
| 21 |
go=True
|
| 22 |
a="Z"
|
|
|
|
| 23 |
if go:
|
| 24 |
for ea in range(10):
|
| 25 |
if go:
|
|
@@ -34,6 +35,7 @@ def get_nouns(text):
|
|
| 34 |
blob_n = TextBlob(sen_list[cnt])
|
| 35 |
noun_p=blob_n.noun_phrases
|
| 36 |
noun_box=[]
|
|
|
|
| 37 |
for ea in blob_n.parse().split(" "):
|
| 38 |
n=ea.split("/")
|
| 39 |
if n[1] == "NN":
|
|
@@ -48,16 +50,26 @@ def get_nouns(text):
|
|
| 48 |
noun_list[str(noun)].append(f'{a}{cont_list[b]}{cont_list[c]}{cont_list[d]}')
|
| 49 |
else:
|
| 50 |
noun_list[str(noun)]=[f'{a}{cont_list[b]}{cont_list[c]}{cont_list[d]}']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
if json_object[f'{a}{cont_list[b]}{cont_list[c]}{cont_list[d]}']=='ZNNN':
|
| 52 |
#if json_object[sen_list[cnt]]=='ZNNN':
|
| 53 |
#print ("Y")
|
| 54 |
a="Y"
|
|
|
|
| 55 |
b=0
|
| 56 |
c=0
|
| 57 |
d=0
|
| 58 |
if json_object[f'{a}{cont_list[b]}{cont_list[c]}{cont_list[d]}']=='YNNN':
|
| 59 |
#print("X")
|
| 60 |
a="X"
|
|
|
|
| 61 |
b=0
|
| 62 |
c=0
|
| 63 |
d=0
|
|
|
|
| 20 |
cnt=0
|
| 21 |
go=True
|
| 22 |
a="Z"
|
| 23 |
+
g="W"
|
| 24 |
if go:
|
| 25 |
for ea in range(10):
|
| 26 |
if go:
|
|
|
|
| 35 |
blob_n = TextBlob(sen_list[cnt])
|
| 36 |
noun_p=blob_n.noun_phrases
|
| 37 |
noun_box=[]
|
| 38 |
+
|
| 39 |
for ea in blob_n.parse().split(" "):
|
| 40 |
n=ea.split("/")
|
| 41 |
if n[1] == "NN":
|
|
|
|
| 50 |
noun_list[str(noun)].append(f'{a}{cont_list[b]}{cont_list[c]}{cont_list[d]}')
|
| 51 |
else:
|
| 52 |
noun_list[str(noun)]=[f'{a}{cont_list[b]}{cont_list[c]}{cont_list[d]}']
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
for nn in noun_box:
|
| 56 |
+
if nn in list(noun_list.keys()):
|
| 57 |
+
noun_list[str(nn)].append(f'{g}{cont_list[b]}{cont_list[c]}{cont_list[d]}')
|
| 58 |
+
else:
|
| 59 |
+
noun_list[str(nn)]=[f'{g}{cont_list[b]}{cont_list[c]}{cont_list[d]}']
|
| 60 |
+
|
| 61 |
if json_object[f'{a}{cont_list[b]}{cont_list[c]}{cont_list[d]}']=='ZNNN':
|
| 62 |
#if json_object[sen_list[cnt]]=='ZNNN':
|
| 63 |
#print ("Y")
|
| 64 |
a="Y"
|
| 65 |
+
g="V"
|
| 66 |
b=0
|
| 67 |
c=0
|
| 68 |
d=0
|
| 69 |
if json_object[f'{a}{cont_list[b]}{cont_list[c]}{cont_list[d]}']=='YNNN':
|
| 70 |
#print("X")
|
| 71 |
a="X"
|
| 72 |
+
g="U"
|
| 73 |
b=0
|
| 74 |
c=0
|
| 75 |
d=0
|