InitializeTableFromTextFile

public final class InitializeTableFromTextFile

Initializes a table from a text file.

It inserts one key-value pair into the table for each line of the file. The key and value is extracted from the whole line content, elements from the split line based on `delimiter` or the line number (starting from zero). Where to extract the key and value from a line is specified by `key_index` and `value_index`.

- A value of -1 means use the line number(starting from zero), expects `int64`. - A value of -2 means use the whole line content, expects `string`. - A value >= 0 means use the index (starting at zero) of the split line based on `delimiter`.

Nested Classes

Public Methods

static InitializeTableFromTextFile
create(Scope scope, Operand<?> tableHandle, Operand<String> filename, Long keyIndex, Long valueIndex, Options... options)
Factory method to create a class wrapping a new InitializeTableFromTextFile operation.
static InitializeTableFromTextFile.Options
delimiter(String delimiter)
static InitializeTableFromTextFile.Options
offset(Long offset)
static InitializeTableFromTextFile.Options
vocabSize(Long vocabSize)

Inherited Methods

org.tensorflow.op.PrimitiveOp
final boolean
equals(Object obj)
final int
Operation
op()
Returns the underlying Operation
final String
boolean
equals(Object arg0)
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()

Public Methods

public static InitializeTableFromTextFile create (Scope scope, Operand<?> tableHandle, Operand<String> filename, Long keyIndex, Long valueIndex, Options... options)

Factory method to create a class wrapping a new InitializeTableFromTextFile operation.

Parameters
scope current scope
tableHandle Handle to a table which will be initialized.
filename Filename of a vocabulary text file.
keyIndex Column index in a line to get the table `key` values from.
valueIndex Column index that represents information of a line to get the table `value` values from.
options carries optional attributes values
Returns
  • a new instance of InitializeTableFromTextFile

public static InitializeTableFromTextFile.Options delimiter (String delimiter)

Parameters
delimiter Delimiter to separate fields in a line.

public static InitializeTableFromTextFile.Options offset (Long offset)

public static InitializeTableFromTextFile.Options vocabSize (Long vocabSize)

Parameters
vocabSize Number of elements of the file, use -1 if unknown.