Skip to content

Conversation

@jackboyla
Copy link
Contributor

Related Issues

Proposed Changes:

Added assertions for result indices logic in all tests of test_strategies.py, e.g

    def test_wrong_boundary(self, base_sequence):
        """Test case: Entity with wrong boundary."""
        true = create_entities_from_bio(base_sequence)
        pred = create_entities_from_bio(["O", "B-PER", "I-PER", "O", "O", "O", "B-LOC", "O"])

        evaluator = StrictEvaluation()
        result, result_indices = evaluator.evaluate(true, pred, ["PER", "ORG", "LOC"])

        assert result.correct == 1
        assert result.incorrect == 1
        assert result.partial == 0
        assert result.missed == 0
        assert result.spurious == 0
        # NEW ⬇️
        assert result_indices.correct_indices == [(0, 0)]
        assert result_indices.incorrect_indices == [(0, 1)]
        assert result_indices.partial_indices == []
        assert result_indices.missed_indices == []
        assert result_indices.spurious_indices == []

How did you test it?

It's all tested in test_strategies.py

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes ✅
  • I added unit tests and updated the docstrings ✅
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes. ✅
  • I documented my code ✅
  • I ran pre-commit hooks and fixed any issue ✅

@davidsbatista
Copy link
Collaborator

Hi @jackboyla!

Thanks for completing this 👍🏽 - I released 0.3.1 recently which has warning that somethings will change, I plan to release 1.0.0 soon containing this big refactoring I did.

@davidsbatista davidsbatista merged commit 0efdd41 into MantisAI:main Jun 8, 2025
3 checks passed
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.

2 participants