public class KeywordOptimizerLargeNGramModel extends LargeNGramModel
Example of use in calling program using config file:
KeywordOptimizerLargeNGramModel model =
(KeywordOptimizerLargeNGramModel) cm.lookup("trigramModel");
model.keywordProbs = this.hashProbs;
Create hashProbs by loading keywords and changes to probabilities,
string, float pairs. Keywords may be all lower case.
hashProbs.put("keyword", 0.5f);
LargeNGramModel
,
KeywordOptimizerModel
Modifier and Type | Field and Description |
---|---|
java.util.HashMap<java.lang.String,java.lang.Float> |
keywordProbs
hash map of probability adjustments settable by
user program.
|
applyLanguageWeightAndWip, BYTES_PER_NGRAM, BYTES_PER_NMAXGRAM, clearCacheAfterUtterance, dictionary, format, fullSmear, languageWeight, logger, logMath, maxDepth, ngramCacheSize, ngramLogFile, PROP_APPLY_LANGUAGE_WEIGHT_AND_WIP, PROP_CLEAR_CACHES_AFTER_UTTERANCE, PROP_FULL_SMEAR, PROP_LANGUAGE_WEIGHT, PROP_NGRAM_CACHE_SIZE, PROP_QUERY_LOG_FILE, PROP_WORD_INSERTION_PROBABILITY, unigramWeight, wip
PROP_DICTIONARY, PROP_LOCATION, PROP_MAX_DEPTH, PROP_UNIGRAM_WEIGHT
Constructor and Description |
---|
KeywordOptimizerLargeNGramModel() |
Modifier and Type | Method and Description |
---|---|
float |
getProbability(WordSequence wordSequence)
Gets the ngram probability of the word sequence represented by the word list
|
allocate, deallocate, getMaxDepth, getNGramHits, getNGramMisses, getSmear, getSmearOld, getVocabulary, getWordID, hasWord, newProperties, onUtteranceEnd
public java.util.HashMap<java.lang.String,java.lang.Float> keywordProbs
public float getProbability(WordSequence wordSequence)
getProbability
in interface LanguageModel
getProbability
in class LargeNGramModel
wordSequence
- the word sequence