spaCy/spacy/tests/parser
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__.py
test_add_label.py Support negative examples in partial NER annotations (#8106) 2021-06-17 17:33:00 +10:00
test_arc_eager_oracle.py Migrate regression tests into the main test suite (#9655) 2021-12-04 20:34:48 +01:00
test_ner.py Migrate regression tests into the main test suite (#9655) 2021-12-04 20:34:48 +01:00
test_neural_parser.py Update config resolution to use new Thinc 2020-09-27 22:21:31 +02:00
test_nn_beam.py Tidy up and auto-format 2021-01-05 13:41:53 +11:00
test_nonproj.py Make core projectivization functions cdef nogil (#10241) 2022-02-21 15:02:21 +01:00
test_parse.py Migrate regression tests into the main test suite (#9655) 2021-12-04 20:34:48 +01:00
test_parse_navigate.py Raise error if deps not provided with heads (#8335) 2021-06-15 13:23:32 +02:00
test_preset_sbd.py Support negative examples in partial NER annotations (#8106) 2021-06-17 17:33:00 +10:00
test_space_attachment.py Tidy up tests and docs 2020-09-21 20:43:54 +02:00
test_state.py Tidy up and auto-format 2021-01-05 13:41:53 +11:00