spaCy/spacy/pipeline/_parser_internals
Daniël de Kok 78a8bec4d0
Make core projectivization functions cdef nogil (#10241)
* Make core projectivization methods cdef nogil

While profiling the parser, I noticed that relatively a lot of time is
spent in projectivization. This change rewrites the functions in the
core loops as cdef nogil for efficiency.

In C++-land, we use vector in place of Python lists and absent heads
are represented as -1 in place of None.

* _heads_to_c: add assertion

Validation should be performed by the caller, but this assertion ensures that
we are not reading/writing out of bounds with incorrect input.
2022-02-21 15:02:21 +01:00
..
__init__.pxd Add beam_parser and beam_ner components for v3 (#6369) 2020-12-13 09:08:32 +08:00
__init__.py The Parser is now a Pipe (2) (#5844) 2020-07-30 23:30:54 +02:00
_beam_utils.pxd Add beam_parser and beam_ner components for v3 (#6369) 2020-12-13 09:08:32 +08:00
_beam_utils.pyx Getting scores out of beam_ner (#6575) 2021-01-06 12:02:32 +01:00
_state.pxd Use constant-time head lookups in StateC::{L,R} 2022-01-13 12:08:46 +01:00
_state.pyx The Parser is now a Pipe (2) (#5844) 2020-07-30 23:30:54 +02:00
arc_eager.pxd Getting scores out of beam_parser (#6684) 2021-01-07 16:28:27 +11:00
arc_eager.pyx Use dict.copy().items() instead of list(.items()) (#9868) 2021-12-16 09:17:33 +01:00
ner.pxd The Parser is now a Pipe (2) (#5844) 2020-07-30 23:30:54 +02:00
ner.pyx Support negative examples in partial NER annotations (#8106) 2021-06-17 17:33:00 +10:00
nonproj.pxd The Parser is now a Pipe (2) (#5844) 2020-07-30 23:30:54 +02:00
nonproj.pyx Make core projectivization functions cdef nogil (#10241) 2022-02-21 15:02:21 +01:00
stateclass.pxd Add beam_parser and beam_ner components for v3 (#6369) 2020-12-13 09:08:32 +08:00
stateclass.pyx Add beam_parser and beam_ner components for v3 (#6369) 2020-12-13 09:08:32 +08:00
transition_system.pxd Support negative examples in partial NER annotations (#8106) 2021-06-17 17:33:00 +10:00
transition_system.pyx Support negative examples in partial NER annotations (#8106) 2021-06-17 17:33:00 +10:00