pritamdeka commited on
Commit
7437669
Β·
1 Parent(s): 953cffa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -285,7 +285,7 @@ igen_pubmed = gr.Interface(keyphrase_generator,
285
  'sentence-transformers/sentence-t5-large',
286
  'sentence-transformers/sentence-t5-base'],
287
  type="value",
288
- default='pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
289
  label="Select any SBERT model for TextRank from the list below"),
290
  gr.inputs.Dropdown(choices=['sentence-transformers/paraphrase-mpnet-base-v2',
291
  'sentence-transformers/all-mpnet-base-v1',
@@ -302,23 +302,23 @@ igen_pubmed = gr.Interface(keyphrase_generator,
302
  'sentence-transformers/paraphrase-MiniLM-L3-v2',
303
  'sentence-transformers/all-MiniLM-L6-v2'],
304
  type="value",
305
- default='sentence-transformers/all-mpnet-base-v1',
306
  label="Select any SBERT model for keyphrases from the list below"),
307
- gr.inputs.Slider(minimum=5, maximum=30, step=1, default=10, label="Max Keywords"),
308
  gr.inputs.Dropdown(choices=['cambridgeltl/SapBERT-from-PubMedBERT-fulltext',
309
  'cambridgeltl/SapBERT-from-PubMedBERT-fulltext-mean-token'],
310
  type="value",
311
- default='cambridgeltl/SapBERT-from-PubMedBERT-fulltext',
312
  label="Select any SapBERT model for clustering from the list below"),
313
  gr.inputs.Slider(minimum=5, maximum=15, step=1, default=10, label="PubMed Max Abstracts"),
314
  gr.inputs.Dropdown(choices=['pritamdeka/S-Bluebert-snli-multinli-stsb',
315
  'pritamdeka/S-Biomed-Roberta-snli-multinli-stsb'],
316
  type="value",
317
- default='pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
318
  label="Select any SBERT model for abstracts from the list below")],
319
  outputs=gr.outputs.Dataframe(type="auto", label="Retrieved Results from PubMed",max_cols=None, overflow_row_behaviour="paginate"),
320
  theme="dark-peach",
321
- 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.",
322
  examples=[
323
  ["https://www.medicalnewstoday.com/articles/alzheimers-addressing-sleep-disturbance-may-alleviate-symptoms",
324
  'pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
@@ -355,7 +355,8 @@ igen_pubmed = gr.Interface(keyphrase_generator,
355
  "\t It uses the TextRank algorithm with SBERT to first find the top sentences and then extracts the keyphrases from those sentences using scispaCy and SBERT."
356
  "\t The application then uses a UMLS based BERT model, <a href=https://arxiv.org/abs/2010.11784>SapBERT</a> to cluster the keyphrases using K-means clustering method and finally create a boolean query. After that the top 10 titles and abstracts are retrieved from PubMed database and displayed according to relevancy. The SapBERT models can be changed as per the list provided. "
357
  "\t The list of SBERT models required in the textboxes can be found in <a href=www.sbert.net/docs/pretrained_models.html>SBERT Pre-trained models hub</a>."
358
- "\t The default model names are provided which can be changed from the list of pretrained models. "
359
- "\t The value of keyphrases can be changed. The default value is 10, minimum is 5 and a maximum value of 30.")
 
360
 
361
  igen_pubmed.launch(share=True,server_name='0.0.0.0',show_error=True)
 
285
  'sentence-transformers/sentence-t5-large',
286
  'sentence-transformers/sentence-t5-base'],
287
  type="value",
288
+ #default='pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
289
  label="Select any SBERT model for TextRank from the list below"),
290
  gr.inputs.Dropdown(choices=['sentence-transformers/paraphrase-mpnet-base-v2',
291
  'sentence-transformers/all-mpnet-base-v1',
 
302
  'sentence-transformers/paraphrase-MiniLM-L3-v2',
303
  'sentence-transformers/all-MiniLM-L6-v2'],
304
  type="value",
305
+ #default='sentence-transformers/all-mpnet-base-v1',
306
  label="Select any SBERT model for keyphrases from the list below"),
307
+ gr.inputs.Slider(minimum=5, maximum=20, step=1, default=10, label="Max Keywords"),
308
  gr.inputs.Dropdown(choices=['cambridgeltl/SapBERT-from-PubMedBERT-fulltext',
309
  'cambridgeltl/SapBERT-from-PubMedBERT-fulltext-mean-token'],
310
  type="value",
311
+ #default='cambridgeltl/SapBERT-from-PubMedBERT-fulltext',
312
  label="Select any SapBERT model for clustering from the list below"),
313
  gr.inputs.Slider(minimum=5, maximum=15, step=1, default=10, label="PubMed Max Abstracts"),
314
  gr.inputs.Dropdown(choices=['pritamdeka/S-Bluebert-snli-multinli-stsb',
315
  'pritamdeka/S-Biomed-Roberta-snli-multinli-stsb'],
316
  type="value",
317
+ #default='pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
318
  label="Select any SBERT model for abstracts from the list below")],
319
  outputs=gr.outputs.Dataframe(type="auto", label="Retrieved Results from PubMed",max_cols=None, overflow_row_behaviour="paginate"),
320
  theme="dark-peach",
321
+ 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. ",
322
  examples=[
323
  ["https://www.medicalnewstoday.com/articles/alzheimers-addressing-sleep-disturbance-may-alleviate-symptoms",
324
  'pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
 
355
  "\t It uses the TextRank algorithm with SBERT to first find the top sentences and then extracts the keyphrases from those sentences using scispaCy and SBERT."
356
  "\t The application then uses a UMLS based BERT model, <a href=https://arxiv.org/abs/2010.11784>SapBERT</a> to cluster the keyphrases using K-means clustering method and finally create a boolean query. After that the top 10 titles and abstracts are retrieved from PubMed database and displayed according to relevancy. The SapBERT models can be changed as per the list provided. "
357
  "\t The list of SBERT models required in the textboxes can be found in <a href=www.sbert.net/docs/pretrained_models.html>SBERT Pre-trained models hub</a>."
358
+ "\t The model names can be changed from the list of pretrained models provided. "
359
+ "\t The value of keyphrases can be changed. The default value is 10, minimum is 5 and a maximum value of 20. "
360
+ "\t The value of maximum abstracts to be retrieved can be changed. The minimum is 5, default is 10 and a maximum of 15.")
361
 
362
  igen_pubmed.launch(share=True,server_name='0.0.0.0',show_error=True)