mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 05:37:03 +03:00
* Update parser training script for tweaked parser API
This commit is contained in:
parent
4e857ab7a6
commit
72ff9c5082
|
@ -135,7 +135,7 @@ def evaluate(Language, dev_loc, model_dir):
|
||||||
for words, heads, labels, tags in sents:
|
for words, heads, labels, tags in sents:
|
||||||
tokens = nlp.tokenizer.tokens_from_list(words)
|
tokens = nlp.tokenizer.tokens_from_list(words)
|
||||||
nlp.tagger(tokens)
|
nlp.tagger(tokens)
|
||||||
nlp.parser.parse(tokens)
|
nlp.parser(tokens)
|
||||||
for i, token in enumerate(tokens):
|
for i, token in enumerate(tokens):
|
||||||
#print i, token.string, i + token.head, heads[i], labels[i]
|
#print i, token.string, i + token.head, heads[i], labels[i]
|
||||||
if labels[i] == 'P' or labels[i] == 'punct':
|
if labels[i] == 'P' or labels[i] == 'punct':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user