pritamdeka
commited on
Commit
β’
7e99bfa
1
Parent(s):
0cc3243
Update app.py
Browse files
app.py
CHANGED
@@ -113,13 +113,52 @@ def keyphrase_generator(article_link, model_1, model_2, max_num_keywords):
|
|
113 |
return keywords
|
114 |
|
115 |
igen=gr.Interface(keyphrase_generator,
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
outputs="text", theme="huggingface",
|
118 |
title="Health Article Keyphrase Generator",
|
119 |
description="Generates the keyphrases from an online health article which best describes the article.",
|
120 |
-
article= "The work is based on a part of the paper <a href=https://dl.acm.org/doi/10.1145/3487664.3487701>
|
121 |
-
"\t It uses the TextRank algorithm with SBERT to first find the top sentences and then extracts the keyphrases from those sentences using scispaCy
|
|
|
122 |
"\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>."
|
123 |
"\t The default model names are provided which can be changed from the list of pretrained models. "
|
124 |
"\t The value of output keyphrases can be changed. The default value is 10, minimum is 5 and a maximum value of 30.")
|
|
|
125 |
igen.launch(share=True)
|
|
|
113 |
return keywords
|
114 |
|
115 |
igen=gr.Interface(keyphrase_generator,
|
116 |
+
inputs=[gr.inputs.Textbox(lines=1, placeholder="Provide an online health article web link here",default="", label="Article web link"),
|
117 |
+
gr.inputs.Dropdown(choices=['sentence-transformers/all-mpnet-base-v2',
|
118 |
+
'sentence-transformers/all-mpnet-base-v1',
|
119 |
+
'sentence-transformers/paraphrase-mpnet-base-v2',
|
120 |
+
'sentence-transformers/all-distilroberta-v1',
|
121 |
+
'sentence-transformers/paraphrase-distilroberta-base-v1',
|
122 |
+
'sentence-transformers/paraphrase-xlm-r-multilingual-v1',
|
123 |
+
'sentence-transformers/paraphrase-multilingual-mpnet-base-v2',
|
124 |
+
'sentence-transformers/paraphrase-albert-small-v2',
|
125 |
+
'sentence-transformers/paraphrase-albert-base-v2',
|
126 |
+
'pritamdeka/S-Bluebert-snli-multinli-stsb',
|
127 |
+
'pritamdeka/S-Biomed-Roberta-snli-multinli-stsb',
|
128 |
+
'sentence-transformers/stsb-mpnet-base-v2',
|
129 |
+
'sentence-transformers/stsb-roberta-base-v2',
|
130 |
+
'sentence-transformers/stsb-distilroberta-base-v2',
|
131 |
+
'sentence-transformers/nli-roberta-base-v2',
|
132 |
+
'sentence-transformers/nli-mpnet-base-v2',
|
133 |
+
'sentence-transformers/nli-distilroberta-base-v2'],
|
134 |
+
type="value",
|
135 |
+
default='sentence-transformers/all-mpnet-base-v2',
|
136 |
+
label="Select any model for TextRank from the list below"),
|
137 |
+
gr.inputs.Dropdown(choices=['sentence-transformers/paraphrase-mpnet-base-v2',
|
138 |
+
'sentence-transformers/paraphrase-distilroberta-base-v1',
|
139 |
+
'sentence-transformers/paraphrase-xlm-r-multilingual-v1',
|
140 |
+
'sentence-transformers/paraphrase-multilingual-mpnet-base-v2',
|
141 |
+
'sentence-transformers/paraphrase-albert-small-v2',
|
142 |
+
'sentence-transformers/paraphrase-albert-base-v2',
|
143 |
+
'sentence-transformers/paraphrase-MiniLM-L12-v2',
|
144 |
+
'sentence-transformers/paraphrase-MiniLM-L6-v2',
|
145 |
+
'sentence-transformers/all-MiniLM-L12-v2',
|
146 |
+
'sentence-transformers/all-distilroberta-v1',
|
147 |
+
'sentence-transformers/paraphrase-TinyBERT-L6-v2',
|
148 |
+
'sentence-transformers/paraphrase-MiniLM-L3-v2',
|
149 |
+
'sentence-transformers/all-MiniLM-L6-v2'],
|
150 |
+
type="value",
|
151 |
+
default='sentence-transformers/all-distilroberta-v1',
|
152 |
+
label="Select any model for keyphrases from the list below"),
|
153 |
+
gr.inputs.Slider(minimum=5, maximum=30, step=1, default=10, label="Max Keywords")],
|
154 |
outputs="text", theme="huggingface",
|
155 |
title="Health Article Keyphrase Generator",
|
156 |
description="Generates the keyphrases from an online health article which best describes the article.",
|
157 |
+
article= "The work is based on a part of the paper provided <a href=https://dl.acm.org/doi/10.1145/3487664.3487701>here</a>."
|
158 |
+
"\t It uses the TextRank algorithm with SBERT to first find the top sentences and then extracts the keyphrases from those sentences using scispaCy"
|
159 |
+
"\t and SBERT."
|
160 |
"\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>."
|
161 |
"\t The default model names are provided which can be changed from the list of pretrained models. "
|
162 |
"\t The value of output keyphrases can be changed. The default value is 10, minimum is 5 and a maximum value of 30.")
|
163 |
+
|
164 |
igen.launch(share=True)
|