Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AGE-474] JSON diff evaluator not working expectedly #1942

Closed
mmabrouk opened this issue Jul 28, 2024 · 2 comments
Closed

[AGE-474] JSON diff evaluator not working expectedly #1942

mmabrouk opened this issue Jul 28, 2024 · 2 comments
Assignees
Labels
Backend bug Something isn't working High Priority
Milestone

Comments

@mmabrouk
Copy link
Member

I have configured a JSON diff evaluator using the default values:

# Post submitted by FE at creation of evalutor
{
    "id": "0190fb1e-8d2e-716a-8e74-32bd5e61c570",
    "name": "new2",
    "evaluator_key": "auto_json_diff",
    "settings_values": {
        "predict_keys": false,
        "correct_answer_key": "correct_answer",
        "compare_schema_only": false,
        "case_insensitive_keys": false
    },
    "created_at": "2024-07-28 20:53:21.838663+00:00",
    "updated_at": "2024-07-28 20:53:21.838668+00:00"
}

My ground truth looks like:

{
  "CCI_edits": ["CCI 1", "CCI 3"],
  "E_M": "99214",
  "HCC": ["HCC19", "HCC59"],
  "ICD_10": ["I10", "E11.9", "Z87.891"],
  "CPT_HCPCS": ["99213", "96372", "85610", "84443"]
}

And the prediction

{
  "CCI_edits": [],
  "E_M": "99214",
  "HCC": ["HCC3", "HCC19"],
  "ICD_10": ["J45.909", "E11.9", "I10", "Z79.84"],
  "CPT_HCPCS": ["99214", "94640", "99213", "85018"]
}

Yet, the computation of the evaluator fails due to division by 0 (no keys!)

 Traceback (most recent call last): File "/app/agenta_backend/services/evaluators_service.py", line 593, in auto_json_diff average_score = compare_jsons( File "/app/agenta_backend/services/evaluators_service.py", line 579, in compare_jsons average_score = cumulated_score / no_of_keys ZeroDivisionError: float division by zero

From SyncLinear.com | AGE-474

@mmabrouk mmabrouk added Backend bug Something isn't working High Priority labels Jul 28, 2024
@mmabrouk mmabrouk added this to the v.56 milestone Jul 28, 2024
@AnanyaP-WDW
Copy link

Hi @mmabrouk. I'd like to work on this. Can you share more details?
I'm trying to replicate the issue here with settings_values = {}.
I don't understand why there would be a ZeroDivisionError when there exists a ground truth json with valid keys?

@mmabrouk mmabrouk self-assigned this Aug 13, 2024
@mmabrouk mmabrouk modified the milestones: v.56, v.57 Aug 13, 2024
@mmabrouk mmabrouk modified the milestones: v.57, v.58 Aug 27, 2024
@mmabrouk mmabrouk modified the milestones: v.58, v.59 Sep 10, 2024
@mmabrouk mmabrouk removed this from the v.59 milestone Sep 19, 2024
@mmabrouk
Copy link
Member Author

Fixed

@mmabrouk mmabrouk added this to the v.61 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend bug Something isn't working High Priority
Projects
None yet
Development

No branches or pull requests

2 participants