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

Metrics with different analysis levels have the same name #530

Closed
qjiang002 opened this issue Oct 4, 2022 · 5 comments · Fixed by #534
Closed

Metrics with different analysis levels have the same name #530

qjiang002 opened this issue Oct 4, 2022 · 5 comments · Fixed by #534

Comments

@qjiang002
Copy link
Collaborator

Some tasks may use the same metric on different analysis levels. Although they metric functions at different levels are different, they share the same name, and this leads to the same metric names in the report's overall performance. Such tasks are NER and argument pair extraction (APE).

This may cause problem in sorting the systems using the metric score. When changing list[(name, thing)] to dict[name]=thing, analysis levels should be one level above metric name in issue #491 .

NER default metrics

defaults: dict[str, dict[str, MetricConfig]] = {
    "example": {
        "F1": SeqF1ScoreConfig(
            source_language=source_language,
            target_language=target_language,
            tag_schema="bio",
        )
    },
    "span": {
        "F1": F1ScoreConfig(
            source_language=source_language,
            target_language=target_language,
            ignore_classes=[cls._DEFAULT_TAG],
        )
    },
}

NER analysis report

  "results": {
    "overall": [
      {
        "F1": {
          "value": 0.9221652220060144,
          "confidence_score_low": null,
          "confidence_score_high": null,
          "auxiliary_result": null
        }
      },
      {
        "F1": {
          "value": 0.9221652220060145,
          "confidence_score_low": null,
          "confidence_score_high": null,
          "auxiliary_result": null
        }
      }
    ]
}

APE default metrics

defaults: dict[str, dict[str, MetricConfig]] = {
    'example': {
        "F1": APEF1ScoreConfig(
            source_language=source_language,
            target_language=target_language,
        )
    },
    'block': {
        "F1": F1ScoreConfig(
            source_language=source_language,
            target_language=target_language,
            ignore_classes=[cls._DEFAULT_TAG],
        )
    },
}

APE analysis report

  "results": {
    "overall": [
      {
        "F1": {
          "value": 0.25625192960790366,
          "confidence_score_low": null,
          "confidence_score_high": null,
          "auxiliary_result": null
        }
      },
      {
        "F1": {
          "value": 0.25625192960790366,
          "confidence_score_low": null,
          "confidence_score_high": null,
          "auxiliary_result": null
        }
      }
    ]
}
@odashi
Copy link
Contributor

odashi commented Oct 6, 2022

This was actually a potential problem revealed by recent changes, which is caused by the fact that the final report does not have explicit information of mappings between analysis levels and performances.

I think it would be essentially better to give a unique name for every metric:

default_metric_configs: dict[str, MetricConfig] = {
    "example_foo": FooConfig(...),
    "block_foo": FooConfig(...),
}

And then a specific analysis level name is used to choose a set of metrics:

level_to_metrics: dict[str, list[str]] = {
    "example": ["example_foo", ...],
    "block": ["block_foo", ...],
}

return {k: default_metric_configs[k] for k in level_to_metrics[level]}

@odashi
Copy link
Contributor

odashi commented Oct 6, 2022

Anyway, I will fix this by changing Result.overall to a dict.

@odashi
Copy link
Contributor

odashi commented Oct 6, 2022

I found that some meta-analysis code is unable to be fixed quickly. Since it heavily relies on the order of the original list.
I think meta_analyses directory is not tested appropriately at all and it doesn't work for now.

@odashi
Copy link
Contributor

odashi commented Oct 6, 2022

@neubig

@odashi
Copy link
Contributor

odashi commented Oct 6, 2022

I proposed #534, which doesn't include fixes for meta_analysis.

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 a pull request may close this issue.

2 participants