Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
from keybert import KeyBERT
|
3 |
|
4 |
-
|
5 |
-
model = KeyBERT("sentence-transformers/xlm-r-distilroberta-base-paraphrase-v1")
|
6 |
-
return model
|
7 |
-
|
8 |
-
model = load_model()
|
9 |
|
10 |
def keywords(text):
|
11 |
keywords = model.extract_keywords(text,top_n=10)
|
|
|
12 |
return keywords
|
13 |
|
14 |
gr.Interface(keywords, "text", "text",title="Keyword Extractor").launch()
|
|
|
1 |
import gradio as gr
|
2 |
from keybert import KeyBERT
|
3 |
|
4 |
+
model = KeyBERT("sentence-transformers/xlm-r-distilroberta-base-paraphrase-v1")
|
|
|
|
|
|
|
|
|
5 |
|
6 |
def keywords(text):
|
7 |
keywords = model.extract_keywords(text,top_n=10)
|
8 |
+
keywords = dict(keywords)
|
9 |
return keywords
|
10 |
|
11 |
gr.Interface(keywords, "text", "text",title="Keyword Extractor").launch()
|