Skip to content

Fix resource leaks, typo, Hearst pattern, and scorer span pairing#606

Open
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/resource-leaks-and-hearst-pattern
Open

Fix resource leaks, typo, Hearst pattern, and scorer span pairing#606
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/resource-leaks-and-hearst-pattern

Conversation

@Chessing234

Copy link
Copy Markdown

Summary

  • Close unclosed file handles in read_full_med_mentions(), read_ner_from_tsv(), and evaluate_ner() using context managers
  • Fix typo constuctorconstructor in CandidateGenerator error message
  • Fix which_look_like Hearst pattern to use hypernym instead of hyponym at the end of the pattern
  • Fix PerClassScorer span pairing bug caused by zipping a set with a list

Issues addressed

Fixes #597, #599, #601, #595, #592

Test plan

  • Run pytest tests/test_data_util.py tests/test_per_class_scorer.py
  • Verify Hearst pattern matching for phrases like "cells which look like fibroblasts"

Made with Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: unclosed file handle in evaluate_ner() when dumping metrics

1 participant