tf.contrib.lookup.TextFileStringTableInitializer
Stay organized with collections
Save and categorize content based on your preferences.
Table initializer for int64
IDs to string tables from a text file.
Inherits From: TextFileInitializer
tf.contrib.lookup.TextFileStringTableInitializer(
filename, key_column_index=TextFileIndex.LINE_NUMBER,
value_column_index=TextFileIndex.WHOLE_LINE, vocab_size=None, delimiter='\t',
name='text_file_string_table_init'
)
Args |
filename
|
The filename of the text file to be used for initialization. The
path must be accessible from wherever the graph is initialized (eg.
trainer or eval workers). The filename may be a scalar Tensor .
|
key_column_index
|
The column index from the text file to get the keys
from. The default is to use the line number, starting from zero.
|
value_column_index
|
The column index from the text file to get the values
from. The default is to use the whole line content.
|
vocab_size
|
The number of elements in the file, if known.
|
delimiter
|
The delimiter to separate fields in a line.
|
name
|
Optional name for the op.
|
Raises |
TypeError
|
when the filename is empty, or when the table key and value
data types do not match the expected data types.
|
Attributes |
key_dtype
|
The expected table key dtype.
|
value_dtype
|
The expected table value dtype.
|
Methods
initialize
View source
initialize(
table
)
Initializes the table from a text file.
Args |
table
|
The table to be initialized.
|
Returns |
The operation that initializes the table.
|
Raises |
TypeError
|
when the keys and values data types do not match the table
key and value data types.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.lookup.TextFileStringTableInitializer\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/lookup_ops.py#L678-L726) |\n\nTable initializer for `int64` IDs to string tables from a text file.\n\nInherits From: [`TextFileInitializer`](../../../tf/lookup/TextFileInitializer) \n\n tf.contrib.lookup.TextFileStringTableInitializer(\n filename, key_column_index=TextFileIndex.LINE_NUMBER,\n value_column_index=TextFileIndex.WHOLE_LINE, vocab_size=None, delimiter='\\t',\n name='text_file_string_table_init'\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `filename` | The filename of the text file to be used for initialization. The path must be accessible from wherever the graph is initialized (eg. trainer or eval workers). The filename may be a scalar `Tensor`. |\n| `key_column_index` | The column index from the text file to get the keys from. The default is to use the line number, starting from zero. |\n| `value_column_index` | The column index from the text file to get the values from. The default is to use the whole line content. |\n| `vocab_size` | The number of elements in the file, if known. |\n| `delimiter` | The delimiter to separate fields in a line. |\n| `name` | Optional name for the op. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|--------------------------------------------------------------------------------------------------------------|\n| `TypeError` | when the filename is empty, or when the table key and value data types do not match the expected data types. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|---------------|---------------------------------|\n| `key_dtype` | The expected table key dtype. |\n| `value_dtype` | The expected table value dtype. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `initialize`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/lookup_ops.py#L634-L660) \n\n initialize(\n table\n )\n\nInitializes the table from a text file.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------|------------------------------|\n| `table` | The table to be initialized. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| The operation that initializes the table. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|-------------|--------------------------------------------------------------------------------------|\n| `TypeError` | when the keys and values data types do not match the table key and value data types. |\n\n\u003cbr /\u003e"]]