public class Beagle extends Object implements SemanticSpace
Jones, M. N., Mewhort, D. J.L. (2007). Representing Word Meaning and Order Information in a Composite Holographic Lexicon. Psychological Review 114, 1-37. Available here
For every word, a unique random index vector is created, where the vector has some large dimension (by default 512), with each entry in the vector being from a random gaussian distribution. The holographic meaning of a word is updated by first adding the sum of index vectors for all the words in a sliding window centered around the target term. Additionally a sum of convolutions of several n-grams is added to the holographic meaning. The main functionality of this class can be found in theIndexBuilder
class.Modifier and Type | Class and Description |
---|---|
static class |
Beagle.SemanticType |
Modifier and Type | Field and Description |
---|---|
static String |
BEAGLE_SSPACE_NAME
The Semantic Space name for Beagle
|
static int |
CONTEXT_SIZE
The full context size used when scanning the corpus.
|
Constructor and Description |
---|
Beagle(int vectorSize,
Beagle.SemanticType semanticType,
Map<String,DoubleVector> vectorMap) |
Beagle(int vectorSize,
Map<String,DoubleVector> vectorMap) |
Modifier and Type | Method and Description |
---|---|
String |
getSpaceName()
Returns a unique string describing the name and configuration of this
algorithm.
|
DoubleVector |
getVector(String term)
Returns the semantic vector for the provided word.
|
int |
getVectorLength()
Returns the length of vectors in this semantic space.
|
Set<String> |
getWords()
Returns the set of words that are represented in this semantic space.
|
void |
processDocument(BufferedReader document)
Processes the contents of the provided file as a document.
|
void |
processSpace(Properties properties)
No processing is performed on the holographs.
|
public static final int CONTEXT_SIZE
public static final String BEAGLE_SSPACE_NAME
public Beagle(int vectorSize, Map<String,DoubleVector> vectorMap)
public Beagle(int vectorSize, Beagle.SemanticType semanticType, Map<String,DoubleVector> vectorMap)
public Set<String> getWords()
getWords
in interface SemanticSpace
public DoubleVector getVector(String term)
getVector
in interface SemanticSpace
term
- a word that may be in the semantic spaceVector
for the provided word or null
if the
word was not in the space.public String getSpaceName()
getSpaceName
in interface SemanticSpace
public int getVectorLength()
processSpace
is called.getVectorLength
in interface SemanticSpace
public void processDocument(BufferedReader document) throws IOException
processDocument
in interface SemanticSpace
document
- a reader that allows access to the text of the documentIOException
- if any error occurs while reading the documentpublic void processSpace(Properties properties)
processSpace
in interface SemanticSpace
properties
- a set of properties and values that may be used to
configure any exposed parameters of the algorithm.Copyright © 2012. All Rights Reserved.