In this repository is an addition to Facebook's FastText allowing pre-loading of a trained model and interacting with it via REST APIs.
Run "make" or "make fasttext-static". Will create a "build" directory for the intermediate files. Alternatively you can try the pre-compiled "fasttext-static" binary from this repository.
Keeps all the FastText command line options and adds an additional parameter "server".
./fasttext server <model_file.bin>
The server will always listen on localhost. We don't recommend exposing this implementation directly in the Internet. Instead implement a front-end in a web language, like PHP, which sanitizes user requests before forwarding them to the server. The "test" folder contains some PHP scripts.
Returns the word embeddings associated with at most 10 words.
Returns the n most similar words to a give word using word embeddings.
Given 3 words will compute the analogy: w1-w2+w3
Given a text will predict num labels considering a minimal threshold. The text will be sent via POST data.
The "src" folder currently holds the unchanged "src" folder from the FastText github repository ( https://github.com/facebookresearch/fastText ). As long as the C++ interface remains unchanged it should be possible to replace the "src" folder from our repo with the latest "src" folder from the official FastText repo.