From 0c4b5a2bb0ca86cc3f72b7c123c8fe007c75f242 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 28 Jun 2015 06:21:38 +0200 Subject: [PATCH] * Start scoring tokens --- spacy/scorer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spacy/scorer.py b/spacy/scorer.py index 0e3c6fd53..7172b93a4 100644 --- a/spacy/scorer.py +++ b/spacy/scorer.py @@ -46,7 +46,7 @@ class Scorer(object): @property def token_acc(self): - return self.tokens.fscore * 100 + return self.tokens.precision * 100 @property def uas(self): @@ -85,8 +85,10 @@ class Scorer(object): continue gold_i = gold.cand_to_gold[token.i] if gold_i is None: - self.tags.fp += 1 + if token.dep_.lower() not in ('p', 'punct'): + self.tokens.fp += 1 else: + self.tokens.tp += 1 cand_tags.add((gold_i, token.tag_)) if token.dep_.lower() not in ('p', 'punct') and token.orth_.strip(): gold_head = gold.cand_to_gold[token.head.i]