diff --git a/seqeval/metrics/sequence_labeling.py b/seqeval/metrics/sequence_labeling.py index d642c90..175bd4a 100644 --- a/seqeval/metrics/sequence_labeling.py +++ b/seqeval/metrics/sequence_labeling.py @@ -53,10 +53,10 @@ def _validate_chunk(chunk, suffix): if suffix: tag = chunk[-1] - type_ = chunk.split('-')[0] + type_ = chunk[:-1].rsplit('-', maxsplit=1)[0] or '_' else: tag = chunk[0] - type_ = chunk.split('-')[-1] + type_ = chunk[1:].split('-', maxsplit=1)[-1] or '_' if end_of_chunk(prev_tag, tag, prev_type, type_): chunks.append((prev_type, begin_offset, i-1))