mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 13:47:13 +03:00
d61e742960
* Handle docs with no entities If a whole batch contains no entities it won't make it to the model, but it's possible for individual Docs to have no entities. Before this commit, those Docs would cause an error when attempting to concatenate arrays because the dimensions didn't match. It turns out the process of preparing the Ragged at the end of the span maker forward was a little different from list2ragged, which just uses the flatten function directly. Letting list2ragged do the conversion avoids the dimension issue. This did not come up before because in NEL demo projects it's typical for data with no entities to be discarded before it reaches the NEL component. This includes a simple direct test that shows the issue and checks it's resolved. It doesn't check if there are any downstream changes, so a more complete test could be added. A full run was tested by adding an example with no entities to the Emerson sample project. * Add a blank instance to default training data in tests Rather than adding a specific test, since not failing on instances with no entities is basic functionality, it makes sense to add it to the default set. * Fix without modifying architecture If the architecture is modified this would have to be a new version, but this change isn't big enough to merit that. |
||
---|---|---|
.. | ||
models | ||
__init__.py | ||
_character_embed.py | ||
_precomputable_affine.py | ||
callbacks.py | ||
extract_ngrams.py | ||
extract_spans.py | ||
featureextractor.py | ||
parser_model.pxd | ||
parser_model.pyx | ||
staticvectors.py | ||
tb_framework.py |