def compute_metrics(self, labels, preds, **kwargs):
    '\n        Computes the evaluation metrics for the model predictions.\n\n        Args:\n            labels: List of target sequences\n            preds: List of model generated outputs\n            **kwargs: Custom metrics that should be used. Pass in the metrics as keyword arguments (name of metric: function to use).\n                        A metric function should take in two parameters. The first parameter will be the true labels, and the second parameter will be the predictions. Both inputs\n                        will be lists of strings. Note that this will slow down evaluation significantly as the predicted sequences need to be generated.\n\n        Returns:\n            result: Dictionary containing evaluation results.\n        '
    results = {}
    for (metric, func) in kwargs.items():
        results[metric] = func(labels, preds)
    return results
Computes the evaluation metrics for the model predictions.

Args:
    labels: List of target sequences
    preds: List of model generated outputs
    **kwargs: Custom metrics that should be used. Pass in the metrics as keyword arguments (name of metric: function to use).
                A metric function should take in two parameters. The first parameter will be the true labels, and the second parameter will be the predictions. Both inputs
                will be lists of strings. Note that this will slow down evaluation significantly as the predicted sequences need to be generated.

Returns:
    result: Dictionary containing evaluation results.
def compute_metrics(self, labels, preds, **kwargs):
    '\n        Computes the evaluation metrics for the model predictions.\n\n        Args:\n            labels: List of target sequences\n            preds: List of model generated outputs\n            **kwargs: Custom metrics that should be used. Pass in the metrics as keyword arguments (name of metric: function to use).\n                        A metric function should take in two parameters. The first parameter will be the true labels, and the second parameter will be the predictions. Both inputs\n                        will be lists of strings. Note that this will slow down evaluation significantly as the predicted sequences need to be generated.\n\n        Returns:\n            result: Dictionary containing evaluation results.\n        '
    results = {}
    for (metric, func) in kwargs.items():
        results[metric] = func(labels, preds)
    return results