text-keywords / app.py
vinni1484's picture
Update app.py
e86c696
raw
history blame
327 Bytes
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,top_n=10)
keywords = dict(keywords)
return keywords
gr.Interface(keywords, "text", "text",title="Keyword Extractor").launch()