".github/git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "21c4b3fe933653aab1dbcee089fdc808201a19f5"
Unverified Commit f4323dbf authored by Funtowicz Morgan's avatar Funtowicz Morgan Committed by GitHub
Browse files

Don't discard entity_group when token is the latest in the sequence. (#5439)


Signed-off-by: default avatarMorgan Funtowicz <funtowiczmo@gmail.com>
parent 35befd9c
...@@ -1022,6 +1022,10 @@ class TokenClassificationPipeline(Pipeline): ...@@ -1022,6 +1022,10 @@ class TokenClassificationPipeline(Pipeline):
entities += [entity] entities += [entity]
# Ensure if an entity is the latest one in the sequence it gets appended to the output
if len(entity_group_disagg) > 0:
entity_groups.append(self.group_entities(entity_group_disagg))
# Append # Append
if self.grouped_entities: if self.grouped_entities:
answers += [entity_groups] answers += [entity_groups]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment