facebookresearch / fastText

Library for fast text representation and classification.
https://fasttext.cc/
MIT License
25.95k stars 4.72k forks source link

Works on Windows #431

Open johnrieth-zz opened 6 years ago

johnrieth-zz commented 6 years ago

I have gotten fastText to work on Windows and used Visual Studio 2017 tools to build fastText. The image below shows my Visual Studio 2017 setup. I am not sure if the Clang/C2 (experimental) tool is necessary for building fastText. I am assuming it is because the instructions say clang is one of the compilers necessary. I tested building fastText using the x64_x86 and x86_x64 Cross Tools Command Prompt for VS 2017.

fasttext
usage: fasttext <command> <args>

The commands supported by fasttext are:

  supervised              train a supervised classifier
  quantize                quantize a model to reduce the memory usage
  test                    evaluate a supervised classifier
  predict                 predict most likely labels
  predict-prob            predict most likely labels with probabilities
  skipgram                train a skipgram model
  cbow                    train a cbow model
  print-word-vectors      print word vectors given a trained model
  print-sentence-vectors  print sentence vectors given a trained model
  print-ngrams            print ngrams given a trained model and word
  nn                      query for nearest neighbors
  analogies               query for analogies
  dump                    dump arguments,dictionary,input/output vectors

I have completed the Text classification tutorial. I had to change the code for two steps.

  1. I download 7zip to unpack .tar.gz
    curl -o cooking.stackexchange.tar.gz  https://s3-us-west-1.amazonaws.com/fasttext-vectors/cooking.stackexchange.tar.gz && tar xvzf cooking.stackexchange.tar.gz
  2. Windows does not come with the ability to run tail. I ran the code below and it worked for me. The command more +12404 prints out text after line 12404.
    more +12404 cooking.stackexchange.txt > cooking.valid

visual studio 2017

BaderMudarra commented 6 years ago

@johnrieth can you please share the modified source code or at least the compiled binary

Axaprj commented 6 years ago

I built FastText in VS 2017 CMake with minor fixes and looks like it works well! You can try it using my fork https://github.com/Axaprj/fastText