Skip to content

Commit

Permalink
Merge branch 'restructure' of https://github.com/ChatWithPDF/ai-tools
Browse files Browse the repository at this point in the history
…into restructure
  • Loading branch information
techsavvyash committed Jan 22, 2024
2 parents 59c05cb + b6c1dfb commit f42fc6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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
4 changes: 2 additions & 2 deletions src/ner/agri_ner_akai/local/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu
torch
transformers
quart
aiohttp
aiohttp

0 comments on commit f42fc6f

Please sign in to comment.