[go: nahoru, domu]

Skip to content

Commit

Permalink
Updating documentation:
Browse files Browse the repository at this point in the history
* Switching to using `RecordBatchToExamplesEncoder`
* Utilizing `tft.DatasetMetadata.from_feature_spec`

PiperOrigin-RevId: 523723569
  • Loading branch information
zoyahav authored and tfx-copybara committed Apr 12, 2023
1 parent 7875e9e commit 42197b2
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions docs/get_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,7 @@
"\n",
"The previous code examples used this format. The metadata contains the schema that defines the layout of the data and how it is read from and written to various formats. Even this in-memory format is not self-describing and requires the schema in order to be interpreted as tensors.\n",
"\n",
"Again, here is the definition of the schema for the example data:\n",
"\n",
"\u003c!--\n",
"TODO(b/223384488): Switch to `tft.DatasetMetadata.from_feature_spec` once\n",
"version 1.8 is released.\n",
"--\u003e"
"Again, here is the definition of the schema for the example data:"
]
},
{
Expand All @@ -438,15 +433,13 @@
},
"outputs": [],
"source": [
"from tensorflow_transform.tf_metadata import dataset_metadata\n",
"from tensorflow_transform.tf_metadata import schema_utils\n",
"import tensorflow_transform as tft\n",
"\n",
"raw_data_metadata = dataset_metadata.DatasetMetadata(\n",
" schema_utils.schema_from_feature_spec({\n",
"raw_data_metadata = tft.DatasetMetadata.from_feature_spec({\n",
" 's': tf.io.FixedLenFeature([], tf.string),\n",
" 'y': tf.io.FixedLenFeature([], tf.float32),\n",
" 'x': tf.io.FixedLenFeature([], tf.float32),\n",
" }))"
" })"
]
},
{
Expand Down

0 comments on commit 42197b2

Please sign in to comment.