from dataclasses import dataclass from lib.result import Result @dataclass(frozen=True, slots=True) class DataEntry: text: str result: Result def to_dict(self) -> dict[str, str | float | bool]: return { "text": self.text, "is_phishing": self.result.is_phishing(), "percentage": self.result.percentage }