Skip to content

Commit

Permalink
upgrade to latest OAK
Browse files Browse the repository at this point in the history
  • Loading branch information
cmungall committed May 15, 2023
1 parent 48cd834 commit df2f722
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 82 deletions.
84 changes: 64 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ python = ">=3.9,<3.9.7 || >3.9.7,<4.0"
click = "^8.1.3"
importlib = "^1.0.4"
openai = "^0.27.4"
oaklib = "^0.5.4"
oaklib = "^0.5.6"
gilda = "^0.10.3"
jsonlines = "^3.1.0"
python-multipart = "^0.0.5"
Expand Down
2 changes: 1 addition & 1 deletion src/ontogpt/engines/enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from oaklib import BasicOntologyInterface, get_adapter
from pydantic import BaseModel

from ontogpt.engines.knowledge_engine import KnowledgeEngine, MODEL_GPT_4
from ontogpt.engines.knowledge_engine import MODEL_GPT_4, KnowledgeEngine
from ontogpt.prompts.enrichment import DEFAULT_ENRICHMENT_PROMPT
from ontogpt.templates.class_enrichment import ClassEnrichmentResult
from ontogpt.templates.gene_description_term import GeneDescriptionTerm
Expand Down
4 changes: 4 additions & 0 deletions src/ontogpt/engines/knowledge_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ def __post_init__(self):
self.mappers = [get_adapter("translator:")]
self.encoding = tiktoken.encoding_for_model(self.client.model)

def set_api_key(self, key: str):
self.api_key = key
openai.api_key = key

def extract_from_text(
self, text: str, cls: ClassDefinition = None, object: OBJECT = None
) -> ExtractionResult:
Expand Down
7 changes: 6 additions & 1 deletion src/ontogpt/evaluation/enrichment/eval_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@

from ontogpt.engines import create_engine
from ontogpt.engines.enrichment import ENTITY_ID, EnrichmentEngine, EnrichmentPayload
from ontogpt.engines.knowledge_engine import MODEL_GPT_3_5_TURBO, MODEL_NAME, MODEL_TEXT_DAVINCI_003, MODEL_GPT_4
from ontogpt.engines.knowledge_engine import (
MODEL_GPT_3_5_TURBO,
MODEL_GPT_4,
MODEL_NAME,
MODEL_TEXT_DAVINCI_003,
)
from ontogpt.evaluation.evaluation_engine import EvaluationEngine
from ontogpt.templates.class_enrichment import ClassEnrichmentResult
from ontogpt.utils.gene_set_utils import SYMBOL, GeneSet, drop_genes_from_gene_set, gene_info
Expand Down
15 changes: 15 additions & 0 deletions src/ontogpt/templates/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
linkml: https://w3id.org/linkml/
core: http://w3id.org/ontogpt/core/
NCIT: http://purl.obolibrary.org/obo/NCIT_
RO: http://purl.obolibrary.org/obo/RO_
description: Core upper level

default_prefix: core
Expand Down Expand Up @@ -127,3 +129,16 @@ classes:
subject_text:
object_id:
object_text:

enums:

NullDataOptions:
permissible_values:
UNSPECIFIED_METHOD_OF_ADMINISTRATION:
meaning: NCIT:C149701
NOT_APPLICABLE:
meaning: NCIT:C18902
aliases:
- "not applicable"
- "N/A"
NOT_MENTIONED:
Loading

0 comments on commit df2f722

Please sign in to comment.