Skip to content

Commit

Permalink
fix(linker): map normalized indices to unnormalized as last step (for…
Browse files Browse the repository at this point in the history
…got to do that).
  • Loading branch information
nsantacruz committed Nov 12, 2023
1 parent a92d8e5 commit 5cef34b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sefaria/model/linker/linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def link(self, input_str: str, book_context_ref: Optional[Ref] = None, with_fail
resolved_refs = self._ref_resolver.bulk_resolve(raw_refs, book_context_ref, with_failures, thoroughness)
if type_filter in {'all', 'named entity'}:
resolved_named_entities = self._ne_resolver.bulk_resolve(named_entities, with_failures)
return LinkedDoc(input_str, resolved_refs, resolved_named_entities)
doc = LinkedDoc(input_str, resolved_refs, resolved_named_entities)
self._ner.map_normal_output_to_original_input(input_str, [x.raw_entity for x in doc.all_resolved])
return doc

def get_ner(self) -> NamedEntityRecognizer:
return self._ner
Expand Down

0 comments on commit 5cef34b

Please sign in to comment.