fasttext / app.py
ArtMirror2000's picture
Update app.py
6041521
raw
history blame
388 Bytes
import gradio as gr
import fasttext
import fasttext.util
ft = fasttext.load_model('cc.en.100.bin')
def getVectors(fname):
data = {}
data[tokens[0]] = ft.get_nearest_neighbors(fname)
return data
interface = gr.Interface(fn = getVectors,
inputs = "text",
outputs = ['text'],
title = 'get vectors',
description = 'get vectors for search')
interface.launch(inline = False)