Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
fix some unknown entities
Browse files Browse the repository at this point in the history
  • Loading branch information
pommedeterresautee committed Nov 24, 2019
1 parent 432aefc commit 3af8af0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions misc/import_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def convert_to_flair_format(spacy_model: Language, data: List[Tuple[str, List[Of
# BIOES for Begin, Inside, Outside, End, Single
annotations = [a.replace('L-', 'E-') for a in annotations]
annotations = [a.replace('U-', 'S-') for a in annotations]
annotations = ["O" if a == "-" else a for a in annotations] # replace unknown
result += [f"{word} {tag}\n" for word, tag in zip(doc, annotations)]
result.append('\n')
return result
Expand Down

0 comments on commit 3af8af0

Please sign in to comment.