A simple API for some of the fasttext functions
-
install miniconda
-
create env
conda env create -f environment.yml
and activate env
- download model
python3 -c "import fasttext.util; fasttext.util.download_model('en', if_exists='ignore') # English 300 dim cc vecs"
- run uvicorn with the COMPRESS_FASTTEXT flag
COMPRESS_FASTTEXT=false uvicorn src.main:app --workers 1 --host 0.0.0.0 --port 8080
- open another shell and run:
curl "http:/0.0.0.0:8080/get_word_neighbors/" -H "Content-Type: application/json" --data '{"word":"hey","neighbors":500,"dropstrange":true}'