vinni1484 commited on
Commit
e86c696
·
1 Parent(s): 38c8d43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -1,14 +1,11 @@
1
  import gradio as gr
2
  from keybert import KeyBERT
3
 
4
- def load_model():
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()