mirror of https://github.com/explosion/spaCy.git
Improve train CLI sentrec scoring (#4892)
* reorder to metrics to prioritize F over P/R * add sentrec to model metrics
This commit is contained in:
parent
e55fa1899a
commit
d2f3a44b42
|
@ -476,6 +476,8 @@ def _score_for_model(meta):
|
|||
mean_acc.append((acc["ents_p"] + acc["ents_r"] + acc["ents_f"]) / 3)
|
||||
if "textcat" in pipes:
|
||||
mean_acc.append(acc["textcat_score"])
|
||||
if "sentrec" in pipes:
|
||||
mean_acc.append((acc["sent_p"] + acc["sent_r"] + acc["sent_f"]) / 3)
|
||||
return sum(mean_acc) / len(mean_acc)
|
||||
|
||||
|
||||
|
@ -554,7 +556,7 @@ def _get_metrics(component):
|
|||
elif component == "ner":
|
||||
return ("ents_f", "ents_p", "ents_r")
|
||||
elif component == "sentrec":
|
||||
return ("sent_p", "sent_r", "sent_f",)
|
||||
return ("sent_f", "sent_p", "sent_r")
|
||||
return ("token_acc",)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue