deepr.layers.LookupIndexToString

class deepr.layers.LookupIndexToString(table_name, path=None, vocab_size=None, default_value='UNK', reuse=False, **kwargs)[source]

Lookup Index To String.

Creates a table at runtime from a mapping file. The table will map each key to its corresponding line index as an tf.int64.

default_value

Default Value for missing keys

Type:

Any

path

Path to mapping file

Type:

str

reuse

If True, reuse the table with the same name

Type:

bool

table_name

Name of the HashTable

Type:

str

vocab_size

Size of the vocab

Type:

int

__init__(table_name, path=None, vocab_size=None, default_value='UNK', reuse=False, **kwargs)[source]

Methods

__init__(table_name[, path, vocab_size, ...])

forward(tensors[, mode])

Forward method of the layer

forward_as_dict(tensors[, mode])

Forward method on a dictionary of Tensors.