# tf.contrib.lookup.TextFileStringTableInitializer

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/lookup_ops.py#L678-L726) |

Table initializer for `int64` IDs to string tables from a text file.

Inherits From: [`TextFileInitializer`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/lookup/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'
    )

<br />

<br />

<br />

| ## 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. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | when the filename is empty, or when the table key and value data types do not match the expected data types. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `key_dtype` | The expected table key dtype. |
| `value_dtype` | The expected table value dtype. |

<br />

## Methods

### `initialize`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/lookup_ops.py#L634-L660)

    initialize(
        table
    )

Initializes the table from a text file.

<br />

<br />

<br />

| Args ||
|---|---|
| `table` | The table to be initialized. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| The operation that initializes the table. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `TypeError` | when the keys and values data types do not match the table key and value data types. |

<br />