Spaces:
Runtime error
Runtime error
pritamdeka
commited on
Commit
Β·
33f4608
1
Parent(s):
c6c05b0
Update app.py
Browse files
app.py
CHANGED
@@ -253,14 +253,14 @@ def keyphrase_generator(article_link, model_1, model_2, max_num_keywords, model_
|
|
253 |
sorted_dict = {'Title': sorted_titles, 'Abstract': sorted_abstract_list}
|
254 |
df_new=pd.DataFrame(dict([ (k,pd.Series(v)) for k,v in sorted_dict.items() ]))
|
255 |
df_final = df_new.fillna(' ')
|
256 |
-
fp = df_final.to_csv('title_abstract.csv', index=False)
|
257 |
|
258 |
|
259 |
############################################# Ends here ####################################################
|
260 |
|
261 |
#return df_final
|
262 |
-
return fp
|
263 |
-
|
264 |
|
265 |
|
266 |
igen_pubmed = gr.Interface(keyphrase_generator,
|
@@ -309,8 +309,8 @@ igen_pubmed = gr.Interface(keyphrase_generator,
|
|
309 |
default='pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
|
310 |
label="Select any SBERT model for abstracts from the list below")],
|
311 |
#outputs=gr.outputs.Dataframe(type="auto", label="Retrieved Results from PubMed",max_cols=2, overflow_row_behaviour="paginate"),
|
312 |
-
|
313 |
-
outputs=gr.outputs.File(label=None),
|
314 |
theme="peach", layout="horizontal",
|
315 |
title="PubMed Abstract Retriever", description="Retrieves relevant PubMed abstracts for an online article which can be used as further references. The output is in the form of JSON with <b><i>Titles</i></b> and <b><i>Abstracts</i></b>. Please note that it may take sometime for the models to load. Examples are provided below for demo purposes. Choose any one example to see the results. The models can be changed to see different results. ",
|
316 |
examples=[
|
|
|
253 |
sorted_dict = {'Title': sorted_titles, 'Abstract': sorted_abstract_list}
|
254 |
df_new=pd.DataFrame(dict([ (k,pd.Series(v)) for k,v in sorted_dict.items() ]))
|
255 |
df_final = df_new.fillna(' ')
|
256 |
+
#fp = df_final.to_csv('title_abstract.csv', index=False)
|
257 |
|
258 |
|
259 |
############################################# Ends here ####################################################
|
260 |
|
261 |
#return df_final
|
262 |
+
#return fp
|
263 |
+
return sorted_dict
|
264 |
|
265 |
|
266 |
igen_pubmed = gr.Interface(keyphrase_generator,
|
|
|
309 |
default='pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
|
310 |
label="Select any SBERT model for abstracts from the list below")],
|
311 |
#outputs=gr.outputs.Dataframe(type="auto", label="Retrieved Results from PubMed",max_cols=2, overflow_row_behaviour="paginate"),
|
312 |
+
outputs=gr.outputs.JSON(label="Title and Abstracts"),
|
313 |
+
#outputs=gr.outputs.File(label=None),
|
314 |
theme="peach", layout="horizontal",
|
315 |
title="PubMed Abstract Retriever", description="Retrieves relevant PubMed abstracts for an online article which can be used as further references. The output is in the form of JSON with <b><i>Titles</i></b> and <b><i>Abstracts</i></b>. Please note that it may take sometime for the models to load. Examples are provided below for demo purposes. Choose any one example to see the results. The models can be changed to see different results. ",
|
316 |
examples=[
|