|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.parser.lexparser.BaseUnknownWordModel
public class BaseUnknownWordModel
An unknown word model for a generic language. This was originally designed for German, changing only to remove German-specific numeric features. Models unknown words based on their prefix and suffixes, as well as capital letters.
Constructor Summary | |
---|---|
BaseUnknownWordModel()
|
|
BaseUnknownWordModel(Options.LexOptions op)
|
Method Summary | |
---|---|
Lexicon |
getLexicon()
Get the lexicon associated with this unknown word model; usually not used, but might be useful to tell you if a related word is known or unknown, for example. |
String |
getSignature(String word,
int loc)
Signature for a specific German word; loc parameter is ignored. |
int |
getSignatureIndex(int wordIndex,
int sentencePosition)
|
int |
getUnknownLevel()
Get the level of equivalence classing for the model. |
void |
readData(BufferedReader in)
This operation not supported by this model. |
double |
score(IntTaggedWord itw)
|
double |
score(IntTaggedWord itw,
int loc)
Currently we don't consider loc in determining score. |
double |
score(TaggedWord tw)
Calculate the log-prob score of a particular TaggedWord in the unknown word model. |
void |
setLexicon(Lexicon l)
Connect the unknown word model to a specific lexicon; often required to set a lexicon prior to using the model. |
void |
setUnknownLevel(int unknownLevel)
One unknown word model may allow different options to be set; for example, several models of unknown words for a given language could be included in one class. |
void |
train(Collection<Tree> trees)
trains the end-character based unknown word model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseUnknownWordModel()
public BaseUnknownWordModel(Options.LexOptions op)
Method Detail |
---|
public double score(IntTaggedWord itw, int loc)
score
in interface UnknownWordModel
itw
- An IntTaggedWord pairing a word and POS tagloc
- The position in the sentence. In the default implementation
this is used only for unknown words to change their
probability distribution when sentence initial.
public double score(IntTaggedWord itw)
public double score(TaggedWord tw)
tw
- the tag->word production in TaggedWord form
public String getSignature(String word, int loc)
getSignature
in interface UnknownWordModel
word
- loc
-
public int getSignatureIndex(int wordIndex, int sentencePosition)
getSignatureIndex
in interface UnknownWordModel
public void train(Collection<Tree> trees)
train
in interface UnknownWordModel
trees
- the collection of trees to be trained overpublic Lexicon getLexicon()
getLexicon
in interface UnknownWordModel
public void readData(BufferedReader in) throws IOException
readData
in interface UnknownWordModel
IOException
public void setLexicon(Lexicon l)
UnknownWordModel
setLexicon
in interface UnknownWordModel
public int getUnknownLevel()
UnknownWordModel
getUnknownLevel
in interface UnknownWordModel
public void setUnknownLevel(int unknownLevel)
UnknownWordModel
setUnknownLevel
in interface UnknownWordModel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |