Perform a series of pre-specified transitions, to put the parser in a desired state.
(parser, doc, sequence)
| 40 | |
| 41 | |
| 42 | def 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 | |
| 54 | def add_vecs_to_vocab(vocab, vectors): |
searching dependent graphs…