pritamdeka commited on
Commit
ea35432
β€’
1 Parent(s): 6bbed02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -81,11 +81,14 @@ def keyphrase_generator(article, model_1, model_2, max_num_keywords):
81
  return keywords
82
 
83
 
84
- gr.Interface(keyphrase_generator,
85
- inputs=[gr.inputs.Textbox(lines=10, placeholder="Copy article text here",default="", label="article text"),gr.inputs.Textbox(lines=1, placeholder="SBERT model",default="all-mpnet-base-v2", label="Model for TextRank (e.g. all-mpnet-base-v2)"),gr.inputs.Textbox(lines=1, placeholder="SBERT model",default="all-distilroberta-v1",label="Model for keyphrases (e.g. all-distilroberta-v1)"),gr.inputs.Slider(minimum=5, maximum=30, step=1, default=10, label="Max Keywords")],
86
- outputs="text", theme=None, title="Scientifc Article Keyphrase Generator", article="Generates the keyphrases from an article which best describes the article."
87
- "\t The work is part of the paper ""."
88
- "\t It uses the TextRank algorithm to first find the top sentences and then extracts the keyphrases from those sentences."
89
- "\t The list of SBERT models required in the textboxes can be found in https://www.sbert.net/docs/pretrained_models.html."
 
 
90
  "\t The default model names are provided which can be changed from the list of pretrained models. "
91
- "\t The value of output keyphrases can be changed. The default value is 10, minimum is 5 and a maximum value of 30.").launch(share=True)
 
 
81
  return keywords
82
 
83
 
84
+ igen=gr.Interface(keyphrase_generator,
85
+ inputs=[gr.inputs.Textbox(lines=10, placeholder="Provide article text here",default="", label="article text"),gr.inputs.Textbox(lines=1, placeholder="SBERT model",default="all-mpnet-base-v2", label="Model for TextRank (e.g. all-mpnet-base-v2)"),gr.inputs.Textbox(lines=1, placeholder="SBERT model",default="all-distilroberta-v1",label="Model for keyphrases (e.g. all-distilroberta-v1)"),gr.inputs.Slider(minimum=5, maximum=30, step=1, default=10, label="Max Keywords")],
86
+ outputs="text", theme=None,
87
+ title="Scientific Article Keyphrase Generator",
88
+ description="Generates the keyphrases from an article which best describes the article.",
89
+ article= "The work is based on a part of the paper <a href=https://dl.acm.org/doi/10.1145/3487664.3487701>Unsupervised Keyword Combination Query Generation from Online Health Related Content for Evidence-Based Fact Checking</a>."
90
+ "\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."
91
+ "\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>."
92
  "\t The default model names are provided which can be changed from the list of pretrained models. "
93
+ "\t The value of output keyphrases can be changed. The default value is 10, minimum is 5 and a maximum value of 30.")
94
+ igen.launch(share=True)