MCPcopy
hub / github.com/explosion/spaCy / apply_transition_sequence

Function apply_transition_sequence

spacy/tests/util.py:42–51  ·  view source on GitHub ↗

Perform a series of pre-specified transitions, to put the parser in a desired state.

(parser, doc, sequence)

Source from the content-addressed store, hash-verified

40
41
42def apply_transition_sequence(parser, doc, sequence):
43 """Perform a series of pre-specified transitions, to put the parser in a
44 desired state."""
45 for action_name in sequence:
46 if "-" in action_name:
47 move, label = split_bilu_label(action_name)
48 parser.add_label(label)
49 with parser.step_through(doc) as stepwise:
50 for transition in sequence:
51 stepwise.transition(transition)
52
53
54def add_vecs_to_vocab(vocab, vectors):

Calls 2

split_bilu_labelFunction · 0.90
add_labelMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…