Skip to content

Commit

Permalink
Update model.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Gautam-Rajeev authored Jan 22, 2024
1 parent c942dd5 commit b6c1dfb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ner/agri_ner_akai/local/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ def aggregate_entities(sentence, entity_outputs):
current_entity = None

else:
if current_entity:
# If it's a subword but not an I- entity
current_entity["word"] += entity["word"][2:]
current_entity["end"] = entity["end"]
current_entity["score"] = float((current_entity["score"] + entity["score"]) / 2) # averaging scores
current_entity["word"] += entity["word"][2:]
current_entity["end"] = entity["end"]
current_entity["score"] = float((current_entity["score"] + entity["score"]) / 2) # averaging scores

# Handle full words
else:
Expand Down

0 comments on commit b6c1dfb

Please sign in to comment.