monarch-initiative / pheval.llm

Analysis of LLMs for Clinical Observations
https://monarch-initiative.github.io/pheval.llm/
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Error in score_grounded_result #21

Open leokim-l opened 6 months ago

leokim-l commented 6 months ago

@cmungall @justaddcoffee @caufieldjh any idea what these are?

ERROR:root:Skipping statements(subject=MONDO:0016830,predicate=skos:exactMatch,object=https://omim.org/phenotypicSeries/PS310300,value=None,datatype=None,language=None,); ValueError: https://omim.org/phenotypicSeries/PS310300 is not a valid URI or CURIE

I'm getting a bunch of these errors when running score_grounded_result(...). @cmungall do you have an obvious immediate direction to point us to? Thanks!

justaddcoffee commented 6 months ago

For context, these errors I think are coming from this line

            df['is_correct'] = df.apply(
                lambda row: score_grounded_result(row['term'], row['correct_term']) > 0,
                axis=1)

where we are scoring whether GPTs prediction (row['term']) is equivalent to the correct OMIM term (row['correct_term'])

@cmungall can you tell if this error is harmful or not? It's not clear if this means we are not getting the OMIMs that are part of the phenotypic series mentioned in this error.

(Also, I'm not clear on why things like https://omim.org/phenotypicSeries/PS310300 are not valid URIs)

caufieldjh commented 6 months ago

This can be replicated with the OAK CLI:

$ runoak -vvv -i sqlite:obo:mondo normalize MONDO:0016830 -M OMIM
INFO:root:Setting other_languages=()
INFO:root:Settings = Settings(impl=None, autosave=False, associations_type=None, preferred_language=None, other_languages=())
INFO:root:Locator: obo:mondo
INFO:root:Ensuring gunzipped for https://s3.amazonaws.com/bbop-sqlite/mondo.db.gz
INFO:root:Locator, post-processed: sqlite:////home/harry/.data/oaklib/mondo.db
INFO:root:Normalizing: <generator object query_terms_iterator at 0x7f5b45f994a0>
ERROR:root:Skipping statements(subject=MONDO:0016830,predicate=skos:exactMatch,object=<https://omim.org/phenotypicSeries/PS310300>,value=None,datatype=None,language=None,); ValueError: <https://omim.org/phenotypicSeries/PS310300> is not a valid URI or CURIE
matentzn commented 6 months ago

If having these mappings correctly is critical for your work you can do we do in Mondo ingest pipeline, passing in a custom prefix file:

https://github.com/monarch-initiative/mondo-ingest/blob/e093456bdb193f609b71e3ba5ce7baab3834fcd5/src/ontology/mondo-ingest.Makefile#L34

Here is a related issue you could comment on to raise the urgency: https://github.com/INCATools/semantic-sql/issues/51

Here are two related PRs:

cmungall commented 6 months ago

This should be a WARN not ERROR. It's annoying but irrelevant for malco because you are not grounding on OMIM PS IDs

justaddcoffee commented 6 months ago

Great! Thanks @cmungall - just making sure this isn't going to affect our scoring