mirror of https://github.com/explosion/spaCy.git
* Supply dep_strings as a tuple, for the changed API on Tokens
This commit is contained in:
parent
0981d68022
commit
88170e6295
|
@ -81,9 +81,10 @@ cdef class GreedyParser:
|
|||
guess = self.moves.best_valid(scores, state)
|
||||
self.moves.transition(state, &guess)
|
||||
# Messily tell Tokens object the string names of the dependency labels
|
||||
tokens._dep_strings = [None] * len(self.moves.label_ids)
|
||||
dep_strings = [None] * len(self.moves.label_ids)
|
||||
for label, id_ in self.moves.label_ids.items():
|
||||
tokens._dep_strings[id_] = label
|
||||
dep_strings[id_] = label
|
||||
tokens._dep_strings = tuple(dep_strings)
|
||||
tokens.is_parsed = True
|
||||
return 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue