monarch-initiative / ontogpt

LLM-based ontological extraction tools, including SPIRES
https://monarch-initiative.github.io/ontogpt/
BSD 3-Clause "New" or "Revised" License
548 stars 68 forks source link

Add caching for mapper #363

Open caufieldjh opened 2 months ago

caufieldjh commented 2 months ago

The knowledge engine class includes a map_identifier function: https://github.com/monarch-initiative/ontogpt/blob/e3a68ae8391b12559842089657799156c06fd2f0/src/ontogpt/engines/knowledge_engine.py#L418

This calls the NodeNormalizer API through OAK: https://github.com/INCATools/ontology-access-kit/blob/0a734a8383943891173eaf8b1fd95cf4fde1f65e/src/oaklib/implementations/translator/translator_implementation.py

This process can take some time, especially when grounding many entities.

In some cases, we may not need to use the service at all: we may expect mappings to be uninformative. In other cases, we may be grounding redundantly, and can cache our results.

requests-cache may help here.