public class Subword
extends java.lang.Object
Constructor and Description |
---|
Subword() |
Modifier and Type | Method and Description |
---|---|
static float[] |
getEmbeddingForOov(java.lang.String oov,
DenseMatrix denseMatrix)
Compute word embedding for out of vocabulary word.
|
public static float[] getEmbeddingForOov(java.lang.String oov, DenseMatrix denseMatrix)
oov
- out of vocabulary worddenseMatrix
- has to contain subword n-grams.oov
computed
as the sum of all n-gram embeddings.
In case no n-gram from the oov
word can be found in the
denseMatrix
the return array is all zeroes.