toJson method

  1. @override
Object toJson()
override

Implementation

@override
Object toJson() => {
  if (pointwiseMetricSpec != null)
    'pointwiseMetricSpec': pointwiseMetricSpec!.toJson(),
  if (pairwiseMetricSpec != null)
    'pairwiseMetricSpec': pairwiseMetricSpec!.toJson(),
  if (exactMatchSpec != null) 'exactMatchSpec': exactMatchSpec!.toJson(),
  if (bleuSpec != null) 'bleuSpec': bleuSpec!.toJson(),
  if (rougeSpec != null) 'rougeSpec': rougeSpec!.toJson(),
  if (aggregationMetrics.isNotDefault)
    'aggregationMetrics': encodeList(aggregationMetrics),
};