confia-demo / lib /data_entry.py
elsamueldev's picture
Upload 8 files
fe87150 verified
raw
history blame
371 Bytes
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
}