Skip to content

Commit

Permalink
NER context retrieval: remove context/main sentence separators
Browse files Browse the repository at this point in the history
  • Loading branch information
Aethor committed Sep 5, 2024
1 parent 71ad3a4 commit 7fb25c7
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions renard/pipeline/ner/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,12 @@ def __call__(self, dataset: NERDataset) -> NERDataset:
key=lambda m: m.element_i,
)
lctx = list(flatten([m.element for m in lctx]))
if len(lctx) > 0:
lctx += [dataset.tokenizer.sep_token]

rctx = sorted(
(m for m in matchs if m.side == "right"),
key=lambda m: m.element_i,
)
rctx = list(flatten([m.element for m in rctx]))
if len(rctx) > 0:
rctx = [dataset.tokenizer.sep_token] + rctx

elements_with_context.append((lctx, elt, rctx))

Expand Down

0 comments on commit 7fb25c7

Please sign in to comment.