Skip to content

Commit

Permalink
rebuild model for spacy 2.1 and greater
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinoMensio committed Apr 1, 2020
1 parent 22083bf commit 1ccd4c3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
data/
data/

venv/**
2 changes: 1 addition & 1 deletion 3_export_spacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ python spacy_vectors.py $VECTORS_FILE $OUTPUT_FOLDER_VECTORS $OUTPUT_FOLDER_MODE
# now create python package
python -m spacy package $OUTPUT_FOLDER_MODEL $PACKAGE_FOLDER

pushd $PACKAGE_FOLDER/it_vectors_wiki_lg-1.0.0
pushd $PACKAGE_FOLDER/it_vectors_wiki_lg-1.0.1
python setup.py sdist
popd
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Option 1: do the preceding steps to train the vectors and then load the vectors

Option 2: install with pip the complete model from [there](https://github.com/MartinoMensio/it_vectors_wiki_spacy/releases/download/v1.0/it_vectors_wiki_lg-1.0.0.tar.gz) with the following command:
```bash
pip install -U https://github.com/MartinoMensio/it_vectors_wiki_spacy/releases/download/v1.0/it_vectors_wiki_lg-1.0.0.tar.gz
pip install -U https://github.com/MartinoMensio/it_vectors_wiki_spacy/releases/download/v1.0.1/it_vectors_wiki_lg-1.0.1.tar.gz
```
then simply load the model in SpaCy with `nlp = spacy.load('it_vectors_wiki_lg')`

Expand Down
6 changes: 3 additions & 3 deletions spacy_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def update_progress(curr, tot):
workdone = curr/tot
print("\rProgress: [{0:50s}] {1:.1f}% - {2}/{3}".format('#' * int(workdone * 50), workdone*100, curr, tot),
print("\rProgress: [{0:50s}] {1:.1f}% - {2}/{3}".format('#' * int(workdone * 50), workdone*100, curr, tot),
end="", flush=True)

@plac.annotations(
Expand Down Expand Up @@ -37,8 +37,8 @@ def main(input_file, output_folder_vectors=None, output_folder_model=None):
# edit package details
nlp.meta['name'] = 'vectors_wiki_lg'
nlp.meta['lang'] = 'it'
nlp.meta['version'] = '1.0.0'
nlp.meta['spacy_version'] = '>=2.0.0,<3.0.0'
nlp.meta['version'] = '1.0.1'
nlp.meta['spacy_version'] = '>=2.1.0,<3.0.0'
nlp.meta['description'] = '300-dimensional word vectors trained on Wikipedia with GloVe.'
nlp.meta['author'] = 'Martino Mensio'
nlp.meta['email'] = '[email protected]'
Expand Down

0 comments on commit 1ccd4c3

Please sign in to comment.