Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -360,7 +360,7 @@ def find_rss():
|
|
360 |
#print(lod['rss']['channel']['item'][0].keys())
|
361 |
#print(lod['rss'].keys())
|
362 |
print("##############")
|
363 |
-
print(lod['rss'].keys())
|
364 |
print("##############")
|
365 |
|
366 |
for i,ea in enumerate(lod['rss']['channel']['item']):
|
@@ -374,16 +374,15 @@ def find_rss():
|
|
374 |
tt_phrases=tt.noun_phrases
|
375 |
if ea.get('description') != None:
|
376 |
r_description = ea['description']
|
377 |
-
else: r_description = [lod['rss']['channel']
|
378 |
td = TextBlob(r_description)
|
379 |
td_nouns=td.tags
|
380 |
td_phrases=td.noun_phrases
|
|
|
|
|
|
|
381 |
|
382 |
-
|
383 |
-
tdd_phrases=[x for x in td.noun_phrases if x[1]=='NN']
|
384 |
-
|
385 |
-
ttt_phrases=[x for x in tt.noun_phrases if x[1]=='NN']
|
386 |
-
phrases=ttt_phrases+tdd_phrases
|
387 |
lods = {"title":r_title, "description":r_description,"link":r_link, "nouns":nouns, "noun_phrases":phrases}
|
388 |
except Exception as e:
|
389 |
print(f"Exception::{ea}")
|
|
|
360 |
#print(lod['rss']['channel']['item'][0].keys())
|
361 |
#print(lod['rss'].keys())
|
362 |
print("##############")
|
363 |
+
#print(lod['rss'].keys())
|
364 |
print("##############")
|
365 |
|
366 |
for i,ea in enumerate(lod['rss']['channel']['item']):
|
|
|
374 |
tt_phrases=tt.noun_phrases
|
375 |
if ea.get('description') != None:
|
376 |
r_description = ea['description']
|
377 |
+
else: r_description = [lod['rss']['channel'].keys()]
|
378 |
td = TextBlob(r_description)
|
379 |
td_nouns=td.tags
|
380 |
td_phrases=td.noun_phrases
|
381 |
+
tdd_nouns=[x for x in td_nouns if x[1]=='NN' or x[1]=='NNP']
|
382 |
+
ttt_nouns=[x1 for x1 in tt_nouns if x[1]=='NN' or x[1]=='NNP']
|
383 |
+
nouns=ttt_nouns+tdd_nouns
|
384 |
|
385 |
+
phrases=tt_phrases+td_phrases
|
|
|
|
|
|
|
|
|
386 |
lods = {"title":r_title, "description":r_description,"link":r_link, "nouns":nouns, "noun_phrases":phrases}
|
387 |
except Exception as e:
|
388 |
print(f"Exception::{ea}")
|