Skip to content

Commit

Permalink
🚧 Work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrikerMan committed May 10, 2020
1 parent e67c317 commit 6f94d06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions kashgari/metrics/multi_label_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,4 @@ def multi_label_classification_report(y_true: MultiLabelClassificationLabelVar,


if __name__ == "__main__":
from kashgari.utils import MultiLabelBinarizer

m = MultiLabelBinarizer({'s': 0, 'c': 1})
print(multi_label_classification_report([['s', 'c']], [['s']],
binarizer=m))
pass
6 changes: 3 additions & 3 deletions kashgari/tasks/classification/abc_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ def evaluate(self, # type: ignore[override]
logger.debug('y_pred : {}'.format(y_pred[index]))

if self.multi_label:
report = multi_label_classification_report(y_data,
y_pred,
binarizer=self.label_processor.multi_label_binarizer)
report = multi_label_classification_report(y_data, # type: ignore
y_pred, # type: ignore
binarizer=self.label_processor.multi_label_binarizer) # type: ignore

else:
original_report = metrics.classification_report(y_data,
Expand Down

0 comments on commit 6f94d06

Please sign in to comment.