提交 8ec42a5c 编写于 作者: 文幕地方's avatar 文幕地方

move import seqeval to get_metric fun

上级 cd7b2ea9
...@@ -18,7 +18,6 @@ from __future__ import print_function ...@@ -18,7 +18,6 @@ from __future__ import print_function
import numpy as np import numpy as np
import paddle import paddle
from seqeval.metrics import f1_score, precision_score, recall_score
__all__ = ['KIEMetric'] __all__ = ['KIEMetric']
...@@ -34,6 +33,7 @@ class VQASerTokenMetric(object): ...@@ -34,6 +33,7 @@ class VQASerTokenMetric(object):
self.gt_list.extend(labels) self.gt_list.extend(labels)
def get_metric(self): def get_metric(self):
from seqeval.metrics import f1_score, precision_score, recall_score
metircs = { metircs = {
"precision": precision_score(self.gt_list, self.pred_list), "precision": precision_score(self.gt_list, self.pred_list),
"recall": recall_score(self.gt_list, self.pred_list), "recall": recall_score(self.gt_list, self.pred_list),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册