Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

The similarity metric returned literal integers 0 and 1 in edge cases, violating the declared float return type.

Changes

  • similarity.py: Changed return 0return 0.0 and return 1return 1.0
  • test_float_returns.py: Added type assertions for all metrics (Similarity, BLEU, CHRF) covering edge cases including None inputs

Example

from signwriting_evaluation.metrics.similarity import SignWritingSimilarityMetric

metric = SignWritingSimilarityMetric()
score = metric.score(None, None)

# Before: score = 0 (int)
# After:  score = 0.0 (float)
assert isinstance(score, float)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • huggingface.co
    • Triggering command: /usr/bin/python3 python3 -m pytest signwriting_evaluation/metrics/ -v (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Score can return integer values</issue_title>
<issue_description>In the similarity metric, we return an integer score (return 0)
https://github.com/sign-language-processing/signwriting-evaluation/blob/main/signwriting_evaluation/metrics/similarity.py#L153

make sure across all metrics, that all our returns are floats, and make a test for that</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix similarity metric to return float values Ensure all metric score methods return float, not int Dec 25, 2025
Copilot AI requested a review from AmitMY December 25, 2025 13:20
@AmitMY AmitMY marked this pull request as ready for review December 25, 2025 13:44
@AmitMY AmitMY merged commit f76634e into main Dec 25, 2025
2 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.

Score can return integer values

2 participants