pritamdeka
commited on
Commit
β’
ea35432
1
Parent(s):
6bbed02
Update app.py
Browse files
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="
|
86 |
-
outputs="text", theme=None,
|
87 |
-
"
|
88 |
-
"
|
89 |
-
"
|
|
|
|
|
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.")
|
|
|
|
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)
|