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()