|
|||||||||
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
Constructor Summary | |
---|---|
TestSentence()
|
|
TestSentence(LambdaSolve prob,
String s)
|
|
TestSentence(LambdaSolve prob,
String[] s,
String[] correctTags,
PrintFile pf,
Dictionary wrongWords)
|
|
TestSentence(LambdaSolve prob,
String s,
PrintFile pf)
|
Method Summary | |
---|---|
void |
addUnknown(Dictionary uDict)
This method should be called after the sentence has been tagged. |
static String[] |
append(String[] tags,
String word)
|
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()
|
String |
getTaggedNice()
Returns a string representation of the sentence. |
Sentence<TaggedWord> |
getTaggedSentence()
|
boolean |
known(String w)
|
int |
leftWindow()
How many positions to the left a position is dependent on. |
int |
length()
|
static void |
main(String[] args)
Tags a test sentence. |
void |
printProbs()
|
void |
printTop(PrintFile pfu)
This method should be called after a 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)
|
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. |
String[] |
stringTagsAt(int pos)
|
Sentence<TaggedWord> |
tagSentence(LambdaSolve prob,
Sentence<? extends HasWord> s)
Tags the sentence s by solving prob. |
Sentence<TaggedWord> |
testTagInference()
Test using (exact Viterbi) TagInference. |
void |
testTagInference(PrintFile pf,
Dictionary wrongWords)
Test using (exact Viterbi) TagInference. |
static String |
toNice(String s)
|
void |
writeProbs()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestSentence()
public TestSentence(LambdaSolve prob, String s)
public TestSentence(LambdaSolve prob, String s, PrintFile pf)
public TestSentence(LambdaSolve prob, String[] s, String[] correctTags, PrintFile pf, Dictionary wrongWords)
Method Detail |
---|
public Sentence<TaggedWord> tagSentence(LambdaSolve prob, Sentence<? extends HasWord> s)
prob
- s
-
public String getTaggedNice()
public Sentence<TaggedWord> getTaggedSentence()
public static String toNice(String s)
public void writeProbs()
public void testTagInference(PrintFile pf, Dictionary wrongWords)
public Sentence<TaggedWord> testTagInference()
public boolean known(String w)
public boolean reliable(int current)
public static String[] append(String[] tags, String word)
public double[] getHistories(History h)
public double[][][] getProbs()
public void printProbs()
public void addUnknown(Dictionary uDict)
public void printUnknown(int numSent, PrintFile pfu)
numSent
- The sentence numberpfu
- The file to print the probable tags topublic void printTop(PrintFile pfu)
pfu
- File to print top tags topublic 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 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(String[] args)
args
- A single argument giving the filename of the model file. 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 |