public class BinaryVectorizer extends Object implements Vectorizer
Vectorizer
for a binary file. Initialize with load(File)
.BinaryWordVectorUtils
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String aWord)
True if the token is known by the vectorizer.
|
int |
dimensions()
The dimensionality of the embeddings
|
boolean |
isCaseless() |
static BinaryVectorizer |
load(File f)
Load a binary embeddings file and return a new
BinaryVectorizer object. |
int |
size()
The total number of known tokens.
|
float[] |
unknownVector()
The vector for unknown tokens.
|
float[] |
vectorize(String aWord)
Get the vector for a token.
|
public static BinaryVectorizer load(File f) throws IOException
BinaryVectorizer
object.f
- a File
BinaryVectorizer
IOException
- if an I/O error occurspublic float[] vectorize(String aWord) throws IOException
Vectorizer
Vectorizer.unknownVector()
.vectorize
in interface Vectorizer
aWord
- a token StringIOException
- if there was an error accessing the vector file.public boolean contains(String aWord)
Vectorizer
contains
in interface Vectorizer
aWord
- a token Stringpublic float[] unknownVector()
Vectorizer
unknownVector
in interface Vectorizer
public int dimensions()
Vectorizer
dimensions
in interface Vectorizer
public int size()
Vectorizer
size
in interface Vectorizer
public boolean isCaseless()
isCaseless
in interface Vectorizer
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.