|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.util.DebugChart
public class DebugChart
A class to print to System.err
the constituents of a
gold-standard parse tree that were found by the parser, according to its
output chart file.
Field Summary | |
---|---|
static Filter |
allPass
|
static Filter |
onlyStopped
|
Method Summary | |
---|---|
static Set |
collectBest(CKYItem topRanked)
|
static void |
downcaseWords(HeadTreeNode tree)
|
static void |
downcaseWords(Sexp tree)
|
static void |
findConstituents(boolean downcaseWords,
Chart chart,
CKYItem topRankedItem,
SexpList sentence,
Sexp goldTree)
Prints out to System.err which constituents of the specified
gold-standard parse tree were found by the parser, according to the
specified chart. |
static void |
findConstituents(Chart chart,
Set best,
HeadTreeNode tree)
|
static void |
findConstituents(String prefix,
boolean downcaseWords,
Chart chart,
CKYItem topRankedItem,
SexpList sentence,
Sexp goldTree)
Prints out to System.err which constituents of the specified
gold-standard parse tree were found by the parser, according to the
specified chart. |
static void |
findConstituents(String prefix,
Chart chart,
Set best,
HeadTreeNode tree)
|
static void |
findConstituents(String chartFilename,
Sexp goldTree)
Prints out to System.err which constituents of the specified
gold-standard parse tree were found by the parser, according to its output
chart file. |
static String |
headTreeNodeToString(HeadTreeNode node)
Returns a string of the form [start,end,label<headWord>, <headChild>] where <headWord> is the head word and where <headChild> is either a string of the form [start,end,label] or null if the specified HeadTreeNode is a preterminal. |
static String |
itemToString(CKYItem item)
|
static String |
itemToString(CKYItem item,
Set best)
|
static void |
printBestDerivationStats(String prefix,
Chart chart,
int sentLen,
Symbol topSym,
double nonTopHighestLogProb,
CKYItem bestDerivationItem)
|
static void |
printDerivation(CKYItem item)
Prints the derivation rooted at the specified chart item to System.err. |
static void |
printDerivation(CKYItem item,
Filter filter)
|
static Sexp |
removeChildlessNodes(Sexp tree)
Removes interior nodes of the specified tree that are not preterminals and that have no children. |
static Sexp |
removePreterms(SexpList words,
Sexp tree,
int wordIdx)
Removes preterminals from the specified tree that are not found in the specified list of words. |
static void |
replaceWords(boolean downcaseWords,
Sexp tree,
SexpList sentence)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Filter allPass
public static Filter onlyStopped
Method Detail |
---|
public static void findConstituents(String chartFilename, Sexp goldTree)
System.err
which constituents of the specified
gold-standard parse tree were found by the parser, according to its output
chart file. The specified filename must point to a valid Java object file
that contains two objects: a Chart
object and a
SexpList
object (in that order), where the
SexpList
object is the list of the original words in the
parsed sentence (which is the original sentence, but with potentially
certain words removed after preprocessing). This method is intended to be
used for off-line debugging (i.e., after a parsing run during which chart
object files were created).
chartFilename
- the filename of a parser chart file, which is a Java
object file containing two serialized objects: a
Chart
object and a SexpList
objectgoldTree
- the gold-standard parse tree, as found in the original
combined file directory of the Penn Treebank,
except with its outer parentheses removedpublic static void findConstituents(boolean downcaseWords, Chart chart, CKYItem topRankedItem, SexpList sentence, Sexp goldTree)
System.err
which constituents of the specified
gold-standard parse tree were found by the parser, according to the
specified chart. This method is intended to be used for on-line parser
debugging (that is, debugging during a decoding run). The only functional
difference between this method and findConstituents(String,Sexp)
is that this method does not print out the original words of the sentence,
as that can be separately accomplished during decoding by setting
Decoder.debugInit
to true
.
chart
- the chart of the parser, after processing the sentence to
be analyzedgoldTree
- the gold-standard parse tree, as found in the original
combined directory of the Penn Treebank, except
with its outer parentheses removedpublic static void findConstituents(String prefix, boolean downcaseWords, Chart chart, CKYItem topRankedItem, SexpList sentence, Sexp goldTree)
System.err
which constituents of the specified
gold-standard parse tree were found by the parser, according to the
specified chart. This method is intended to be used for on-line parser
debugging (that is, debugging during a decoding run). The only functional
difference between this method and findConstituents(String,Sexp)
is that this method does not print out the original words of the sentence,
as that can be separately accomplished during decoding by setting
Decoder.debugInit
to true
.
prefix
- the prefix string to be output before other information on
lines that don't begin with a tab characterchart
- the chart of the parser, after processing the sentence to
be analyzedgoldTree
- the gold-standard parse tree, as found in the original
combined directory of the Penn Treebank, except
with its outer parentheses removedpublic static void replaceWords(boolean downcaseWords, Sexp tree, SexpList sentence)
public static void printBestDerivationStats(String prefix, Chart chart, int sentLen, Symbol topSym, double nonTopHighestLogProb, CKYItem bestDerivationItem)
public static void findConstituents(Chart chart, Set best, HeadTreeNode tree)
public static void findConstituents(String prefix, Chart chart, Set best, HeadTreeNode tree)
public static Set collectBest(CKYItem topRanked)
public static String headTreeNodeToString(HeadTreeNode node)
HeadTreeNode
is a preterminal.
public static String itemToString(CKYItem item, Set best)
public static String itemToString(CKYItem item)
public static void downcaseWords(Sexp tree)
public static void downcaseWords(HeadTreeNode tree)
public static Sexp removePreterms(SexpList words, Sexp tree, int wordIdx)
words
- the words of the sentence that was parsed (meaning that some
of the words of the original sentence may have been pruned)tree
- the parse tree whose preterminals are to match
words
wordIdx
- the threaded word index; to be 0 for all
non-recursive calls
public static Sexp removeChildlessNodes(Sexp tree)
tree
- the tree from which to remove childless interior nodes
public static void printDerivation(CKYItem item)
public static void printDerivation(CKYItem item, Filter filter)
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |