Skip to content

Commit

Permalink
Update sequence_labeling.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AlongWY authored Jul 8, 2020
1 parent 5ffb52e commit b8a2a98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions seqeval/metrics/sequence_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def get_entities(seq, suffix=False):
for i, chunk in enumerate(seq + ['O']):
if suffix:
tag = chunk[-1]
type_ = chunk[:-1].split('-', maxsplit=1)[0] or '_'
type_ = chunk[:-1].rsplit('-', maxsplit=1)[0] or '_'
else:
tag = chunk[0]
type_ = chunk[1:].rsplit('-', maxsplit=1)[-1] or '_'
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))
Expand Down

0 comments on commit b8a2a98

Please sign in to comment.