monarch-initiative / ontogpt

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

Documentation: provide example of custom LinkML model #13

Closed matentzn closed 1 year ago

matentzn commented 1 year ago

I tried

ontogpt extract -t path/to/templates/phenotype.yaml abstract.txt

but got:

FileNotFoundError: [Errno 2] No such file or directory: '/Users/matentzn/ws/ontogpt/src/ontogpt/templates/path/to/templates/phenotype.yaml'`
cmungall commented 1 year ago

The argument for -t has to be the name of a template in the templates folder.

We should make it such that it can be any of:

  1. a path to yaml (with compilation to pydantic happening dynamically)
  2. a path to a folder with yaml and py
  3. the name of a schema that is discoverable via a plugin framework

For now I would suggest making PRs and we will err on the side of over-inclusion of different people's schemas in the main repo (and people can always make long running forks if they don't want to share). As we may need to refactor a bit having them all mono style is probably best for now. But there will come a point where this won't scale... not there yet though!

nlharris commented 1 year ago

should i create a linkml enhancement ticket (in the linkml repo) for your "we should make it" list?

cmungall commented 1 year ago

this would be an ontogpt piece of functionality

DanNBullock commented 1 year ago

@matentzn I think I was able to get a custom one up and running in my fork. The specific yaml file can be found here. I did encounter a number of (undocumented?) challenges getting it up and running though, which I can recount here.

To the maintainers: If this is the incorrect place to document these, let me know and I can create a new issue, but it seems topically related to the implementation of custom LinkML models.

Challenges with implementing a custom LinkML model / ontology

That's all that I can recall at the moment. Thank you to the maintainers for this powerful new workflow! Also, let me know if I should create a separate thread for this post.

serenalotreck commented 1 year ago

Not sure if this is the right place for this question -- is there a way to integrate a custom LinkML schema with the pip-installed version of the package, as opposed to needing to fork the repo?

nlharris commented 1 year ago

Hi @serenalotreck, this seems like a question that is not that closely related to this issue. Can you open a new issue, or try asking on the LinkML community Slack?

caufieldjh commented 1 year ago

This question is still related, but I'll transfer it to its own issue so I ensure it gets into the documentation.