Add ground_truth API and refactor

This commit is contained in:
Andras Schmelczer 2022-06-19 17:15:52 +02:00
commit 421f9bb726

View file

@ -1,12 +1,9 @@
from typing import Any, Optional, Union
from pydantic import BaseModel
from ..helper import HashableBaseModel
class ClassificationOutput(BaseModel):
class ClassificationOutput(HashableBaseModel):
label: Union[str, int]
confidence: float
explanation: Optional[Any]
def __hash__(self) -> int:
return hash((type(self),) + tuple(self.__dict__.values()))