hezar.models.model_outputs module¶
Define all model outputs here
- class hezar.models.model_outputs.Image2TextOutput(text: str | None = None, score: str | None = None)[source]¶
Bases:
ModelOutput
- score: str | None = None¶
- text: str | None = None¶
- class hezar.models.model_outputs.MaskFillingOutput(token: int | None = None, sequence: str | None = None, token_id: str | None = None, score: float | None = None)[source]¶
Bases:
ModelOutput
- score: float | None = None¶
- sequence: str | None = None¶
- token: int | None = None¶
- token_id: str | None = None¶
- class hezar.models.model_outputs.ModelOutput[source]¶
Bases:
object
Base class for all models’ prediction outputs (model.predict()/model.post_process() outputs).
Note that prediction outputs must all be a list of ModelOutput objects since we consider only batch inferences.
The helper functions in the class enable it to be treated as a mapping or a dict object.
- class hezar.models.model_outputs.SequenceLabelingOutput(token: List[List[str]] | None = None, label: List[List[str]] | None = None, start: int | None = None, end: int | None = None, score: List[List[float]] | None = None)[source]¶
Bases:
ModelOutput
- end: int | None = None¶
- label: List[List[str]] | None = None¶
- score: List[List[float]] | None = None¶
- start: int | None = None¶
- token: List[List[str]] | None = None¶
- class hezar.models.model_outputs.SpeechRecognitionOutput(text: str | None = None, chunks: List[Dict] | None = None)[source]¶
Bases:
ModelOutput
- chunks: List[Dict] | None = None¶
- text: str | None = None¶
- class hezar.models.model_outputs.TextClassificationOutput(label: str | None = None, score: float | None = None)[source]¶
Bases:
ModelOutput
- label: str | None = None¶
- score: float | None = None¶
- class hezar.models.model_outputs.TextDetectionOutput(boxes: list[int] = None)[source]¶
Bases:
ModelOutput
- boxes: list[int] = None¶
- class hezar.models.model_outputs.TextGenerationOutput(text: str | None = None)[source]¶
Bases:
ModelOutput
- text: str | None = None¶