spacy.cli.evaluate: fix TypeError (#3101)

This commit is contained in:
Jari Bakken 2018-12-28 11:14:28 +01:00 committed by Ines Montani
parent 0546135fba
commit ba8a840f84

View File

@ -49,9 +49,9 @@ def evaluate(
end = timer() end = timer()
nwords = sum(len(doc_gold[0]) for doc_gold in dev_docs) nwords = sum(len(doc_gold[0]) for doc_gold in dev_docs)
results = { results = {
"Time": "%.2f s" % end - begin, "Time": "%.2f s" % (end - begin),
"Words": nwords, "Words": nwords,
"Words/s": "%.0f" % nwords / (end - begin), "Words/s": "%.0f" % (nwords / (end - begin)),
"TOK": "%.2f" % scorer.token_acc, "TOK": "%.2f" % scorer.token_acc,
"POS": "%.2f" % scorer.tags_acc, "POS": "%.2f" % scorer.tags_acc,
"UAS": "%.2f" % scorer.uas, "UAS": "%.2f" % scorer.uas,