Skip to content

Commit

Permalink
Fix validation error on Triple vs ChemicalToDiseaseRelationship
Browse files Browse the repository at this point in the history
  • Loading branch information
caufieldjh committed Oct 3, 2023
1 parent 7d84e89 commit f9ef356
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ontogpt/evaluation/ctd/eval_ctd.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def load_cases(self, path: Path) -> Iterable[ChemicalToDiseaseDocument]:
# text = f"Title: {title} Abstract: {abstract}"
for r in document.relations:
i = r.infons
t = Triple.model_validate(
t = ChemicalToDiseaseRelationship.model_validate(
{
"subject": f"{self.subject_prefix}:{i['Chemical']}",
"predicate": RMAP[i["relation"]],
Expand All @@ -169,10 +169,10 @@ def load_cases(self, path: Path) -> Iterable[ChemicalToDiseaseDocument]:
triples_by_text[(title, abstract)].append(t)
i = 0
for (title, abstract), triples in triples_by_text.items():
i = str(i + 1)
i = i + 1
pub = Publication.model_validate(
{
"id": i,
"id": str(i),
"title": title,
"abstract": abstract,
"combined_text": "N/A",
Expand Down

0 comments on commit f9ef356

Please sign in to comment.