flipz357 / smatchpp

A package for handy processing of semantic graphs such as AMR, with a special focus on standardized evaluation
GNU General Public License v3.0
19 stars 2 forks source link

Scoring examples in Python #3

Closed BramVanroy closed 1 year ago

BramVanroy commented 1 year ago

Thanks for this library!

It would be great if the API had some easy access point for scoring in Python, like

That should make it easier to use the library during machine learning experiments, for instance. It is currently not clear how that can be done.

There are some Python examples here but for someone who does not know the implementation details it is hard to know what to use. In other words, how can I do the same commands as written here but directly in Python and not with files but with in-memory objects (lists of penmans)?

Thanks

flipz357 commented 1 year ago

Great suggestion. Examples of how to do what you're interested in are now, since commit 7d0d642, in Example I and for optimal matching in Example II.

The functions you mentioned are accessible as

measure.score_pair

and

measure.score_corpus

It seems that only the first is described currently in the README, I will add some information on how to score corpus, too, so leaving this open.

BramVanroy commented 1 year ago

Thank you, that looks great! Looking forward to using it from a new PyPi release.

flipz357 commented 1 year ago

Description on pair matching/scoring is now in Examples I, II and III. Description for corpus scoring like in score.sh but from python interface is in Example IV.

[edit: fix format]

BramVanroy commented 1 year ago

This looks exactly like what I need. Thank you so much! Feel free to close this topic.