Spaces:
Runtime error
Runtime error
pritamdeka
commited on
Commit
Β·
9b81b01
1
Parent(s):
4b5c859
Update app.py
Browse files
app.py
CHANGED
@@ -254,10 +254,12 @@ def keyphrase_generator(article_link, model_1, model_2, max_num_keywords, model_
|
|
254 |
df_new=pd.DataFrame(dict([ (k,pd.Series(v)) for k,v in sorted_dict.items() ]))
|
255 |
|
256 |
df_final = df_new.fillna(' ')
|
|
|
257 |
|
258 |
############################################# Ends here ####################################################
|
259 |
|
260 |
-
return df_final
|
|
|
261 |
|
262 |
|
263 |
igen_pubmed = gr.Interface(keyphrase_generator,
|
@@ -305,7 +307,8 @@ igen_pubmed = gr.Interface(keyphrase_generator,
|
|
305 |
type="value",
|
306 |
default='pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
|
307 |
label="Select any SBERT model for abstracts from the list below")],
|
308 |
-
outputs=gr.outputs.Dataframe(type="auto", label="Retrieved Results from PubMed",max_cols=2, overflow_row_behaviour="paginate"),
|
|
|
309 |
theme="peach", layout="horizontal",
|
310 |
title="PubMed Abstract Retriever", description="Retrieves relevant PubMed abstracts for an online article which can be used as further references. 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. ",
|
311 |
examples=[
|
|
|
254 |
df_new=pd.DataFrame(dict([ (k,pd.Series(v)) for k,v in sorted_dict.items() ]))
|
255 |
|
256 |
df_final = df_new.fillna(' ')
|
257 |
+
fp = df_final.to_excel(r'Title_Abstract.xlsx', index = False)
|
258 |
|
259 |
############################################# Ends here ####################################################
|
260 |
|
261 |
+
#return df_final
|
262 |
+
return fp
|
263 |
|
264 |
|
265 |
igen_pubmed = gr.Interface(keyphrase_generator,
|
|
|
307 |
type="value",
|
308 |
default='pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
|
309 |
label="Select any SBERT model for abstracts from the list below")],
|
310 |
+
#outputs=gr.outputs.Dataframe(type="auto", label="Retrieved Results from PubMed",max_cols=2, overflow_row_behaviour="paginate"),
|
311 |
+
outputs=gr.outputs.File(label="Output File"),
|
312 |
theme="peach", layout="horizontal",
|
313 |
title="PubMed Abstract Retriever", description="Retrieves relevant PubMed abstracts for an online article which can be used as further references. 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. ",
|
314 |
examples=[
|