Skip to content

Commit

Permalink
Don't chunk input text if chunking is False
Browse files Browse the repository at this point in the history
  • Loading branch information
caufieldjh committed Oct 20, 2023
1 parent 1c59b8c commit 019e6f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ontogpt/evaluation/ctd/eval_ctd.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ def eval(self) -> EvaluationObjectSetRE:
predicted_obj = None
named_entities: List[str] = [] # This stores the NEs for the whole document
ke.named_entities = [] # This stores the NEs the extractor knows about
for chunked_text in chunk_text(text):

if self.chunking:
text_list = chunk_text(text)
else:
text_list = [text]

for chunked_text in text_list:
extraction = ke.extract_from_text(chunked_text)
if extraction.extracted_object is not None:
logger.info(
Expand Down

0 comments on commit 019e6f8

Please sign in to comment.