fasttext / app.py
ArtMirror2000's picture
Update app.py
7052a46
raw
history blame
500 Bytes
import gradio as gr
import fasttext
import fasttext.util
fasttext.util.download_model('arz', if_exists='ignore') # E Arabic
#ft = fasttext.load_model('cc.fa.300.bin')
ft = fasttext.load_model('cc.arz.300.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)