Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
8e1e7a3
Fix API documentation
pyk Aug 11, 2016
002c6d8
Merge pull request #8 from pyk/hotfix/update-api-doc
pyk Aug 11, 2016
ddb97a0
Fix spelling on README.md
pyk Aug 11, 2016
9b94f2b
Merge pull request #9 from pyk/hotfix/spelling-on-readme
pyk Aug 11, 2016
8c77787
Fix #10: Support unicode instead of plain bytes
pyk Aug 12, 2016
061817f
Merge pull request #11 from salestock/hotfix/issue-1
pyk Aug 12, 2016
1ab3592
Migrate to salestock
pyk Aug 12, 2016
e9456ce
Merge pull request #12 from salestock/misc/migration-to-salestock
pyk Aug 12, 2016
86db929
Add unicode test to CBOW model
pyk Aug 12, 2016
a96ef34
Fix unicode literals SyntaxError in Python 3.2
pyk Aug 12, 2016
c6c26fb
Merge pull request #13 from salestock/hotfix/update-test
pyk Aug 12, 2016
c791a00
resolve #15, resolve #16 Add contains and getitem functions (#17)
pommedeterresautee Aug 12, 2016
3e340f0
Update the intro and the API docs
pyk Aug 12, 2016
5d4780a
Add slack notification in Travis CI
pyk Aug 12, 2016
5957c4e
Add interface for supervised model
pyk Aug 12, 2016
e3436ff
Add tests for the supervised model
pyk Aug 12, 2016
b832572
Update API docs
pyk Aug 12, 2016
6767112
Update API docs
pyk Aug 12, 2016
ad91f10
Fix Supervised model test to support Python 3
pyk Aug 12, 2016
600fe0a
Update API docs
pyk Aug 12, 2016
2103d4a
Refactoring the test
pyk Aug 13, 2016
1ac0ad4
Add classifier.test interface
pyk Aug 13, 2016
f5c242b
Add test for the classifier.test interface
pyk Aug 13, 2016
d3edb04
Ignore the test result file from fasttext(1)
pyk Aug 13, 2016
f9a74bb
Using default value of args.lr when initialize a Model
pyk Aug 13, 2016
5aeb515
Add classifier.test to the API docs
pyk Aug 13, 2016
74e7b4f
Update API docs
pyk Aug 13, 2016
0f428a0
Explicitly cast the nexamples to double before returning the test result
pyk Aug 13, 2016
2b2acb3
Add classifier.predict(texts) interface
pyk Aug 14, 2016
ceff8e3
Add test case for classifier.predict(texts) interface
pyk Aug 14, 2016
9b3355d
Add documentation of classifier.predict(texts) interface
pyk Aug 14, 2016
d9effd8
Update package version from v0.5.19 to v0.6.0
pyk Aug 14, 2016
220b1ac
Merge pull request #21 from salestock/feature/supervised
pyk Aug 14, 2016
1f92f08
Fix dependencies on build
pyk Aug 14, 2016
a3be436
Merge pull request #22 from salestock/hotfix/future-package
pyk Aug 14, 2016
9ec82a8
Add CONTRIBUTING.md
pyk Aug 15, 2016
955bf8e
Add long_description in reStructuredText format
pyk Aug 15, 2016
5470ace
Update CONTRIBUTING.md
pyk Aug 15, 2016
2e1ff2b
Update CONTRIBUTING.md
pyk Aug 15, 2016
7e905cd
Merge pull request #23 from salestock/misc/improve-docs
pyk Aug 15, 2016
101dc32
fastText: update 9bfa32d to 86e6b44
pyk Aug 17, 2016
d3be364
Merge pull request #25 from salestock/feature/update-9bfa32d-to-86e6b44
pyk Aug 17, 2016
58be523
Add fasttext version info
pyk Aug 17, 2016
49a055f
Merge pull request #27 from salestock/hotfix/update-contrib-file
pyk Aug 17, 2016
6917570
Ignore TODO file
pyk Aug 18, 2016
1051b7b
Ignore README.rst
pyk Aug 18, 2016
c06d535
Add fasttext.__VERSION__
pyk Aug 18, 2016
3da7bb3
Fix allocation error in FastTextModel::setMatrix
pyk Aug 19, 2016
ea50b71
Update test for the classifier
pyk Aug 19, 2016
b14d541
Remove --failfast on test-classifier
pyk Aug 19, 2016
a708b5f
Read version from a file
pyk Aug 19, 2016
42657e9
Add README.rst to the git index
pyk Aug 19, 2016
b700686
Fix test/download_dbpedia.sh
pyk Aug 19, 2016
dcae6e0
Redirect stdout to /dev/null
pyk Aug 19, 2016
c2cd5c6
Enable silent mode in tests
pyk Aug 19, 2016
e8eb793
Merge pull request #29 from salestock/hotfix/issue-26
pyk Aug 19, 2016
7c1407f
Update v0.6.2 to v0.6.3
pyk Aug 19, 2016
747da81
Merge pull request #30 from salestock/feature/bump-to-v0.6.3
pyk Aug 19, 2016
f7af9c5
Add fasttext/VERSION to the package file
pyk Aug 20, 2016
2288c42
Merge pull request #33 from salestock/hotfix/issue-32
pyk Aug 20, 2016
2ea655c
Add examples, resolve #19
pyk Aug 22, 2016
350e739
Merge pull request #34 from salestock/misc/add-examples
pyk Aug 22, 2016
aee999b
fastText: Update 86e6b44 to 1826a12
pyk Aug 22, 2016
f681e91
Implement k-best labels for classifier & Add recall to the test results
pyk Aug 22, 2016
d6fae1c
Add test for k-best labels classifier
pyk Aug 22, 2016
c1f65de
Ignore prediction result from k-best label
pyk Aug 22, 2016
473bac1
Remove get_vector method from WordVectorModel class
pyk Aug 22, 2016
fa47782
Remove get_vector from Skipgram & CBOW test
pyk Aug 22, 2016
56adcdc
Update README.md for v0.7
pyk Aug 22, 2016
a4714e5
Update v0.6.4 to v0.7
pyk Aug 22, 2016
da8c265
typo
renaud Aug 22, 2016
379692f
Merge pull request #38 Upgrade v0.6.4 to v0.7
pyk Aug 22, 2016
c1b5326
Merge pull request #39 from renaud/patch-1
pyk Aug 22, 2016
123dcb1
info about where to obtain the training data
renaud Aug 22, 2016
3916462
fastText: Update 1826a12 to 3223526
pyk Aug 22, 2016
4c1f783
Update README.rst
pyk Aug 22, 2016
7ecbbf9
Add pre-test target to make sure test env are clean before running test
pyk Aug 22, 2016
7ee1a60
Update classifier test, model.vec is not generated anymore
pyk Aug 22, 2016
442fb79
Merge branch 'patch-2' of https://github.com/renaud/fastText.py into …
pyk Aug 22, 2016
abab111
Update example for the classifier model
pyk Aug 22, 2016
9a70502
Update pre-test target, rm files if exists
pyk Aug 22, 2016
79078b6
Merge pull request #43 from salestock/feature/update-fasttext-to-3223526
pyk Aug 22, 2016
31f9639
Update v0.7.0 to v0.7.1 [skip ci]
pyk Aug 22, 2016
52fcdca
Merge pull request #46 from salestock/feature/bump-to-v0.7.1
pyk Aug 22, 2016
8eca177
Update the default params
pyk Aug 24, 2016
52e359c
Add default params test
pyk Aug 24, 2016
b83a7e5
Ignore files from default params test
pyk Aug 24, 2016
e96b801
Update v0.7.1 to v0.7.2
pyk Aug 24, 2016
40050ae
Merge pull request #50 from salestock/hotfix/supervised-hang
pyk Aug 24, 2016
fe5fcd3
Fix C++ code compilation problem on OSX (#55)
xiamx Aug 25, 2016
860d4a7
Update default params test
pyk Aug 29, 2016
e41dcd4
Ignore test/*_result.txt
pyk Aug 29, 2016
345f146
Set fasttext.__VERSION__
pyk Aug 29, 2016
4084284
Update default params docs
pyk Aug 29, 2016
a367565
Add fasttext/VERSION as data_files in setup.py
pyk Aug 29, 2016
9cda45e
Update self.assertRaises to support Python 2.6
pyk Aug 29, 2016
68a5b27
Update docs
pyk Aug 29, 2016
82cdb66
Build PR and master branch only
pyk Aug 29, 2016
c08afb9
Merge pull request #56 from salestock/feature/update-tests
pyk Aug 29, 2016
1ddb643
Add target to upload and install from pypitest server
pyk Aug 29, 2016
9001e65
Merge pull request #57 from salestock/misc/add-pypitest-server
pyk Aug 29, 2016
c9c04b3
Build & test the release tags
pyk Aug 30, 2016
25ad0d4
Update fastText from 3223526 to fabb04e
pyk Aug 31, 2016
3854cff
Add compatibility for fastText version fabb04e
pyk Aug 31, 2016
caeb635
Fix undefined symbol _ZN8FastText5trainESt10shared_ptrI4Args
pyk Aug 31, 2016
4f98471
Fix compatibility for skipgram and CBOW model against the fasttext ve…
pyk Aug 31, 2016
3b7cfce
Remove unused code in fasttext/interface.pxd
pyk Aug 31, 2016
71b3379
Fix compatibility for classifier model against the fasttext version f…
pyk Aug 31, 2016
dd4e151
Update classifier default params value
pyk Aug 31, 2016
836fa01
Update default value of minn & maxn in supervised to prevent Floating…
pyk Sep 1, 2016
9e2e828
Implement classifier.predict_proba
pyk Sep 1, 2016
2d5e3da
Add test for classifier.predict_proba
pyk Sep 1, 2016
a58dda9
Add classifier.predict_proba documentation
pyk Sep 1, 2016
22344df
Improve the classifier.predict performance
pyk Sep 1, 2016
2876c98
Explicitly convert zip() to list() to support Python 3
pyk Sep 1, 2016
6a2c73f
Update v0.7.2 to v0.7.3
pyk Sep 1, 2016
00b0b2c
Merge pull request #60 from salestock/feature/predict-proba
pyk Sep 1, 2016
339e33a
Remove fasttext/VERSION; it cause unexpected behaviour in different env
pyk Sep 1, 2016
a621948
Merge pull request #64 from salestock/hotfix/remove-VERSION-file
pyk Sep 1, 2016
77b6d16
Update fastText fabb04e to 602355a
pyk Sep 2, 2016
b4e811b
Merge pull request #65 from salestock/misc/update-fasttext-lib-to-602…
pyk Sep 4, 2016
3ceca30
Add predict and predict_proba in train classifier test
pyk Sep 6, 2016
44bc366
Unfree the log table to prevent segfaults
pyk Sep 6, 2016
dbbb973
Merge pull request #69 from salestock/hotfix/issue-68
pyk Sep 6, 2016
1519117
Update to v0.7.6
pyk Sep 6, 2016
8ad6ec3
Merge pull request #70 from salestock/feature/release-v0.7.6
pyk Sep 6, 2016
fc1de74
improves check word in vocab performance
jayantj Sep 6, 2016
ba0835d
Merge pull request #71 from jayantj/vocab_check
pyk Sep 6, 2016
a1d8201
fastText: update 602355a to d652288
pyk Sep 13, 2016
300ae32
Merge pull request #75 from salestock/misc/update-fasttext-to-d65228
pyk Sep 13, 2016
17b9523
fastText: d652288 updated to 16f623f
pyk Sep 24, 2016
df22043
Update the dbpedia dataset's url
pyk Sep 25, 2016
9f367c4
Merge pull request #79 from salestock/misc/update-fasttext-to-16f623f
pyk Sep 25, 2016
632dd45
update param name 'input' to 'input_file' in doc
kn45 Sep 28, 2016
d6b8ea2
Merge pull request #81 from kn45/patch-1
pyk Sep 28, 2016
99131db
Add test for encoding param
pyk Sep 29, 2016
e5020b7
Support non-utf8 encoding
pyk Sep 29, 2016
6dd96fd
Update README.*
pyk Sep 29, 2016
7e789e6
Support non-utf8 for Python 3
pyk Sep 30, 2016
7b072ac
Merge pull request #82 from salestock/feature/support-non-utf8
pyk Sep 30, 2016
cde9ec3
Release v0.8.0
pyk Oct 5, 2016
9023a0a
Merge pull request #84 from salestock/release/v0.8
pyk Oct 5, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,18 @@ dist/

fasttext/fasttext.cpp
facebookresearch-fasttext-*

# Intellij
.idea/

# pip
.eggs/

# For test
test/*_result.txt
test/dbpedia.train
test/dbpedia_csv/
test/default_params_test

# Misc
TODO
21 changes: 13 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"

- '2.6'
- '2.7'
- '3.2'
- '3.3'
- '3.4'
- '3.5'
install: make install

script: make test
branches:
only:
- master
- /^v\d{,2}\.\d{,3}\.\d{,3}$/
notifications:
slack:
secure: pStiYmzBbnb0W18r1i1Lz8FIakVHajsv3on1vWy8fNWVuPfaJ85ZqJhnmrr2HKlanZcl6bEMnllDctzt/F+u4HfeXHmhS7a9nZbRDDGyWIxsvJA/UqPt2byLEB1u+KbLb53eDu7MTIe63tzk1zq+4BTupI+btc4igiUuzAhqh4+LP9eZe2L58aC+jOzIn/9Kno7+xawhj2DKs6m3O/hcXFORcOpdtWRFpoDa66dN7xPVbN0hYD80uVApEpghnHToiJN0HhhB92YmZHa1ByWj7u9VN1Eaex1srGQOJQG3FaDBJY1r2e9c7Sj+33gkZb1AqjeOpxhRsxxVUdigDvCoxIrr6ll0/p3n6pUfRGQ7SB1A7NoRBC+g6aTJbOLr5NjQDBmZHaFXx/QFd1h0EUfgBybDI3v4cKOtV8vIFoT1xdkGs/Hjo4v9z4KO6R135uDBwaJAo9cWx360xV1UK1cb4kfzdbJFk4mNmMEbdwJHT27a7e3uWr1lu6CrMUzVk0EXj1BroKC7jcRK7qthr9DcfW2mmGG3JTIKQ6+nYSEF0KC/JjjbIsg/2hKtq7mACzrHrluN6HbqCF6Kd2n2rfItsqIaCo6LEmgZ2fo69R34i96QzyHpplBivWOgC+pwLOe0FiseuleSCZ/kQgJPf62gsqCan6+GkazoEp9Ow+lPMkA=
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# How to contribute

We definitely welcome patches and contribution to fastText.py!

Here are some guidelines and information about how to do so.

## Sending patches

### Getting started

1. Check out the code:

$ git clone https://github.com/salestock/fastText.py.git
$ cd fastText.py
$ pip install -r requirements.txt

1. Create a fork of the fastText.py repository.
1. Add your fork as a remote:

$ git remote add fork git@github.com:$YOURGITHUBUSERNAME/fastText.py.git

1. Make changes, commit them.
1. Run the test suite:

$ make install-dev
$ make test

1. Push your changes to your fork:

$ git push fork ...

1. Open a pull request.

## Filing Issues
When filing an issue, make sure to answer these five questions:

1. What version of Python are you using (`python --version`)?
2. What version of `fasttext` are you using (`pip list | grep fasttext`)?
3. What operating system and processor architecture are you using?
4. What did you do?
5. What did you expect to see?
6. What did you see instead?

### Contributing code
Unless otherwise noted, the fastText.py source files are distributed under
the BSD-style license found in the LICENSE file.
99 changes: 91 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

all: install test

test: test-skipgram test-cbow
test: test-skipgram test-cbow test-classifier

buildext:
python setup.py build_ext --inplace
Expand All @@ -12,30 +12,113 @@ install:
python setup.py install
.PHONY: install

install-dev:
# Install the pandoc(1) first to run this command
# sudo apt-get install pandoc
README.rst: README.md
pandoc --from=markdown --to=rst --output=README.rst README.md

upload: README.rst
python setup.py sdist upload

upload-to-pypitest: README.rst
python setup.py sdist upload -r pypitest
.PHONY: upload-to-pypitest

install-from-pypitest::
pip install -U --no-cache-dir -i https://testpypi.python.org/pypi fasttext
.PHONY: install-from-pypitest

install-dev: README.rst
python setup.py develop
.PHONY: install-dev

pre-test:
# Remove generated file from test
rm -f test/*.vec test/*.bin test/*_result.txt
.PHONY: pre-test

fasttext/cpp/fasttext:
make --directory fasttext/cpp/

# Test for skipgram model
# Redirect stdout to /dev/null to prevent exceed the log limit size from
# Travis CI
test/skipgram_params_test.bin:
./fasttext/cpp/fasttext skipgram -input test/params_test.txt -output \
test/skipgram_params_test -lr 0.025 -dim 100 -ws 5 -epoch 1 \
-minCount 5 -neg 5 -loss ns -bucket 2000000 -minn 3 -maxn 6 \
-thread 4 -lrUpdateRate 100 -t 1e-4
-minCount 1 -neg 5 -loss ns -bucket 2000000 -minn 3 -maxn 6 \
-thread 4 -lrUpdateRate 100 -t 1e-4 >> /dev/null

# Generate default value of skipgram command from fasttext(1)
test/skipgram_default_params_result.txt:
$(MAKE) skipgram_default_params_result.txt --directory test/

test-skipgram: fasttext/cpp/fasttext test/skipgram_params_test.bin
test-skipgram: pre-test fasttext/cpp/fasttext test/skipgram_params_test.bin \
test/skipgram_default_params_result.txt
python test/skipgram_test.py --verbose

# Test for cbow model
# Redirect stdout to /dev/null to prevent exceed the log limit size from
# Travis CI
test/cbow_params_test.bin:
./fasttext/cpp/fasttext cbow -input test/params_test.txt -output \
test/cbow_params_test -lr 0.005 -dim 50 -ws 5 -epoch 1 \
-minCount 3 -neg 5 -loss ns -bucket 2000000 -minn 3 -maxn 6 \
-thread 4 -lrUpdateRate 100 -t 1e-4
-minCount 1 -neg 5 -loss ns -bucket 2000000 -minn 3 -maxn 6 \
-thread 4 -lrUpdateRate 100 -t 1e-4 >> /dev/null

test-cbow: fasttext/cpp/fasttext test/cbow_params_test.bin
# Generate default value of cbow command from fasttext(1)
test/cbow_default_params_result.txt:
$(MAKE) cbow_default_params_result.txt --directory test/

test-cbow: pre-test fasttext/cpp/fasttext test/cbow_params_test.bin \
test/cbow_default_params_result.txt
python test/cbow_test.py --verbose

# Test for classifier
test/dbpedia.train: test/download_dbpedia.sh
sh test/download_dbpedia.sh # Download & normalize training file

# Redirect stdout to /dev/null to prevent exceed the log limit size from
# Travis CI
test/classifier.bin: test/dbpedia.train
./fasttext/cpp/fasttext supervised -input test/dbpedia.train \
-output test/classifier -dim 100 -lr 0.1 -wordNgrams 2 \
-minCount 1 -bucket 2000000 -epoch 5 -thread 4 >> /dev/null

test/classifier_test_result.txt: test/classifier.bin
./fasttext/cpp/fasttext test test/classifier.bin \
test/classifier_test.txt > test/classifier_test_result.txt

test/classifier_pred_result.txt: test/classifier.bin
./fasttext/cpp/fasttext predict test/classifier.bin \
test/classifier_pred_test.txt > \
test/classifier_pred_result.txt

test/classifier_pred_k_result.txt: test/classifier.bin
./fasttext/cpp/fasttext predict test/classifier.bin \
test/classifier_pred_test.txt 5 > \
test/classifier_pred_k_result.txt

test/classifier_pred_prob_result.txt: test/classifier.bin
./fasttext/cpp/fasttext predict-prob test/classifier.bin \
test/classifier_pred_test.txt > \
test/classifier_pred_prob_result.txt

test/classifier_pred_prob_k_result.txt: test/classifier.bin
./fasttext/cpp/fasttext predict-prob test/classifier.bin \
test/classifier_pred_test.txt 5 > \
test/classifier_pred_prob_k_result.txt

# Generate default value of classifier command from fasttext(1)
test/classifier_default_params_result.txt:
$(MAKE) classifier_default_params_result.txt --directory test/

test-classifier: pre-test fasttext/cpp/fasttext test/classifier.bin \
test/classifier_test_result.txt \
test/classifier_pred_result.txt \
test/classifier_pred_k_result.txt \
test/classifier_pred_prob_result.txt \
test/classifier_pred_prob_k_result.txt \
test/classifier_default_params_result.txt
python test/classifier_test.py --verbose

Loading