File size: 355 Bytes
cdf268e 6c92442 cdf268e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
from abc import ABC, abstractmethod
from typing import Dict, List
class BaseTaskMetrics(ABC):
def reset(self):
pass
@abstractmethod
def add_batch(self, predictions: List[str], references: List[str], *args, **kwargs) -> None:
pass
@abstractmethod
def compute(self, *args, **kwargs) -> Dict[str, float]:
pass
|