public class HALMain extends GenericMain
HyperspaceAnalogueToLanguage
(HAL)
from the command line. This class takes in several command line arguments.
-d
, --docFile=FILE[,FILE...]
a file where each line is
a document. This is the preferred input format for large corpora
-f
, --fileList=FILE[,FILE...]
a list of document files
where each file is specified on its own line.
-s
, --windowSize=INT
how many words to consider in each
direction
-r
, --retain=INT
how many column dimensions to retain
in the final word co-occurrence matrix. The retained columns will be
those that provide the most information for distinguishing the
semantics of the words. Unlike the --threshold
option, this
specifies a hard limit for how many to retain. This option may not
speciefied at the same time as --threshold
-h
, --threshold=DOUBLE
the minimum information
theoretic entropy a word must have to be retained in the final word
co-occurrence matrix. This option may not be used at the same time as
--retain
.
-W
, --weighting=CLASS
the fully qualified name of a
WeightingFunction
class to be used for
weighting co-occurrences. HAL traditionally uses a linear weighting
where the closest neighboring words receive the highest weight.
-F
, --tokenFilter=FILE[include|exclude][,FILE...]
specifies a list of one or more files to use for filtering
the documents. An option
flag may be added to each file to specify how the words in the filter
filter should be used: include
if only the words in the filter
file should be retained in the document; exclude
if only the
words not in the filter file should be retained in the
document.
-o
, --outputFormat=
text|binary} Specifies the
output formatting to use when generating the semantic space (.sspace
) file. See SemanticSpaceUtils
for format details.
-t
, --threads=INT
how many threads to use when
processing the documents. The default is one per core.
-w
, --overwrite=BOOL
specifies whether to overwrite
the existing output files. The default is true
. If set to
false
, a unique integer is inserted into the file name.
-v
, --verbose
specifies whether to print runtime
information to standard out
An invocation will produce one file as output hal-semantic-space.sspace
. If overwrite
was set to true
,
this file will be replaced for each new semantic space. Otherwise, a new
output file of the format hal-semantic-space<number>.sspace
will be
created, where <number>
is a unique identifier for that program's
invocation. The output file will be placed in the directory specified on the
command line.
This class is desgined to run multi-threaded and performs well with one thread per core, which is the default setting.
HyperspaceAnalogueToLanguage
argOptions, EXT, isMultiThreaded, verbose
Modifier and Type | Method and Description |
---|---|
protected void |
addExtraOptions(ArgOptions options)
Adds options to the provided
ArgOptions instance, which will be
used to parse the command line. |
protected String |
getAlgorithmSpecifics()
Returns a string describing algorithm-specific options and behaviods.
|
protected SemanticSpace |
getSpace()
Returns the
SemanticSpace that will be used for processing. |
protected SemanticSpaceIO.SSpaceFormat |
getSpaceFormat()
Returns the
format in which the
finished SemanticSpace should be saved. |
static void |
main(String[] args) |
protected Properties |
setupProperties()
Returns the
Properties object that will be used when calling
SemanticSpace.processSpace(Properties) . |
addCorpusReaderIterators, addDocIterators, addFileIterators, getDocumentIterator, handleExtraOptions, loadValidTermSet, parseDocumentsMultiThreaded, parseDocumentsSingleThreaded, postProcessing, processDocumentsAndSpace, run, saveSSpace, setupOptions, usage, verbose, verbose
protected void addExtraOptions(ArgOptions options)
ArgOptions
instance, which will be
used to parse the command line. This method allows subclasses the
ability to add extra command line options.addExtraOptions
in class GenericMain
options
- the ArgOptions object which more main specific options can
be added to.GenericMain.handleExtraOptions()
public static void main(String[] args)
protected SemanticSpaceIO.SSpaceFormat getSpaceFormat()
format
in which the
finished SemanticSpace
should be saved. Subclasses should
override this function if they want to specify a specific format that is
most suited for their space, when one is not manually specified by the
user.getSpaceFormat
in class GenericMain
protected SemanticSpace getSpace()
SemanticSpace
that will be used for processing. This
method is guaranteed to be called after the command line arguments have
been parsed, so the contents of GenericMain.argOptions
are valid.getSpace
in class GenericMain
protected Properties setupProperties()
Properties
object that will be used when calling
SemanticSpace.processSpace(Properties)
. Subclasses should
override this method if they need to specify additional properties for
the space. This method will be called once before GenericMain.getSpace()
.setupProperties
in class GenericMain
Properties
used for processing the semantic space.protected String getAlgorithmSpecifics()
getAlgorithmSpecifics
in class GenericMain
Copyright © 2012. All Rights Reserved.