Skip to content

Commit

Permalink
Prep for v1.0.3 (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
caufieldjh committed Aug 12, 2024
2 parents a698255 + 86f4025 commit 53b64ae
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ontogpt"
version = "1.0.2"
version = "1.0.3"
description = "OntoGPT"
authors = ["Chris Mungall <cjmungall@lbl.gov>", "J. Harry Caufield <jhc@lbl.gov>"]
license = "BSD-3"
Expand Down
4 changes: 1 addition & 3 deletions src/ontogpt/engines/generic_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from pydantic import BaseModel

from ontogpt.engines.knowledge_engine import KnowledgeEngine
from ontogpt.prompts.qa import GENERIC_QA_PROMPT

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -48,11 +47,10 @@ def run(
question_collection: QuestionCollection,
template_path: Union[str, Path] = "",
) -> Iterator[Question]:
if template_path is None:
template_path = GENERIC_QA_PROMPT
if isinstance(template_path, Path):
template_path = str(template_path)
if isinstance(template_path, str):
# Note: The default is a string, so this will always be true
# create a Jinja2 template object
with open(template_path) as file:
template_txt = file.read()
Expand Down
2 changes: 1 addition & 1 deletion src/ontogpt/engines/halo_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def get_element_score(self, element: OntologyElement, tokens: Set[int]) -> float
score = self.element_scores[element_name]
else:
score = 0
for _, v in element.dict().items():
for _, v in element.model_dump().items():
if v:
score += 1
self.element_scores[element_name] = score
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/engines/mapping_engine.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Synonym engine."""

import logging
from copy import deepcopy
from dataclasses import dataclass
Expand Down
9 changes: 5 additions & 4 deletions src/ontogpt/engines/reasoner_engine.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Reasoner engine."""

import logging
import re
from dataclasses import dataclass
Expand Down Expand Up @@ -72,21 +73,21 @@ class ReasonerResultSet(BaseModel):

@dataclass
class ReasonerEngine(KnowledgeEngine):
"""Engine for performing reasoning using GPT.
"""Engine for performing reasoning using an LLM.
This engine takes as input an Ontology, and a query Task,
and then translates this to a GPT prompt that asks GPT to
and then translates this to an LLM prompt that asks the LLM to
perform the task over the ontology after reasoning over it.
The Task is typically a query such as finding superclasses of
a given class.
This is intended primarily for investigation purposes. For practical
scenarios, it is recommended to use a dedicated OWL reasoner. The goal
of this engine is to evaluate the extent to which GPT can perform
of this engine is to evaluate the extent to which the LLM can perform
reasoning-like tasks, including deduction and abduction (explanation).
Due to token-length constraints on GPT models, it is usually necessary
Due to token-length constraints on some models, it is usually necessary
to extract a submodule prior to reasoning. This can be done using the
OntologyExtractor:
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_clients/test_pubmed_client_unit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""PubMed client tests."""

import unittest

from ontogpt.clients import PubmedClient
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_converters/test_ontology_converter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core tests."""

import logging
import unittest

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_ontex/test_extract.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core tests."""
"""Core tests for extraction."""

import csv
import logging
import unittest
Expand Down

0 comments on commit 53b64ae

Please sign in to comment.