File size: 358 Bytes
ef0970f
086e787
 
e86c696
9a41298
ef0970f
39c0fbb
e86c696
ef0970f
086e787
39c0fbb
1
2
3
4
5
6
7
8
9
10
11
import gradio as gr
from keybert import KeyBERT

model = KeyBERT("sentence-transformers/xlm-r-distilroberta-base-paraphrase-v1")

def keywords(text):
    keywords = model.extract_keywords(text, keyphrase_ngram_range=(1,2), top_n=10)
    keywords = dict(keywords)
    return keywords

gr.Interface(keywords, "text", "text", title="Keyword Extractor").launch()