Tags: explosion/spacy-experimental
Tags
Fix issue with resolving final token in SpanResolver (#27) * Fix issue with resolving final token in SpanResolver The SpanResolver seems unable to include the final token in a Doc in output spans. It will even produce empty spans instead of doing so. This makes changes so that within the model span end indices are treated as inclusive, and converts them back to exclusive when annotating docs. This has been tested to work, though an automated test should be added. * Modify tests so last token is in a mention Running the modify tests without the changes from the previous commit, they fail. This demonstrates and clarifies the bug. * Add / rearrange comments
Make coref entry points work without PyTorch (#23) * Make coref entry points work without torch Before this PR, in environments without PyTorch, using spacy experimental can fail due to attempts to load entry points. This change makes it so the types required for class definitions (torch.nn.Module and torch.Tensor) are stubbed to object when torch is not available. * Add explanatory comment * Use has_torch instead of looking for AttributeError * Add clear errors when attempting to use coref without torch Without this, it could be unclear why coref didn't work without torch. * Move Pytorch implementations to separate files This follows the model of the biaffine parser. * Fix model name * Run tests with and without PyTorch This is the same as the changes from #24, since they worked. * Remove unused imports in coref