mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Fixed conllu converter
This commit is contained in:
parent
49026a1346
commit
62dbf9025c
|
@ -73,10 +73,10 @@ def generate_sentence(sent):
|
||||||
tokens = []
|
tokens = []
|
||||||
for i, id in enumerate(id_):
|
for i, id in enumerate(id_):
|
||||||
token = {}
|
token = {}
|
||||||
token["orth"] = word[id]
|
token["orth"] = word[i]
|
||||||
token["tag"] = tag[id]
|
token["tag"] = tag[i]
|
||||||
token["head"] = head[id] - i
|
token["head"] = head[i] - id
|
||||||
token["dep"] = dep[id]
|
token["dep"] = dep[i]
|
||||||
tokens.append(token)
|
tokens.append(token)
|
||||||
sentence["tokens"] = tokens
|
sentence["tokens"] = tokens
|
||||||
return sentence
|
return sentence
|
||||||
|
|
Loading…
Reference in New Issue
Block a user