🌈 Types#
- class text_machina.src.types.DetectionLabels(value)[source]#
Bases:
Enum
Labels for detection tasks.
- class text_machina.src.types.LabeledSpan(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'end': FieldInfo(annotation=int, required=True), 'label': FieldInfo(annotation=str, required=True), 'start': FieldInfo(annotation=int, required=True, metadata=[Ge(ge=0)])}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class text_machina.src.types.Placeholders(value)[source]#
Bases:
Enum
Placeholders to be used across TextMachina.
- class text_machina.src.types.Prompt(**data)[source]#
Bases:
BaseModel
Wrapper for a prompt.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'extractor': FieldInfo(annotation=str, required=True), 'template': FieldInfo(annotation=str, required=True)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class text_machina.src.types.PromptedDataset(**data)[source]#
Bases:
BaseModel
Wrapper for a prompted dataset used to generate MGT texts.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'human_texts': FieldInfo(annotation=List[str], required=True), 'prompted_texts': FieldInfo(annotation=List[str], required=True)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.