@Operator public final class InitializeTableFromTextFile extends PrimitiveOp
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`.
Modifier and Type | Class and Description |
---|---|
static class |
InitializeTableFromTextFile.Options
Optional attributes for
InitializeTableFromTextFile |
operation
Modifier and Type | Method and Description |
---|---|
static InitializeTableFromTextFile |
create(Scope scope,
Operand<?> tableHandle,
Operand<String> filename,
Long keyIndex,
Long valueIndex,
InitializeTableFromTextFile.Options... options)
Factory method to create a class wrapping a new InitializeTableFromTextFile operation.
|
static InitializeTableFromTextFile.Options |
delimiter(String delimiter) |
static InitializeTableFromTextFile.Options |
vocabSize(Long vocabSize) |
equals, hashCode, op, toString
public static InitializeTableFromTextFile create(Scope scope, Operand<?> tableHandle, Operand<String> filename, Long keyIndex, Long valueIndex, InitializeTableFromTextFile.Options... options)
scope
- current scopetableHandle
- 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 valuespublic static InitializeTableFromTextFile.Options vocabSize(Long vocabSize)
vocabSize
- Number of elements of the file, use -1 if unknown.public static InitializeTableFromTextFile.Options delimiter(String delimiter)
delimiter
- Delimiter to separate fields in a line.Copyright © 2022. All rights reserved.