public class Word2VecGenerator extends Object implements VectorGenerator
Modifier and Type | Class and Description |
---|---|
static class |
Word2VecGenerator.Provider |
Constructor and Description |
---|
Word2VecGenerator(Language language,
LocalPageDao localPageDao,
File path) |
Modifier and Type | Method and Description |
---|---|
List<Explanation> |
getExplanations(int pageID1,
int pageID2,
gnu.trove.map.TIntFloatMap vector1,
gnu.trove.map.TIntFloatMap vector2,
SRResult result)
Adds the explanation for a particular SRResult if it is supported.
|
List<Explanation> |
getExplanations(String phrase1,
String phrase2,
gnu.trove.map.TIntFloatMap vector1,
gnu.trove.map.TIntFloatMap vector2,
SRResult result)
Adds the explanation for a particular SRResult if it is supported.
|
static File |
getModelFile(File dir,
Language lang) |
static File |
getModelFile(String dir,
Language lang) |
gnu.trove.map.TIntFloatMap |
getVector(int pageId)
Returns the feature vector associated with Wikipedia id.
|
gnu.trove.map.TIntFloatMap |
getVector(String phrase)
Returns the feature vector associated with the phrase
|
void |
read(File path) |
public Word2VecGenerator(Language language, LocalPageDao localPageDao, File path) throws IOException
IOException
public void read(File path) throws IOException
IOException
public gnu.trove.map.TIntFloatMap getVector(int pageId) throws DaoException
VectorGenerator
getVector
in interface VectorGenerator
DaoException
public gnu.trove.map.TIntFloatMap getVector(String phrase)
VectorGenerator
getVector
in interface VectorGenerator
public List<Explanation> getExplanations(String phrase1, String phrase2, gnu.trove.map.TIntFloatMap vector1, gnu.trove.map.TIntFloatMap vector2, SRResult result) throws DaoException
VectorGenerator
getExplanations
in interface VectorGenerator
phrase1
- First phrasephrase2
- Second phrasevector1
- Vector representing first itemvector2
- Vector representing second itemresult
- Original sr object, with explanations (hopefully) added.DaoException
public List<Explanation> getExplanations(int pageID1, int pageID2, gnu.trove.map.TIntFloatMap vector1, gnu.trove.map.TIntFloatMap vector2, SRResult result) throws DaoException
VectorGenerator
getExplanations
in interface VectorGenerator
pageID1
- First pagepageID2
- Second pagevector1
- Vector representing first itemvector2
- Vector representing second itemresult
- Original sr object, with explanations (hopefully) added.DaoException
Copyright © 2014. All rights reserved.