mirror of
https://github.com/explosion/spaCy.git
synced 2024-09-21 11:29:13 +03:00
* Start scoring tokens
This commit is contained in:
parent
4944d3ba20
commit
0c4b5a2bb0
|
@ -46,7 +46,7 @@ class Scorer(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def token_acc(self):
|
def token_acc(self):
|
||||||
return self.tokens.fscore * 100
|
return self.tokens.precision * 100
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def uas(self):
|
def uas(self):
|
||||||
|
@ -85,8 +85,10 @@ class Scorer(object):
|
||||||
continue
|
continue
|
||||||
gold_i = gold.cand_to_gold[token.i]
|
gold_i = gold.cand_to_gold[token.i]
|
||||||
if gold_i is None:
|
if gold_i is None:
|
||||||
self.tags.fp += 1
|
if token.dep_.lower() not in ('p', 'punct'):
|
||||||
|
self.tokens.fp += 1
|
||||||
else:
|
else:
|
||||||
|
self.tokens.tp += 1
|
||||||
cand_tags.add((gold_i, token.tag_))
|
cand_tags.add((gold_i, token.tag_))
|
||||||
if token.dep_.lower() not in ('p', 'punct') and token.orth_.strip():
|
if token.dep_.lower() not in ('p', 'punct') and token.orth_.strip():
|
||||||
gold_head = gold.cand_to_gold[token.head.i]
|
gold_head = gold.cand_to_gold[token.head.i]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user