mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
2da16adcc2
Dropout can now be specified in the `Parser.update()` method via the `drop` keyword argument, e.g. nlp.entity.update(doc, gold, drop=0.4) This will randomly drop 40% of features, and multiply the value of the others by 1. / 0.4. This may be useful for generalising from small data sets. This commit also patches the examples/training/train_new_entity_type.py example, to use dropout and fix the output (previously it did not output the learned entity). |
||
---|---|---|
.. | ||
inventory_count | ||
keras_parikh_entailment | ||
training | ||
_handler.py | ||
chainer_sentiment.py | ||
deep_learning_keras.py | ||
get_parse_subregions.py | ||
information_extraction.py | ||
matcher_example.py | ||
multi_word_matches.py | ||
nn_text_class.py | ||
parallel_parse.py | ||
pos_tag.py | ||
README.md | ||
twitter_filter.py |
spaCy examples
The examples are Python scripts with well-behaved command line interfaces. For a full list of spaCy tutorials and code snippets, see the documentation.
How to run an example
For example, to run the nn_text_class.py
script, do:
$ python examples/nn_text_class.py
usage: nn_text_class.py [-h] [-d 3] [-H 300] [-i 5] [-w 40000] [-b 24]
[-r 0.3] [-p 1e-05] [-e 0.005]
data_dir
nn_text_class.py: error: too few arguments
You can print detailed help with the -h
argument.
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.