mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
6c783f8045
* Fix code for bag-of-words feature extraction The _ml.py module had a redundant copy of a function to extract unigram bag-of-words features, except one had a bug that set values to 0. Another function allowed extraction of bigram features. Replace all three with a new function that supports arbitrary ngram sizes and also allows control of which attribute is used (e.g. ORTH, LOWER, etc). * Support 'bow' architecture for TextCategorizer This allows efficient ngram bag-of-words models, which are better when the classifier needs to run quickly, especially when the texts are long. Pass architecture="bow" to use it. The extra arguments ngram_size and attr are also available, e.g. ngram_size=2 means unigram and bigram features will be extracted. * Fix size limits in train_textcat example * Explain architectures better in docs |
||
---|---|---|
.. | ||
information_extraction | ||
keras_parikh_entailment | ||
notebooks | ||
pipeline | ||
training | ||
deep_learning_keras.py | ||
README.md | ||
vectors_fast_text.py | ||
vectors_tensorboard.py |
spaCy examples
The examples are Python scripts with well-behaved command line interfaces. For more detailed usage guides, see the documentation.
To see the available arguments, you can use the --help
or -h
flag:
$ python examples/training/train_ner.py --help
While we try to keep the examples up to date, they are not currently exercised by the test suite, as some of them require significant data downloads or take time to train. If you find that an example is no longer running, please tell us! We know there's nothing worse than trying to figure out what you're doing wrong, and it turns out your code was never the problem.