|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.parser.lexparser.Options
public class Options
Options to the parser which MUST be the SAME at both training and testing (parsing) time in order for the parser to work properly.
Nested Class Summary | |
---|---|
static class |
Options.LexOptions
|
Field Summary | |
---|---|
boolean |
coarseDistance
Use coarser distance (4 bins) in dependency calculations |
boolean |
dcTags
"double count" tags rewrites as word in PCFG and Dep parser. |
boolean |
directional
Whether dependency grammar considers left/right direction. |
boolean |
distance
Use distance bins in the dependency calculations |
boolean |
doDep
Do a dependency parse of the sentence. |
boolean |
doPCFG
Do a PCFG parse of the sentence. |
boolean |
forceCNF
Forces parsing with strictly CNF grammar -- unary chains are converted to XP&YP symbols and back |
boolean |
freeDependencies
if true, any child can be the head (seems rather bad!) |
boolean |
genStop
|
Options.LexOptions |
lexOptions
|
boolean |
nodePrune
If true, inside the factored parser, remove any node from the final chosen tree which improves the PCFG score. |
int |
numStates
|
TreebankLangParserParams |
tlpParams
The treebank-specific parser parameters to use. |
Constructor Summary | |
---|---|
Options()
|
|
Options(TreebankLangParserParams tlpParams)
|
Method Summary | |
---|---|
void |
display()
|
TreebankLanguagePack |
langpack()
|
void |
readData(BufferedReader in)
Populates data in this Options from the character stream. |
int |
setOption(String[] flags,
int i)
Set an option based on a String array in the style of commandline flags. |
int |
setOptionOrWarn(String[] flags,
int i)
Set an option based on a String array in the style of commandline flags. |
void |
setOptions(String... flags)
Set options based on a String array in the style of commandline flags. |
void |
setOptions(String[] flags,
int startIndex,
int endIndexPlusOne)
Set options based on a String array in the style of commandline flags. |
void |
setOptionsOrWarn(String... flags)
Set options based on a String array in the style of commandline flags. |
void |
setOptionsOrWarn(String[] flags,
int startIndex,
int endIndexPlusOne)
Set options based on a String array in the style of commandline flags. |
void |
writeData(Writer w)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int numStates
public Options.LexOptions lexOptions
public TreebankLangParserParams tlpParams
public boolean forceCNF
public boolean doPCFG
public boolean doDep
public boolean freeDependencies
public boolean directional
public boolean genStop
public boolean distance
public boolean coarseDistance
public boolean dcTags
public boolean nodePrune
Constructor Detail |
---|
public Options()
public Options(TreebankLangParserParams tlpParams)
Method Detail |
---|
public void setOptions(String... flags)
setOption(java.lang.String[], int)
.
flags
- Array of options (or as a varargs list of arguments).
The options passed in should
be specified like command-line arguments, including with an initial
minus sign for example,
{"-outputFormat", "typedDependencies", "-maxLength", "70"}
IllegalArgumentException
- If an unknown flag is passed inpublic void setOptions(String[] flags, int startIndex, int endIndexPlusOne)
setOption(java.lang.String[], int)
.
flags
- Array of options. The options passed in should
be specified like command-line arguments, including with an initial
minus sign for example,
{"-outputFormat", "typedDependencies", "-maxLength", "70"}startIndex
- The index in the array to begin processing options atendIndexPlusOne
- A number one greater than the last array index at
which options should be processed
IllegalArgumentException
- If an unknown flag is passed inpublic void setOptionsOrWarn(String... flags)
setOption(java.lang.String[], int)
.
flags
- Array of options (or as a varargs list of arguments).
The options passed in should
be specified like command-line arguments, including with an initial
minus sign for example,
{"-outputFormat", "typedDependencies", "-maxLength", "70"}
IllegalArgumentException
- If an unknown flag is passed inpublic void setOptionsOrWarn(String[] flags, int startIndex, int endIndexPlusOne)
setOption(java.lang.String[], int)
.
flags
- Array of options. The options passed in should
be specified like command-line arguments, including with an initial
minus sign for example,
{"-outputFormat", "typedDependencies", "-maxLength", "70"}startIndex
- The index in the array to begin processing options atendIndexPlusOne
- A number one greater than the last array index at
which options should be processed
IllegalArgumentException
- If an unknown flag is passed inpublic int setOptionOrWarn(String[] flags, int i)
-maxLength n
set the maximum length sentence to parse (inclusively)
-printTT
print the training trees in raw, annotated, and annotated+binarized form. Useful for debugging and other miscellany.
-printAnnotated filename
use only in conjunction with -printTT. Redirects printing of annotated training trees to filename
.
-forceTags
when the parser is tested against a set of gold standard trees, use the tagged yield, instead of just the yield, as input.
flags
- An array of options arguments, command-line style. E.g. {"-maxLength", "50"}.i
- The index in flags to start at when processing an option
i+1
public int setOption(String[] flags, int i)
-maxLength n
set the maximum length sentence to parse (inclusively)
-printTT
print the training trees in raw, annotated, and annotated+binarized form. Useful for debugging and other miscellany.
-printAnnotated filename
use only in conjunction with -printTT. Redirects printing of annotated training trees to filename
.
-forceTags
when the parser is tested against a set of gold standard trees, use the tagged yield, instead of just the yield, as input.
flags
- An array of options arguments, command-line style. E.g. {"-maxLength", "50"}.i
- The index in flags to start at when processing an option
IllegalArgumentException
- If the current array position cannot be
processed as a valid optionpublic TreebankLanguagePack langpack()
public void display()
public void writeData(Writer w) throws IOException
IOException
public void readData(BufferedReader in) throws IOException
in
- The Reader
IOException
- If there is a problem reading data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |