Spaces:
Sleeping
Sleeping
import gradio as gr | |
from keybert import KeyBERT | |
def analyse(name): | |
kw_model = KeyBERT() | |
analisis = kw_model.extract_keywords(name, keyphrase_ngram_range=(1, 1), stop_words=None,use_mmr=True,diversity=0.5) | |
return {analisis[i][0]: float(analisis[i][1]) for i in range(len(analisis))} | |
iface = gr.Interface(fn=analyse, inputs="text", outputs=gr.outputs.Label()) | |
iface.launch(share=False) | |