| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Embedding<T> |
build()
Builds the
Embedding. |
Embedding.Builder<T> |
optDataType(DataType dataType)
Sets the data type of the embedding arrays (default is Float32).
|
Embedding.Builder<T> |
optUseDefault(boolean useDefault)
Sets whether to use a default embedding for undefined items (default true).
|
Embedding.Builder<T> |
setEmbeddingSize(int embeddingSize)
Sets the size of the embeddings.
|
Embedding.Builder<T> |
setItems(java.util.Collection<T> items)
Sets the collection of items that should feature embeddings.
|
public Embedding.Builder<T> setItems(java.util.Collection<T> items)
items - a collection containing all the items that embeddings should be created forpublic Embedding.Builder<T> setEmbeddingSize(int embeddingSize)
embeddingSize - the size of the 1D embedding arraypublic Embedding.Builder<T> optUseDefault(boolean useDefault)
useDefault - true to provide a default embedding and false to throw an IllegalArgumentException when the item can not be foundpublic Embedding.Builder<T> optDataType(DataType dataType)
dataType - the dataType to use for the embedding