EDIT: This issue is currently represents two separate topics:
- Change
list[(name, Thing)] data structure to dict[name, Thing] if the name is the primary key.
- Discussion to directly represent all configs by
Metric itself.
Original proposal:
Metric is instantiated by appropriate MetricConfig. This strategy is used only in Metric and any other classes are instantiated by directly calling __init__ with specific arguments. This special architecture around Metric actually causes some confusion (e.g., #455).
This separation also requires explicit circular dependency: Metric holds MetricConfig, while MetricConfig knows corresponding Metric (in to_metric). This is somewhat annoying because it always lets us to refactor both concepts at the same time.
As long as I checked the all subclasses of Metric, there is no heavy implementation: they simply hold configs without any special initialization processes. It looks we have no any reason to separate MetricConfig from Metric at interface level. Integrating them into the Metric could simplify the architecture.
RFC: @neubig @pfliu-nlp @tetsuok