|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.tagger.maxent.TestSentence
public class TestSentence
Field Summary | |
---|---|
static int[] |
hPos
|
static boolean[] |
isTag
|
int |
mikeKnown
|
int |
numRight
|
int |
numWrong
|
static LambdaSolve |
prob
|
Constructor Summary | |
---|---|
TestSentence()
|
|
TestSentence(LambdaSolve prob,
java.lang.String s)
|
|
TestSentence(LambdaSolve prob,
java.lang.String[] s,
java.lang.String[] correctTags,
PrintFile pf,
Dictionary wrongWords)
|
|
TestSentence(LambdaSolve prob,
java.lang.String[] s,
java.lang.String[] tags,
java.lang.String[] correctTags,
PrintFile pf,
Dictionary wrongWords)
|
|
TestSentence(LambdaSolve prob,
java.lang.String s,
PrintFile pf)
|
Method Summary | |
---|---|
void |
addUnknown(Dictionary uDict)
This method should be called after the sentence has been tagged. |
java.lang.String[] |
append(java.lang.String[] tags,
java.lang.String word)
|
java.lang.String[] |
appendOld(java.lang.String[] tags,
java.lang.String word)
Deterministically adds other possible tags for words given observed tags. |
void |
dumpActivations(java.lang.String s)
tokenize s into words, and dump unknown word activations |
double[] |
getHistories(History h)
|
int[] |
getPossibleValues(int pos)
0...leftWindow-1 etc are null, leftWindow...length+leftWindow-1 are words, length+leftWindow...length+leftWindow+rightWindow-1 are null; |
double[][][] |
getProbs()
|
double[] |
getScores(History h)
this scores the current assignment in PairsHolder current position h.current |
java.lang.String |
getTaggedNice()
|
void |
init()
|
void |
init1()
|
static int[] |
intersect(int[] arr1,
int[] arr2)
|
boolean |
known(java.lang.String w)
|
int |
leftWindow()
How many positions to the left a position is dependent on. |
int |
length()
Implementation of the TagScorer interface follows |
static void |
main(java.lang.String[] args)
Tags a test sentence. |
void |
printActivations(History h)
print out the unknown word feature values of the features in ExtractorFramesRare |
void |
printProbs()
|
void |
printTop(PrintFile pfu)
This method should be called after the sentence has been tagged. |
void |
printUnknown(int numSent,
PrintFile pfu)
This method should be called after the sentence has been tagged. |
boolean |
reliable(int current)
|
void |
revert(int prevSize,
int afterSize)
|
int |
rightWindow()
How many positions to the right a position is dependent on. |
double |
scoreOf(int[] sequence)
Computes the score assigned by this model to the whole sequence. |
double |
scoreOf(int[] tags,
int pos)
Computes the unnormalized log conditional distribution over values of the element at position pos in the sequence, conditioned on the values of the elements in all other positions of the provided sequence. |
double[] |
scoresOf(int[] tags,
int pos)
Computes the unnormalized log conditional distribution over values of the element at position pos in the sequence, conditioned on the values of the elements in all other positions of the provided sequence. |
java.lang.String[] |
stringTagsAt(int pos)
|
Sentence |
tagSentence(LambdaSolve prob,
Sentence s)
|
static void |
tagSentenceTagScorer(java.lang.String[] sent)
tag a sentence using Dan's TagScorer interface |
java.lang.String[] |
test(java.lang.String outFile)
|
void |
test1(PrintFile pf,
Dictionary wrongWords)
|
void |
testTagInference(PrintFile pf,
Dictionary wrongWords)
test using TagInference |
static java.lang.String |
toNice(java.lang.String s)
|
static java.lang.String |
toSt(java.lang.String s)
|
static int[] |
unite(int[] arr1,
int[] arr2)
|
void |
writeProbs()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static LambdaSolve prob
public static int[] hPos
public static boolean[] isTag
public int numRight
public int numWrong
public int mikeKnown
Constructor Detail |
---|
public TestSentence()
public TestSentence(LambdaSolve prob, java.lang.String s, PrintFile pf)
public TestSentence(LambdaSolve prob, java.lang.String s)
public TestSentence(LambdaSolve prob, java.lang.String[] s, java.lang.String[] correctTags, PrintFile pf, Dictionary wrongWords)
public TestSentence(LambdaSolve prob, java.lang.String[] s, java.lang.String[] tags, java.lang.String[] correctTags, PrintFile pf, Dictionary wrongWords)
Method Detail |
---|
public Sentence tagSentence(LambdaSolve prob, Sentence s)
public void revert(int prevSize, int afterSize)
public void init()
public java.lang.String getTaggedNice()
public static java.lang.String toNice(java.lang.String s)
public static void tagSentenceTagScorer(java.lang.String[] sent)
public void init1()
public void writeProbs()
public void dumpActivations(java.lang.String s)
public static java.lang.String toSt(java.lang.String s)
public java.lang.String[] test(java.lang.String outFile)
public void test1(PrintFile pf, Dictionary wrongWords)
public void testTagInference(PrintFile pf, Dictionary wrongWords)
public boolean known(java.lang.String w)
public boolean reliable(int current)
public java.lang.String[] append(java.lang.String[] tags, java.lang.String word)
public java.lang.String[] appendOld(java.lang.String[] tags, java.lang.String word)
public double[] getScores(History h)
public void printActivations(History h)
public double[] getHistories(History h)
public static int[] intersect(int[] arr1, int[] arr2)
public static int[] unite(int[] arr1, int[] arr2)
public double[][][] getProbs()
public void printProbs()
public void addUnknown(Dictionary uDict)
public void printUnknown(int numSent, PrintFile pfu)
public void printTop(PrintFile pfu)
public int length()
length
in interface SequenceModel
public int leftWindow()
SequenceModel
leftWindow
in interface SequenceModel
public int rightWindow()
SequenceModel
rightWindow
in interface SequenceModel
public int[] getPossibleValues(int pos)
SequenceModel
getPossibleValues
in interface SequenceModel
pos
- the position
public java.lang.String[] stringTagsAt(int pos)
public double scoreOf(int[] tags, int pos)
SequenceModel
scoreOf
in interface SequenceModel
tags
- the sequence containing the rest of the values to condition onpos
- the position of the element to give a distribution for
public double scoreOf(int[] sequence)
SequenceModel
scoreOf
in interface SequenceModel
sequence
- the sequence to compute a score for
public double[] scoresOf(int[] tags, int pos)
SequenceModel
scoresOf
in interface SequenceModel
tags
- the sequence containing the rest of the values to condition onpos
- the position of the element to give a distribution for
public static void main(java.lang.String[] args)
args
- A single argument giving the filename of the parameter files.
This should be a complete filename for holder file, for example,
~/mine/wsj0-20.holder
, but the program will also use
other files by adding a second extension onto this filename. If
none is provided, a default tagger in /u/nlp/data
is used.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |