Feature/basic score - #14
Conversation
Also move custom function types to span_utils
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #14 +/- ##
===========================================
- Coverage 100.00% 99.30% -0.70%
===========================================
Files 7 11 +4
Lines 545 1159 +614
Branches 36 77 +41
===========================================
+ Hits 545 1151 +606
- Misses 0 4 +4
- Partials 0 4 +4 🚀 New features to boost your workflow:
|
rlskoeser
left a comment
There was a problem hiding this comment.
I've reviewed and made a few comments and small suggestions, but this looks solid to me. I was also able to run the scripts with the parameters you provided and get the expected output.
does spanerr look ready for an alpha release?
It looks great - the only major missing item I see is that you need a readme to provide some context and instructions for installation basic usage.
| exclusive: bool | None = None, | ||
| ) -> AlignSpans: | ||
| """ | ||
| Construct a span alignment method (AlignSpans) using a given alignment strategy |
There was a problem hiding this comment.
Somewhere (probably not here) it would be helpful to have a note explaining why the lambda approach - once I finished reading through the function I saw how many variations there are, which I presume is the motivation. It would be helpful to have that explained at a higher level first - maybe a file- level docstring? (Or maybe a design doc if you add some version of that to the code)
There was a problem hiding this comment.
Good idea. I'll open an issue for tracking this.
| relevance = scorer(a) | ||
| # Compute and accumulate precision and recall | ||
| doc_precision = precision(len(a.sys.spans), relevance) | ||
| doc_recall = recall(len(a.ref.spans), relevance) | ||
| doc_fscore = f_beta(beta, doc_precision, doc_recall) |
Thanks for the reminder about the README! |
Co-authored-by: Rebecca Sutton Koeser <rlskoeser@users.noreply.github.com>
Co-authored-by: Rebecca Sutton Koeser <rlskoeser@users.noreply.github.com>
Co-authored-by: Rebecca Sutton Koeser <rlskoeser@users.noreply.github.com>
Associated Issue(s): resolves #10, #11, #12, #13
Changes in this PR
Include all key changes in this pull request
spans/matchtospan_utilsspan_utilsignore_labelfunctionality from span utility methodsSpanAlignments(eval)construct_alignerfor building a span alignment method_spansfield to atuple)ref.jsonlandsys.jsonlto make local testing easier (tests/test_data)compute_metricsscript for computing document- and entity-level evaluation metrics (precision, recall, F1) for two span annotations JSONL files.Notes
spanerrlook ready for an alpha release?Notes for Testing
Case 1. Entity-level metrics with "select_first" alignment & "overlap_factor" scoring
Command:
Final Output
Case 2. Document-level metrics with "corppa" alignment & "jaccard" scoring
Command:
Final Output
Reviewer Checklist
compute_metricsscript locally with expected output (see Notes for Testing)