Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

rename MetaInput to RawString #428

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pytext/data/tensorizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def tensorize(self, batch):
return pad_and_tensorize(batch, dtype=torch.float)


class MetaInput(Tensorizer):
class RawString(Tensorizer):
"""A pass-through tensorizer to include raw fields from datasource in the batch.
Used mostly for metric reporting."""

Expand All @@ -358,7 +358,7 @@ def numberize(self, row):
return row[self.column]


class JsonMetaInput(MetaInput):
class RawJson(RawString):
def numberize(self, row):
return json.loads(row[self.column])

Expand Down
4 changes: 2 additions & 2 deletions pytext/models/doc_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from pytext.config.field_config import WordFeatConfig
from pytext.data.tensorizers import (
LabelTensorizer,
MetaInput,
NumericLabelTensorizer,
RawString,
Tensorizer,
TokenTensorizer,
)
Expand Down Expand Up @@ -59,7 +59,7 @@ class ModelInput(Model.Config.ModelInput):
tokens: TokenTensorizer.Config = TokenTensorizer.Config()
labels: LabelTensorizer.Config = LabelTensorizer.Config(allow_unknown=True)
# for metric reporter
raw_text: MetaInput.Config = MetaInput.Config(column="text")
raw_text: RawString.Config = RawString.Config(column="text")

inputs: ModelInput = ModelInput()
embedding: WordEmbedding.Config = WordEmbedding.Config()
Expand Down