Library for fast text representation and classification.

Related tags

fastText
Overview

fastText

fastText is a library for efficient learning of word representations and sentence classification.

CircleCI

Table of contents

Resources

Models

Supplementary data

FAQ

You can find answers to frequently asked questions on our website.

Cheatsheet

We also provide a cheatsheet full of useful one-liners.

Requirements

We are continuously building and testing our library, CLI and Python bindings under various docker images using circleci.

Generally, fastText builds on modern Mac OS and Linux distributions. Since it uses some C++11 features, it requires a compiler with good C++11 support. These include :

  • (g++-4.7.2 or newer) or (clang-3.3 or newer)

Compilation is carried out using a Makefile, so you will need to have a working make. If you want to use cmake you need at least version 2.8.9.

One of the oldest distributions we successfully built and tested the CLI under is Debian jessie.

For the word-similarity evaluation script you will need:

  • Python 2.6 or newer
  • NumPy & SciPy

For the python bindings (see the subdirectory python) you will need:

  • Python version 2.7 or >=3.4
  • NumPy & SciPy
  • pybind11

One of the oldest distributions we successfully built and tested the Python bindings under is Debian jessie.

If these requirements make it impossible for you to use fastText, please open an issue and we will try to accommodate you.

Building fastText

We discuss building the latest stable version of fastText.

Getting the source code

You can find our latest stable release in the usual place.

There is also the master branch that contains all of our most recent work, but comes along with all the usual caveats of an unstable branch. You might want to use this if you are a developer or power-user.

Building fastText using make (preferred)

$ wget https://github.com/facebookresearch/fastText/archive/v0.9.2.zip
$ unzip v0.9.2.zip
$ cd fastText-0.9.2
$ make

This will produce object files for all the classes as well as the main binary fasttext. If you do not plan on using the default system-wide compiler, update the two macros defined at the beginning of the Makefile (CC and INCLUDES).

Building fastText using cmake

For now this is not part of a release, so you will need to clone the master branch.

$ git clone https://github.com/facebookresearch/fastText.git
$ cd fastText
$ mkdir build && cd build && cmake ..
$ make && make install

This will create the fasttext binary and also all relevant libraries (shared, static, PIC).

Building fastText for Python

For now this is not part of a release, so you will need to clone the master branch.

$ git clone https://github.com/facebookresearch/fastText.git
$ cd fastText
$ pip install .

For further information and introduction see python/README.md

Example use cases

This library has two main use cases: word representation learning and text classification. These were described in the two papers 1 and 2.

Word representation learning

In order to learn word vectors, as described in 1, do:

$ ./fasttext skipgram -input data.txt -output model

where data.txt is a training file containing UTF-8 encoded text. By default the word vectors will take into account character n-grams from 3 to 6 characters. At the end of optimization the program will save two files: model.bin and model.vec. model.vec is a text file containing the word vectors, one per line. model.bin is a binary file containing the parameters of the model along with the dictionary and all hyper parameters. The binary file can be used later to compute word vectors or to restart the optimization.

Obtaining word vectors for out-of-vocabulary words

The previously trained model can be used to compute word vectors for out-of-vocabulary words. Provided you have a text file queries.txt containing words for which you want to compute vectors, use the following command:

$ ./fasttext print-word-vectors model.bin < queries.txt

This will output word vectors to the standard output, one vector per line. This can also be used with pipes:

$ cat queries.txt | ./fasttext print-word-vectors model.bin

See the provided scripts for an example. For instance, running:

$ ./word-vector-example.sh

will compile the code, download data, compute word vectors and evaluate them on the rare words similarity dataset RW [Thang et al. 2013].

Text classification

This library can also be used to train supervised text classifiers, for instance for sentiment analysis. In order to train a text classifier using the method described in 2, use:

$ ./fasttext supervised -input train.txt -output model

where train.txt is a text file containing a training sentence per line along with the labels. By default, we assume that labels are words that are prefixed by the string __label__. This will output two files: model.bin and model.vec. Once the model was trained, you can evaluate it by computing the precision and recall at k ([email protected] and [email protected]) on a test set using:

$ ./fasttext test model.bin test.txt k

The argument k is optional, and is equal to 1 by default.

In order to obtain the k most likely labels for a piece of text, use:

$ ./fasttext predict model.bin test.txt k

or use predict-prob to also get the probability for each label

$ ./fasttext predict-prob model.bin test.txt k

where test.txt contains a piece of text to classify per line. Doing so will print to the standard output the k most likely labels for each line. The argument k is optional, and equal to 1 by default. See classification-example.sh for an example use case. In order to reproduce results from the paper 2, run classification-results.sh, this will download all the datasets and reproduce the results from Table 1.

If you want to compute vector representations of sentences or paragraphs, please use:

$ ./fasttext print-sentence-vectors model.bin < text.txt

This assumes that the text.txt file contains the paragraphs that you want to get vectors for. The program will output one vector representation per line in the file.

You can also quantize a supervised model to reduce its memory usage with the following command:

$ ./fasttext quantize -output model

This will create a .ftz file with a smaller memory footprint. All the standard functionality, like test or predict work the same way on the quantized models:

$ ./fasttext test model.ftz test.txt

The quantization procedure follows the steps described in 3. You can run the script quantization-example.sh for an example.

Full documentation

Invoke a command without arguments to list available arguments and their default values:

$ ./fasttext supervised
Empty input or output path.

The following arguments are mandatory:
  -input              training file path
  -output             output file path

The following arguments are optional:
  -verbose            verbosity level [2]

The following arguments for the dictionary are optional:
  -minCount           minimal number of word occurrences [1]
  -minCountLabel      minimal number of label occurrences [0]
  -wordNgrams         max length of word ngram [1]
  -bucket             number of buckets [2000000]
  -minn               min length of char ngram [0]
  -maxn               max length of char ngram [0]
  -t                  sampling threshold [0.0001]
  -label              labels prefix [__label__]

The following arguments for training are optional:
  -lr                 learning rate [0.1]
  -lrUpdateRate       change the rate of updates for the learning rate [100]
  -dim                size of word vectors [100]
  -ws                 size of the context window [5]
  -epoch              number of epochs [5]
  -neg                number of negatives sampled [5]
  -loss               loss function {ns, hs, softmax} [softmax]
  -thread             number of threads [12]
  -pretrainedVectors  pretrained word vectors for supervised learning []
  -saveOutput         whether output params should be saved [0]

The following arguments for quantization are optional:
  -cutoff             number of words and ngrams to retain [0]
  -retrain            finetune embeddings if a cutoff is applied [0]
  -qnorm              quantizing the norm separately [0]
  -qout               quantizing the classifier [0]
  -dsub               size of each sub-vector [2]

Defaults may vary by mode. (Word-representation modes skipgram and cbow use a default -minCount of 5.)

References

Please cite 1 if using this code for learning word representations or 2 if using for text classification.

Enriching Word Vectors with Subword Information

[1] P. Bojanowski*, E. Grave*, A. Joulin, T. Mikolov, Enriching Word Vectors with Subword Information

@article{bojanowski2017enriching,
  title={Enriching Word Vectors with Subword Information},
  author={Bojanowski, Piotr and Grave, Edouard and Joulin, Armand and Mikolov, Tomas},
  journal={Transactions of the Association for Computational Linguistics},
  volume={5},
  year={2017},
  issn={2307-387X},
  pages={135--146}
}

Bag of Tricks for Efficient Text Classification

[2] A. Joulin, E. Grave, P. Bojanowski, T. Mikolov, Bag of Tricks for Efficient Text Classification

@InProceedings{joulin2017bag,
  title={Bag of Tricks for Efficient Text Classification},
  author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Mikolov, Tomas},
  booktitle={Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers},
  month={April},
  year={2017},
  publisher={Association for Computational Linguistics},
  pages={427--431},
}

FastText.zip: Compressing text classification models

[3] A. Joulin, E. Grave, P. Bojanowski, M. Douze, H. Jégou, T. Mikolov, FastText.zip: Compressing text classification models

@article{joulin2016fasttext,
  title={FastText.zip: Compressing text classification models},
  author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Douze, Matthijs and J{\'e}gou, H{\'e}rve and Mikolov, Tomas},
  journal={arXiv preprint arXiv:1612.03651},
  year={2016}
}

(* These authors contributed equally.)

Join the fastText community

See the CONTRIBUTING file for information about how to help out.

License

fastText is MIT-licensed.

Issues
  • fasttext installed but import fails

    fasttext installed but import fails

    Hi have successfully installed fasttext on python3.5. However, when I try to import it I get the following error:

    Using /usr/local/lib/python3.5/dist-packages
    Finished processing dependencies for fasttext==0.8.22
    [email protected]:~/GitHub/fastText$ python3.5
    Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
    [GCC 5.4.0 20160609] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import fasttext
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named 'fasttext'
    >>> 
    

    I have tried installing both with pip install . and python setup.y install with no luck.

    opened by ahmedahmedov 25
  • Assertion failed on ./fasttext predict

    Assertion failed on ./fasttext predict

    predict command failed!

    ./fasttext predict model.bin test.txt

    Assertion failed: (counts.size() == osz_), function setTargetCounts, file src/model.cc, line 188.
    Abort trap: 6
    

    model train command was:

    ./fasttext supervised -input train.txt -output model -wordNgrams 4 -bucket 1000000 -thread 16

    Read 4223M words
    Number of words:  16577869
    Number of labels: 25
    Progress: 100.0%  words/sec/thread: 375706  lr: 0.000000  loss: 0.169518  eta: 0h0m 
    
    opened by spate141 25
  • How can we get the vector of a paragraph?

    How can we get the vector of a paragraph?

    I have ever tried doc2vec (from gensim, based on word2vec), with which I can extract fixed length vector for variant length paragraphs. Can I do the same with fastText?

    Thank you!

    opened by xchangcheng 22
  • Support building and running on Windows

    Support building and running on Windows

    Hi,

    I added support for building on windows using Visual Studio 2015.

    Binary builds can be found here

    windowsrfasttext

    CLA Signed 
    opened by xiamx 22
  • OS X install problem

    OS X install problem

    When I install fasttext using "pip install .", I get some errors like following

    Failed to build fasttext
    Installing collected packages: fasttext
      Running setup.py install for fasttext ... error
        Complete output from command /miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/pip-req-build-i2z3pyel/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/pip-record-yg0h6noh/install-record.txt --single-version-externally-managed --compile:
        running install
        running build
        running build_py
        creating build
        creating build/lib.macosx-10.7-x86_64-3.6
        creating build/lib.macosx-10.7-x86_64-3.6/fastText
        copying python/fastText/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/fastText
        copying python/fastText/FastText.py -> build/lib.macosx-10.7-x86_64-3.6/fastText
        creating build/lib.macosx-10.7-x86_64-3.6/fastText/util
        copying python/fastText/util/util.py -> build/lib.macosx-10.7-x86_64-3.6/fastText/util
        copying python/fastText/util/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/fastText/util
        creating build/lib.macosx-10.7-x86_64-3.6/fastText/tests
        copying python/fastText/tests/test_script.py -> build/lib.macosx-10.7-x86_64-3.6/fastText/tests
        copying python/fastText/tests/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/fastText/tests
        copying python/fastText/tests/test_configurations.py -> build/lib.macosx-10.7-x86_64-3.6/fastText/tests
        running build_ext
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -c /var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/tmp1upvarhx.cpp -o var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/tmp1upvarhx.o -stdlib=libc++
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -c /var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/tmp9dzh7j94.cpp -o var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/tmp9dzh7j94.o -std=c++14
        warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
        1 warning generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -c /var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/tmpw5pz6xr0.cpp -o var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/tmpw5pz6xr0.o -fvisibility=hidden
        warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
        1 warning generated.
        building 'fasttext_pybind' extension
        creating build/temp.macosx-10.7-x86_64-3.6
        creating build/temp.macosx-10.7-x86_64-3.6/python
        creating build/temp.macosx-10.7-x86_64-3.6/python/fastText
        creating build/temp.macosx-10.7-x86_64-3.6/python/fastText/pybind
        creating build/temp.macosx-10.7-x86_64-3.6/src
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c python/fastText/pybind/fasttext_pybind.cc -o build/temp.macosx-10.7-x86_64-3.6/python/fastText/pybind/fasttext_pybind.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        python/fastText/pybind/fasttext_pybind.cc:219:35: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<long long, std::__1::allocator<long long> >::size_type' (aka 'unsigned long') [-Wsign-compare]
                    for (int32_t i = 0; i < vocab_freq.size(); i++) {
                                        ~ ^ ~~~~~~~~~~~~~~~~~
        python/fastText/pybind/fasttext_pybind.cc:233:35: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<long long, std::__1::allocator<long long> >::size_type' (aka 'unsigned long') [-Wsign-compare]
                    for (int32_t i = 0; i < labels_freq.size(); i++) {
                                        ~ ^ ~~~~~~~~~~~~~~~~~~
        2 warnings generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/dictionary.cc -o build/temp.macosx-10.7-x86_64-3.6/src/dictionary.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        src/dictionary.cc:181:52: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
            for (size_t j = i, n = 1; j < word.size() && n <= args_->maxn; n++) {
                                                         ~ ^  ~~~~~~~~~~~
        src/dictionary.cc:186:13: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
              if (n >= args_->minn && !(n == 1 && (i == 0 || j == word.size()))) {
                  ~ ^  ~~~~~~~~~~~
        src/dictionary.cc:198:24: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
          for (size_t i = 0; i < size_; i++) {
                             ~ ^ ~~~~~
        src/dictionary.cc:296:24: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
          for (size_t i = 0; i < size_; i++) {
                             ~ ^ ~~~~~
        src/dictionary.cc:316:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (int32_t i = 0; i < hashes.size(); i++) {
                              ~ ^ ~~~~~~~~~~~~~
        src/dictionary.cc:318:31: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
            for (int32_t j = i + 1; j < hashes.size() && j < i + n; j++) {
                                    ~ ^ ~~~~~~~~~~~~~
        src/dictionary.cc:515:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<fasttext::entry, std::__1::allocator<fasttext::entry> >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (int32_t i = 0; i < words_.size(); i++) {
                              ~ ^ ~~~~~~~~~~~~~
        src/dictionary.cc:517:12: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
                (j < words.size() && words[j] == i)) {
                 ~ ^ ~~~~~~~~~~~~
        8 warnings generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/main.cc -o build/temp.macosx-10.7-x86_64-3.6/src/main.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        src/main.cc:348:3: warning: code will never be executed [-Wunreachable-code]
          exit(0);
          ^~~~
        1 warning generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/fasttext.cc -o build/temp.macosx-10.7-x86_64-3.6/src/fasttext.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        src/fasttext.cc:92:21: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (int i = 0; i < ngrams.size(); i++) {
                          ~ ^ ~~~~~~~~~~~~~
        src/fasttext.cc:302:18: warning: comparison of integers of different signs: 'const int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
            return eosid == i1 || (eosid != i2 && norms[i1] > norms[i2]);
                   ~~~~~ ^  ~~
        src/fasttext.cc:302:34: warning: comparison of integers of different signs: 'const int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
            return eosid == i1 || (eosid != i2 && norms[i1] > norms[i2]);
                                   ~~~~~ ^  ~~
        src/fasttext.cc:323:16: warning: 'selectEmbeddings' is deprecated: selectEmbeddings is being deprecated. [-Wdeprecated-declarations]
            auto idx = selectEmbeddings(qargs.cutoff);
                       ^
        src/fasttext.h:165:3: note: 'selectEmbeddings' has been explicitly marked deprecated here
          FASTTEXT_DEPRECATED("selectEmbeddings is being deprecated.")
          ^
        src/utils.h:18:49: note: expanded from macro 'FASTTEXT_DEPRECATED'
        #define FASTTEXT_DEPRECATED(msg) __attribute__((__deprecated__(msg)))
                                                        ^
        src/fasttext.cc:322:40: warning: comparison of integers of different signs: 'const size_t' (aka 'const unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
          if (qargs.cutoff > 0 && qargs.cutoff < input->size(0)) {
                                  ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
        src/fasttext.cc:327:24: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
            for (auto i = 0; i < idx.size(); i++) {
                             ~ ^ ~~~~~~~~~~
        src/fasttext.cc:380:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (int32_t w = 0; w < line.size(); w++) {
                              ~ ^ ~~~~~~~~~~~
        src/fasttext.cc:384:41: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
              if (c != 0 && w + c >= 0 && w + c < line.size()) {
                                          ~~~~~ ^ ~~~~~~~~~~~
        src/fasttext.cc:398:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (int32_t w = 0; w < line.size(); w++) {
                              ~ ^ ~~~~~~~~~~~
        src/fasttext.cc:402:41: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
              if (c != 0 && w + c >= 0 && w + c < line.size()) {
                                          ~~~~~ ^ ~~~~~~~~~~~
        src/fasttext.cc:479:27: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
            for (int32_t i = 0; i < line.size(); i++) {
                                ~ ^ ~~~~~~~~~~~
        src/fasttext.cc:514:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (int32_t i = 0; i < ngrams.size(); i++) {
                              ~ ^ ~~~~~~~~~~~~~
        src/fasttext.cc:551:5: warning: 'precomputeWordVectors' is deprecated: precomputeWordVectors is being deprecated. [-Wdeprecated-declarations]
            precomputeWordVectors(*wordVectors_);
            ^
        src/fasttext.h:180:3: note: 'precomputeWordVectors' has been explicitly marked deprecated here
          FASTTEXT_DEPRECATED("precomputeWordVectors is being deprecated.")
          ^
        src/utils.h:18:49: note: expanded from macro 'FASTTEXT_DEPRECATED'
        #define FASTTEXT_DEPRECATED(msg) __attribute__((__deprecated__(msg)))
                                                        ^
        src/fasttext.cc:585:23: warning: comparison of integers of different signs: 'std::__1::vector<std::__1::pair<float, std::__1::basic_string<char> >, std::__1::allocator<std::__1::pair<float, std::__1::basic_string<char> > > >::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
              if (heap.size() == k && similarity < heap.front().first) {
                  ~~~~~~~~~~~ ^  ~
        src/fasttext.cc:590:23: warning: comparison of integers of different signs: 'std::__1::vector<std::__1::pair<float, std::__1::basic_string<char> >, std::__1::allocator<std::__1::pair<float, std::__1::basic_string<char> > > >::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
              if (heap.size() > k) {
                  ~~~~~~~~~~~ ^ ~
        src/fasttext.cc:701:24: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
          for (size_t i = 0; i < n; i++) {
                             ~ ^ ~
        src/fasttext.cc:706:26: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
            for (size_t j = 0; j < dim; j++) {
                               ~ ^ ~~~
        src/fasttext.cc:718:24: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
          for (size_t i = 0; i < n; i++) {
                             ~ ^ ~
        src/fasttext.cc:723:26: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
            for (size_t j = 0; j < dim; j++) {
                               ~ ^ ~~~
        19 warnings generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/utils.cc -o build/temp.macosx-10.7-x86_64-3.6/src/utils.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/model.cc -o build/temp.macosx-10.7-x86_64-3.6/src/model.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/loss.cc -o build/temp.macosx-10.7-x86_64-3.6/src/loss.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        src/loss.cc:83:21: warning: comparison of integers of different signs: 'std::__1::vector<std::__1::pair<float, int>, std::__1::allocator<std::__1::pair<float, int> > >::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
            if (heap.size() == k && std_log(output[i]) < heap.front().first) {
                ~~~~~~~~~~~ ^  ~
        src/loss.cc:88:21: warning: comparison of integers of different signs: 'std::__1::vector<std::__1::pair<float, int>, std::__1::allocator<std::__1::pair<float, int> > >::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
            if (heap.size() > k) {
                ~~~~~~~~~~~ ^ ~
        src/loss.cc:257:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::__1::vector<int, std::__1::allocator<int> >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (int32_t i = 0; i < pathToRoot.size(); i++) {
                              ~ ^ ~~~~~~~~~~~~~~~~~
        src/loss.cc:282:19: warning: comparison of integers of different signs: 'std::__1::vector<std::__1::pair<float, int>, std::__1::allocator<std::__1::pair<float, int> > >::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
          if (heap.size() == k && score < heap.front().first) {
              ~~~~~~~~~~~ ^  ~
        src/loss.cc:289:21: warning: comparison of integers of different signs: 'std::__1::vector<std::__1::pair<float, int>, std::__1::allocator<std::__1::pair<float, int> > >::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
            if (heap.size() > k) {
                ~~~~~~~~~~~ ^ ~
        5 warnings generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/productquantizer.cc -o build/temp.macosx-10.7-x86_64-3.6/src/productquantizer.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        src/productquantizer.cc:246:22: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<float, std::__1::allocator<float> >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (auto i = 0; i < centroids_.size(); i++) {
                           ~ ^ ~~~~~~~~~~~~~~~~~
        1 warning generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/args.cc -o build/temp.macosx-10.7-x86_64-3.6/src/args.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        src/args.cc:93:23: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<std::__1::basic_string<char>, std::__1::allocator<std::__1::basic_string<char> > >::size_type' (aka 'unsigned long') [-Wsign-compare]
          for (int ai = 2; ai < args.size(); ai += 2) {
                           ~~ ^ ~~~~~~~~~~~
        1 warning generated.
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/quantmatrix.cc -o build/temp.macosx-10.7-x86_64-3.6/src/quantmatrix.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/matrix.cc -o build/temp.macosx-10.7-x86_64-3.6/src/matrix.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/meter.cc -o build/temp.macosx-10.7-x86_64-3.6/src/meter.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/vector.cc -o build/temp.macosx-10.7-x86_64-3.6/src/vector.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/miniconda3/include -arch x86_64 -I/miniconda3/include -arch x86_64 -I/miniconda3/include/python3.6m -I/Users/ruanxiaoyi/.local/include/python3.6m -Isrc -I/miniconda3/include/python3.6m -c src/densematrix.cc -o build/temp.macosx-10.7-x86_64-3.6/src/densematrix.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden
        g++ -bundle -undefined dynamic_lookup -L/miniconda3/lib -arch x86_64 -L/miniconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/python/fastText/pybind/fasttext_pybind.o build/temp.macosx-10.7-x86_64-3.6/src/dictionary.o build/temp.macosx-10.7-x86_64-3.6/src/main.o build/temp.macosx-10.7-x86_64-3.6/src/fasttext.o build/temp.macosx-10.7-x86_64-3.6/src/utils.o build/temp.macosx-10.7-x86_64-3.6/src/model.o build/temp.macosx-10.7-x86_64-3.6/src/loss.o build/temp.macosx-10.7-x86_64-3.6/src/productquantizer.o build/temp.macosx-10.7-x86_64-3.6/src/args.o build/temp.macosx-10.7-x86_64-3.6/src/quantmatrix.o build/temp.macosx-10.7-x86_64-3.6/src/matrix.o build/temp.macosx-10.7-x86_64-3.6/src/meter.o build/temp.macosx-10.7-x86_64-3.6/src/vector.o build/temp.macosx-10.7-x86_64-3.6/src/densematrix.o -o build/lib.macosx-10.7-x86_64-3.6/fasttext_pybind.cpython-36m-darwin.so
        clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
        ld: library not found for -lstdc++
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        error: command 'g++' failed with exit status 1
    
        ----------------------------------------
    Command "/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/pip-req-build-i2z3pyel/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/pip-record-yg0h6noh/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/tz/msp_r50s03s59q40s_gmhx600000gn/T/pip-req-build-i2z3pyel/
    

    And my environment is

    Apple LLVM version 10.0.0 (clang-1000.10.44.4)
    Target: x86_64-apple-darwin18.2.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
     "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.14.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 409.12 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -I/usr/local/include -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/ruanxiaoyi/Downloads/fastText-master -ferror-limit 19 -fmessage-length 204 -stack-protector 1 -fblocks -fencode-extended-block-signature -fobjc-runtime=macosx-10.14.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c++ -
    clang -cc1 version 10.0.0 (clang-1000.10.44.4) default target x86_64-apple-darwin18.2.0
    ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1"
    ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/local/include"
    ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/Library/Frameworks"
    #include "..." search starts here:
    #include <...> search starts here:
     /usr/local/include
     /Library/Developer/CommandLineTools/usr/include/c++/v1
     /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include
     /Library/Developer/CommandLineTools/usr/include
     /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
     /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)
    

    Any suggestion for this problem?

    Python Build 
    opened by rxy1212 21
  • Any plan to support different weight for each class in loss function?

    Any plan to support different weight for each class in loss function?

    Looking at the current code, it seems to me that loss function are evaluated with the same weight for each class, which is OK for balanced data. For highly imbalanced data, are there any plan to support different weight for each class in loss function? I am thinking in command line, do:

    fasttext -input XXX -output XXX -weight_class1 10 -weight_class2 1 -weight_class3 3 
    

    or simply

    fasttext -weight_balanced 
    

    if the weight is inversely proportional to number of instances in that class?

    opened by kuangchen 18
  • Interpreting Multilabel output

    Interpreting Multilabel output

    So I loaded multilabel values for my targets. But when I use the predict_prob function; it seems like conditional probablity more than multilabel output.

    I was assuming that all the labels would have a value between 1 and 0, but I am seeing that all the labels add up to 1 instead for each class to have a value between 1 and 0.

    Can someone help me understand this output.

    opened by iymitchell 17
  • Quantize error

    Quantize error

    I already have trained model_1.bin with supervised option, and when I am trying to quantize that model, I am getting following error!

    /opt/fastText/fasttext quantize -input data.txt -output models/model_1 -verbose 3 -wordNgrams 3 -bucket 1000000 -minn 3 -maxn 6 -lr 0.010 -dim 100 -loss ns -thread 8 -epoch 10 -qnorm -retrain -cutoff 100000
    
    fasttext: src/vector.cc:71: void fasttext::Vector::addRow(const fasttext::Matrix&, int64_t): Assertion `i < A.m_' failed.
    Aborted (core dumped)
    

    Edit: If I dont use -cutoff then I can run this without any error!

    opened by spate141 16
  • The memory error when loading the pre-trained model

    The memory error when loading the pre-trained model

    There is a memory error when I trying to load the pre-trained model, e.g., model = fasttext.load_model('D:/download/wiki.en/wiki.en.bin').

    Since the size of this bin file is almost 9G, and my memory size is only 4G. I am trying to find a memory friendly method to load the model. Can anyone give me a clue?
    Thanks a lot!

    opened by zhouchichun 16
  • Loss - OVA model - Not predicting sigmoid output in Ubuntu 16.04

    Loss - OVA model - Not predicting sigmoid output in Ubuntu 16.04

    Install Log:

    c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/args.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/matrix.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/dictionary.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/loss.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/productquantizer.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/densematrix.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/quantmatrix.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/vector.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/model.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/utils.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/meter.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/fasttext.cc src/fasttext.cc: In member function ‘void fasttext::FastText::quantize(const fasttext::Args&)’: src/fasttext.cc:323:16: warning: ‘std::vector fasttext::FastText::selectEmbeddings(int32_t) const’ is deprecated: selectEmbeddings is being deprecated. [-Wdeprecated-declarations] auto idx = selectEmbeddings(qargs.cutoff); ^ src/fasttext.cc:293:22: note: declared here std::vector<int32_t> FastText::selectEmbeddings(int32_t cutoff) const { ^ src/fasttext.cc:323:45: warning: ‘std::vector fasttext::FastText::selectEmbeddings(int32_t) const’ is deprecated: selectEmbeddings is being deprecated. [-Wdeprecated-declarations] auto idx = selectEmbeddings(qargs.cutoff); ^ src/fasttext.cc:293:22: note: declared here std::vector<int32_t> FastText::selectEmbeddings(int32_t cutoff) const { ^ src/fasttext.cc: In member function ‘void fasttext::FastText::lazyComputeWordVectors()’: src/fasttext.cc:551:5: warning: ‘void fasttext::FastText::precomputeWordVectors(fasttext::DenseMatrix&)’ is deprecated: precomputeWordVectors is being deprecated. [-Wdeprecated-declarations] precomputeWordVectors(*wordVectors_); ^ src/fasttext.cc:534:6: note: declared here void FastText::precomputeWordVectors(DenseMatrix& wordVectors) { ^ src/fasttext.cc:551:40: warning: ‘void fasttext::FastText::precomputeWordVectors(fasttext::DenseMatrix&)’ is deprecated: precomputeWordVectors is being deprecated. [-Wdeprecated-declarations] precomputeWordVectors(*wordVectors_); ^ src/fasttext.cc:534:6: note: declared here void FastText::precomputeWordVectors(DenseMatrix& wordVectors) { ^ c++ -pthread -std=c++0x -march=native -O3 -funroll-loops args.o matrix.o dictionary.o loss.o productquantizer.o densematrix.o quantmatrix.o vector.o model.o utils.o meter.o fasttext.o src/main.cc -o fasttext

    The output is not sigmoid. Its still same as the Softmax. Args: dim 100 ws 5 epoch 1 minCount 1 neg 5 wordNgrams 3 loss one-vs-all model sup bucket 1000000 minn 3 maxn 3 lrUpdateRate 100 t 0.0001

    bug 
    opened by giriannamalai 15
  • সাফকথা

    সাফকথা

    opened by safkotha 0
  • How to improve validation/test accuracy of fasttext modal?

    How to improve validation/test accuracy of fasttext modal?

    Hello, First of all, thank you for such an amazing library. I am using this library to predict the sentiments of the sentence by categorizing training data into five different labels. My training data contains 30K rows for each label. I tried using different hyperparameters and different preprocessing steps but still no luck :( My Training accuracy is around 99% but Testing is only 60%. Is there any way I can improve that?

    Note: I tried different overfitting steps as well (changing of the epoch, learning rate, word-n-grams etc.) but no change

    If anyone had the same issue and know how to make modal better. Please advise on this. How should I improve accuracy? Any leads on this are appreciated :)

    Thanks in advance.

    opened by John0801-online 0
  • How to download the pretrained models to search for word similarity

    How to download the pretrained models to search for word similarity

    Hi could you tell me please how I can load pretraind models? thanks for any info on this. I tried to run download_model.py and getting

    Downloading https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.en.300.bin.gz
    Traceback (most recent call last):
      File "download_model.py", line 48, in <module>
        main()
      File "download_model.py", line 43, in main
        command_download(args.language, if_exists=(
      File "download_model.py", line 28, in command_download
        fasttext.util.download_model(lang_id, if_exists)
      File "/users/dara/conda/envs/success/lib/python3.8/site-packages/fasttext/util/util.py", line 204, in download_model
        if _download_gz_model(gz_file_name, if_exists):
      File "/users/dara/conda/envs/success/lib/python3.8/site-packages/fasttext/util/util.py", line 178, in _download_gz_model
        _download_file(url, gz_file_name)
      File "/users/dara/conda/envs/success/lib/python3.8/site-packages/fasttext/util/util.py", line 148, in _download_file
        response = urlopen(url)
      File "/users/dara/conda/envs/success/lib/python3.8/urllib/request.py", line 222, in urlopen
        return opener.open(url, data, timeout)
      File "/users/dara/conda/envs/success/lib/python3.8/urllib/request.py", line 531, in open
        response = meth(req, response)
      File "/users/dara/conda/envs/success/lib/python3.8/urllib/request.py", line 640, in http_response
        response = self.parent.error(
      File "/users/dara/conda/envs/success/lib/python3.8/urllib/request.py", line 569, in error
        return self._call_chain(*args)
      File "/users/dara/conda/envs/success/lib/python3.8/urllib/request.py", line 502, in _call_chain
        result = func(*args)
      File "/users/dara/conda/envs/success/lib/python3.8/urllib/request.py", line 649, in http_error_default
        raise HTTPError(req.full_url, code, msg, hdrs, fp)
    urllib.error.HTTPError: HTTP Error 429: Too Many Requests
    
    opened by dorost1234 0
  • Fix build wasm in latest emsdk

    Fix build wasm in latest emsdk

    Overview

    Fix: https://github.com/facebookresearch/fastText/issues/1166

    Execution

    In local OSX.

    $ docker pull emscripten/emsdk
    $ docker run -it emscripten/emsdk bash
    

    In Container.

    $ em++ --version
    emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.30 (f782b50a7f8dded7cd0e2c7ee4fed41ab743f5c0)
    Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
    This is free and open source software under the MIT license.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    # --- checkout this PR ---
    $ git clone https://github.com/vaaaaanquish/fastText.git
    $ git checkout patch-build-wasm
    $ make wasm
    ...
    $ ls webassembly/
    README.md  doc  fasttext.js  fasttext_wasm.cc  fasttext_wasm.js  fasttext_wasm.wasm
    
    CLA Signed 
    opened by vaaaaanquish 5
  • Building wheel for fasttext (setup.py) ... error

    Building wheel for fasttext (setup.py) ... error

    ERROR: Command errored out with exit status 1: command: /home/mparmar3/mihir_pytorch/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-b8_ffdmu/setup.py'"'"'; file='"'"'/tmp/pip-req-build-b8_ffdmu/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-0lmkccc_ cwd: /tmp/pip-req-build-b8_ffdmu/ Complete output (38 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/fasttext copying python/fasttext_module/fasttext/FastText.py -> build/lib.linux-x86_64-3.6/fasttext copying python/fasttext_module/fasttext/init.py -> build/lib.linux-x86_64-3.6/fasttext creating build/lib.linux-x86_64-3.6/fasttext/util copying python/fasttext_module/fasttext/util/util.py -> build/lib.linux-x86_64-3.6/fasttext/util copying python/fasttext_module/fasttext/util/init.py -> build/lib.linux-x86_64-3.6/fasttext/util creating build/lib.linux-x86_64-3.6/fasttext/tests copying python/fasttext_module/fasttext/tests/test_configurations.py -> build/lib.linux-x86_64-3.6/fasttext/tests copying python/fasttext_module/fasttext/tests/init.py -> build/lib.linux-x86_64-3.6/fasttext/tests copying python/fasttext_module/fasttext/tests/test_script.py -> build/lib.linux-x86_64-3.6/fasttext/tests running build_ext creating tmp gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/mparmar3/mihir_pytorch/include -I/usr/include/python3.6m -c /tmp/tmpdyzyk_x8.cpp -o tmp/tmpdyzyk_x8.o -std=c++11 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/mparmar3/mihir_pytorch/include -I/usr/include/python3.6m -c /tmp/tmp0oax4mxq.cpp -o tmp/tmp0oax4mxq.o -fvisibility=hidden building 'fasttext_pybind' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/python creating build/temp.linux-x86_64-3.6/python/fasttext_module creating build/temp.linux-x86_64-3.6/python/fasttext_module/fasttext creating build/temp.linux-x86_64-3.6/python/fasttext_module/fasttext/pybind creating build/temp.linux-x86_64-3.6/src gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include -I/home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include -Isrc -I/home/mparmar3/mihir_pytorch/include -I/usr/include/python3.6m -c python/fasttext_module/fasttext/pybind/fasttext_pybind.cc -o build/temp.linux-x86_64-3.6/python/fasttext_module/fasttext/pybind/fasttext_pybind.o -DVERSION_INFO="0.9.2" -std=c++11 -fvisibility=hidden In file included from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/pytypes.h:12:0, from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/cast.h:13, from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/attr.h:13, from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/pybind11.h:45, from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/numpy.h:12, from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13: /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/detail/common.h:122:20: fatal error: Python.h: No such file or directory #include <Python.h> ^ compilation terminated. error: command 'gcc' failed with exit status 1

    ERROR: Failed building wheel for fasttext Running setup.py clean for fasttext Failed to build fasttext Installing collected packages: fasttext Running setup.py install for fasttext ... error ERROR: Command errored out with exit status 1: command: /home/mparmar3/mihir_pytorch/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-b8_ffdmu/setup.py'"'"'; file='"'"'/tmp/pip-req-build-b8_ffdmu/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-qjjs3m1g/install-record.txt --single-version-externally-managed --compile --install-headers /home/mparmar3/mihir_pytorch/include/site/python3.6/fasttext cwd: /tmp/pip-req-build-b8_ffdmu/ Complete output (37 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/fasttext copying python/fasttext_module/fasttext/FastText.py -> build/lib.linux-x86_64-3.6/fasttext copying python/fasttext_module/fasttext/init.py -> build/lib.linux-x86_64-3.6/fasttext creating build/lib.linux-x86_64-3.6/fasttext/util copying python/fasttext_module/fasttext/util/util.py -> build/lib.linux-x86_64-3.6/fasttext/util copying python/fasttext_module/fasttext/util/init.py -> build/lib.linux-x86_64-3.6/fasttext/util creating build/lib.linux-x86_64-3.6/fasttext/tests copying python/fasttext_module/fasttext/tests/test_configurations.py -> build/lib.linux-x86_64-3.6/fasttext/tests copying python/fasttext_module/fasttext/tests/init.py -> build/lib.linux-x86_64-3.6/fasttext/tests copying python/fasttext_module/fasttext/tests/test_script.py -> build/lib.linux-x86_64-3.6/fasttext/tests running build_ext gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/mparmar3/mihir_pytorch/include -I/usr/include/python3.6m -c /tmp/tmpj0m00mjj.cpp -o tmp/tmpj0m00mjj.o -std=c++11 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/mparmar3/mihir_pytorch/include -I/usr/include/python3.6m -c /tmp/tmp2pb0kyf4.cpp -o tmp/tmp2pb0kyf4.o -fvisibility=hidden building 'fasttext_pybind' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/python creating build/temp.linux-x86_64-3.6/python/fasttext_module creating build/temp.linux-x86_64-3.6/python/fasttext_module/fasttext creating build/temp.linux-x86_64-3.6/python/fasttext_module/fasttext/pybind creating build/temp.linux-x86_64-3.6/src gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include -I/home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include -Isrc -I/home/mparmar3/mihir_pytorch/include -I/usr/include/python3.6m -c python/fasttext_module/fasttext/pybind/fasttext_pybind.cc -o build/temp.linux-x86_64-3.6/python/fasttext_module/fasttext/pybind/fasttext_pybind.o -DVERSION_INFO="0.9.2" -std=c++11 -fvisibility=hidden In file included from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/pytypes.h:12:0, from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/cast.h:13, from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/attr.h:13, from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/pybind11.h:45, from /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/numpy.h:12, from python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:13: /home/mparmar3/mihir_pytorch/lib64/python3.6/site-packages/pybind11/include/pybind11/detail/common.h:122:20: fatal error: Python.h: No such file or directory #include <Python.h> ^ compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /home/mparmar3/mihir_pytorch/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-b8_ffdmu/setup.py'"'"'; file='"'"'/tmp/pip-req-build-b8_ffdmu/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-qjjs3m1g/install-record.txt --single-version-externally-managed --compile --install-headers /home/mparmar3/mihir_pytorch/include/site/python3.6/fasttext Check the logs for full command output.

    I used the command pip install fasttext. It is showing this error and I am not able to solve it.

    Can anyone help me to solve this?

    opened by Mihir3009 0
  • No module named 'fasttext_pybind'

    No module named 'fasttext_pybind'

    Hello,

    I have installed g++ on windows an the follwoing are available:

    C:\Users\hkg02\Downloads\fastText>gcc --version
    gcc (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0
    Copyright (C) 2018 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    g++ (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0
    Copyright (C) 2018 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    

    I have installed fasttext according to the docs specification for python module as follows:

    $ git clone https://github.com/facebookresearch/fastText.git
    $ cd fastText
    $ pip install .
    

    and the output was successful:

    Processing c:\users\hkg02\downloads\fasttext
      DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
       pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
    Requirement already satisfied: pybind11>=2.2 in c:\program files\python37\lib\site-packages (from fasttext==0.9.2) (2.5.0)
    Requirement already satisfied: setuptools>=0.7.0 in c:\program files\python37\lib\site-packages (from fasttext==0.9.2) (46.1.3)
    Requirement already satisfied: numpy in c:\program files\python37\lib\site-packages (from fasttext==0.9.2) (1.17.2)
    Building wheels for collected packages: fasttext
      Building wheel for fasttext (setup.py) ... done
      Created wheel for fasttext: filename=fasttext-0.9.2-cp37-cp37m-win_amd64.whl size=229726 sha256=27ae0b16aa8f99cb29d220deaced8c5631145958bcd214b1b3ca58f6b588c2eb
      Stored in directory: C:\Users\hkg02\AppData\Local\Temp\pip-ephem-wheel-cache-uceaqr_v\wheels\4d\f0\a9\b866288d57ab8b0ffcea5a368224986425dc1ccf0624f3130d
    Successfully built fasttext
    Installing collected packages: fasttext
    Successfully installed fasttext-0.9.2
    

    However, when I import it it gives me the following error:

    import fasttext
    model = fasttext.load_model('G:/fasttext_embeddings/ngrams4-size100-window3-mincount10-negative5-lr0.001/2009.bin')
    

    Error:

    Traceback (most recent call last):
      File "C:/Users/hkg02/Desktop/political_discourse_mining_hiyam/semantic_shifts/test.py", line 1, in <module>
        import fasttext
      File "C:\Users\hkg02\AppData\Local\Programs\Python\Python37\lib\site-packages\fasttext\__init__.py", line 12, in <module>
        from .FastText import train_supervised
      File "C:\Users\hkg02\AppData\Local\Programs\Python\Python37\lib\site-packages\fasttext\FastText.py", line 12, in <module>
        import fasttext_pybind as fasttext
    ModuleNotFoundError: No module named 'fasttext_pybind'
    
    
    opened by hiyamgh 1
  • why model.test result p and r always be the same

    why model.test result p and r always be the same

    opened by BeHappyForMe 0
  • Specify build requirements in pyproject.toml's build-system (PEP517)

    Specify build requirements in pyproject.toml's build-system (PEP517)

    Instead of asking users to pre-install NumPy & SciPy and pybind11 before pip installing fastText, maybe you could specify these build requirements in a pyproject.toml file, following the PEP517 spec?

    [build-system]
    requires = ["setuptools", "wheel", "numpy", "scipy", "pybind11"]
    build-backend = "setuptools.build_meta"
    

    This would also allow you to get rid of these brittle/hackish setup instructions:

    class get_pybind_include(object):
        def __init__(self, user=False):
            try:
                import pybind11
            except ImportError:
                if subprocess.call([sys.executable, '-m', 'pip', 'install', 'pybind11']):
                    raise RuntimeError('pybind11 install failed.')
    

    https://setuptools.readthedocs.io/en/latest/build_meta.html#build-system-support

    opened by pawamoy 0
  • Does fasttext use parts of the sentence to complete the text classification???

    Does fasttext use parts of the sentence to complete the text classification???

    image I found that when I used fasttext for text classification,I can set the ws(context window size),does it mean that for example the sentence "This is a good movie" the label “1” ,will be split into "This is a" the label "1", "Is a good" the label "1", "a good movie" the label 1? Or when I use fasttext's supervised training mode,the parameter "ws" will be ignore?

    opened by wangbingnan136 0
  • Can the model be loaded on Win64 using c++ code?

    Can the model be loaded on Win64 using c++ code?

    I tried to load the model on win64 using c++ code, however, the output shows the "Model file has wrong file format".

    opened by zhengshuo1 0
Releases(v0.9.2)
  • v0.9.2(Apr 28, 2020)

    We are happy to announce the release of version 0.9.2.

    WebAssembly

    We are excited to release fastText bindings for WebAssembly. Classification tasks are widely used in web applications and we believe giving access to the complete fastText API from the browser will notably help our community to build nice tools. See our documentation to learn more.

    Autotune: automatic hyperparameter optimization

    Finding the best hyperparameters is crucial for building efficient models. However, searching the best hyperparameters manually is difficult. This release includes the autotune feature that allows you to find automatically the best hyperparameters for your dataset. You can find more information on how to use it here.

    Python

    fastText loves Python. In this release, we have:

    • several bug fixes for prediction functions
    • nearest neighbors and analogies for Python
    • a memory leak fix
    • website tutorials with Python examples

    The autotune feature is fully integrated with our Python API. This allows us to have a more stable autotune optimization loop from Python and to synchronize the best hyper-parameters with the _FastText model object.

    Pre-trained models tool

    We release two helper scripts:

    They can also be used directly from our Python API.

    More metrics

    When you test a trained model, you can now have more detailed results for the precision/recall metrics of a specific label or all labels.

    Paper source code

    This release contains the source code of the unsupervised multilingual alignment paper.

    Community feedback and contributions

    We want to thank our community for giving us feedback on Facebook and on GitHub.

    Source code(tar.gz)
    Source code(zip)
  • v0.9.1(Jul 4, 2019)

    We are happy to announce the release of version 0.9.1.

    New release of python module

    The main goal of this release is to merge two existing python modules: the official fastText module which was available on our github repository and the unofficial fasttext module which was available on pypi.org.

    You can find an overview of the new API here, and more insight in our blog post.

    Refactoring

    This version includes a massive rewrite of internal classes. The training and test are now split into three different classes : Model that takes care of the computational aspect, Loss that handles loss and applies gradients to the output matrix, and State that is responsible of holding the model's state inside each thread.

    That makes the code more straighforward to read but also gives a smaller memory footprint, because the data needed for loss computation is now hold only once unlike before where there was one for each thread.

    Misc

    • Compilation issues fix for recent versions of Mac OS X.
    • Better unicode handling :
      • on_unicode_error argument that helps to handle unicode issues one can face with some datasets
      • bug fix related to different behaviour of pybind11's py::str class between python2 and python3
    • script for unsupervised alignment
    • public file hosting changed from aws to fbaipublicfiles
    • we added a Code of Conduct file.

    Thank you !

    As always, we want to thank you for your help and your precious feedback which helps making this project better.

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Dec 19, 2018)

    We are happy to announce the change of the license from BSD+patents to MIT and the release of fastText 0.2.0.

    The main purpose of this release is to set a beta C++ API of the FastText class. The class now behaves as a computational library: we moved the display and some usage error handlings outside of it (mainly to main.cc and fasttext_pybind.cc). It is still compatible with older versions of the class, but some methods are now marked as deprecated and will probably be removed in the next release.

    In this respect, we also introduce the official support for python. The python binding of fastText is a client of the FastText class.

    Here is a short summary of the 104 commits since 0.1.0 :

    New :

    • Introduction of the “OneVsAll” loss function for multi-label classification, which corresponds to the sum of binary cross-entropy computed independently for each label. This new loss can be used with the -loss ova or -loss one-vs-all command line option ( 8850c51b972ed68642a15c17fbcd4dd58766291d ).
    • Computation of the precision and recall metrics for each label ( be1e597cb67c069ba9940ff241d9aad38ccd37da ).
    • Removed printing functions from FastText class ( 256032b87522cdebc4850c99b204b81b3255cb2a ).
    • Better default for number of threads ( 501b9b1e4543fd2de55e4a621a9924ce7d2b5b17 ).
    • Python support ( f10ec1faea1605d40fdb79fe472cc2204f3d584c ).
    • More tests for circleci/python ( eb9703a4a7ed0f7559d6f341cc8e5d166d5e4d88, 97fcde80ea107ca52d3d778a083564619175039c, 1de0624bfaff02d91fd265f331c07a4a0a7bb857 ).

    Bug fixes :

    • Normalize buffer vector in analogy queries.
    • Typo fixes and clarifications on website.
    • Improvements on python install issues : setup.py OS X compiler flags, pybind11 include.
    • Fix: getSubwords for EOS.
    • Fix: ETA time.
    • Fix: division by 0 in word analogy evaluation.
    • Fix for the infinite loop on ARM cpu.

    Operations :

    • We released more pre-trained vectors (92bc7d230959e2a94125fbe7d3b05257effb1111, 5bf8b4c615b6308d76ad39a5a50fa6c4174113ea ).

    Worth noting :

    • We added circleci build badges to the README.md
    • We modified the style to be in compliance with Facebook C++ style.
    • We added coverage option for Makefile and setup.py in order to build for measuring the coverage.

    Thank you fastText community!

    We want to thank you all for being a part of this community and sharing your passion with us. Some of these improvements would not have been possible without your help.

    Source code(tar.gz)
    Source code(zip)
Owner
Facebook Research
Facebook Research
Awesome Long-Tailed Learning

Awesome Long-Tailed Learning This repo pays specially attention to the long-tailed distribution, where labels follow a long-tailed or power-law distri

Stomach_ache 129 Oct 22, 2021
Code for ICE-BeeM paper - NeurIPS 2020

ICE-BeeM: Identifiable Conditional Energy-Based Deep Models Based on Nonlinear ICA This repository contains code to run and reproduce the experiments

Ilyes Khemakhem 41 Oct 13, 2021
ktrain is a Python library that makes deep learning and AI more accessible and easier to apply

Overview | Tutorials | Examples | Installation | FAQ | How to Cite Welcome to ktrain News and Announcements 2020-11-08: ktrain v0.25.x is released and

Arun S. Maiya 909 Oct 18, 2021
StellarGraph - Machine Learning on Graphs

StellarGraph Machine Learning Library StellarGraph is a Python library for machine learning on graphs and networks. Table of Contents Introduction Get

S T E L L A R 2.2k Oct 22, 2021
Phy-Q: A Benchmark for Physical Reasoning

Phy-Q: A Benchmark for Physical Reasoning Cheng Xue*, Vimukthini Pinto*, Chathura Gamage* Ekaterina Nikonova, Peng Zhang, Jochen Renz School of Comput

null 23 Oct 16, 2021
Aerial Imagery dataset for fire detection: classification and segmentation (Unmanned Aerial Vehicle (UAV))

Aerial Imagery dataset for fire detection: classification and segmentation using Unmanned Aerial Vehicle (UAV) Title FLAME (Fire Luminosity Airborne-b

null 53 Oct 12, 2021
The Incredible PyTorch: a curated list of tutorials, papers, projects, communities and more relating to PyTorch.

This is a curated list of tutorials, projects, libraries, videos, papers, books and anything related to the incredible PyTorch. Feel free to make a pu

Ritchie Ng 8.5k Oct 22, 2021
Fast Style Transfer in TensorFlow

Fast Style Transfer in TensorFlow Add styles from famous paintings to any photo in a fraction of a second! You can even style videos! It takes 100ms o

Jefferson 4 Sep 27, 2021
MolRep: A Deep Representation Learning Library for Molecular Property Prediction

MolRep: A Deep Representation Learning Library for Molecular Property Prediction Summary MolRep is a Python package for fairly measuring algorithmic p

AI-Health @NSCC-gz 39 Oct 22, 2021
Simple machine learning library / 簡單易用的機器學習套件

FukuML Simple machine learning library / 簡單易用的機器學習套件 Installation $ pip install FukuML Tutorial Lesson 1: Perceptron Binary Classification Learning Al

Fukuball Lin 283 Sep 3, 2021
The end-to-end platform for building voice products at scale

Picovoice Made in Vancouver, Canada by Picovoice Picovoice is the end-to-end platform for building voice products on your terms. Unlike Alexa and Goog

Picovoice 179 Oct 21, 2021
A comprehensive list of published machine learning applications to cosmology

ml-in-cosmology This github attempts to maintain a comprehensive list of published machine learning applications to cosmology, organized by subject ma

George Stein 211 Oct 15, 2021
ULMFiT for Genomic Sequence Data

Genomic ULMFiT This is an implementation of ULMFiT for genomics classification using Pytorch and Fastai. The model architecture used is based on the A

Karl 259 Oct 15, 2021
FPGA: Fast Patch-Free Global Learning Framework for Fully End-to-End Hyperspectral Image Classification

FPGA & FreeNet Fast Patch-Free Global Learning Framework for Fully End-to-End Hyperspectral Image Classification by Zhuo Zheng, Yanfei Zhong, Ailong M

Zhuo Zheng 66 Sep 4, 2021
Library for implementing reservoir computing models (echo state networks) for multivariate time series classification and clustering.

Framework overview This library allows to quickly implement different architectures based on Reservoir Computing (the family of approaches popularized

Filippo Bianchi 170 Oct 20, 2021
All course materials for the Zero to Mastery Deep Learning with TensorFlow course.

All course materials for the Zero to Mastery Deep Learning with TensorFlow course.

Daniel Bourke 1.7k Oct 24, 2021
PyTorch original implementation of Cross-lingual Language Model Pretraining.

XLM NEW: Added XLM-R model. PyTorch original implementation of Cross-lingual Language Model Pretraining. Includes: Monolingual language model pretrain

Facebook Research 2.5k Oct 25, 2021
Accelerated deep learning R&D

Accelerated deep learning R&D PyTorch framework for Deep Learning research and development. It focuses on reproducibility, rapid experimentation, and

Catalyst-Team 2.7k Oct 24, 2021
Code for the paper: Learning Adversarially Robust Representations via Worst-Case Mutual Information Maximization (https://arxiv.org/abs/2002.11798)

Representation Robustness Evaluations Our implementation is based on code from MadryLab's robustness package and Devon Hjelm's Deep InfoMax. For all t

Sicheng 13 Jun 25, 2021