public class AbbvGapsHMM extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AbbvGapsHMM.Emissions |
static class |
AbbvGapsHMM.States |
static class |
AbbvGapsHMM.Transitions |
| Constructor and Description |
|---|
AbbvGapsHMM() |
AbbvGapsHMM(String modelParamFile) |
AbbvGapsHMM(String modelParamFile,
boolean allowVowelsMatch) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
expectationStep(Acronym acronym,
String trueLongForm) |
Double |
getDF(String word) |
List<Double> |
getEmmisionParams() |
protected double |
getNewStateVal(double current,
double total) |
List<Double> |
getTransitionParams() |
void |
initModelParamsAndCounters() |
protected void |
initStartProbs()
Initialize the starting probabilities for each state (hard coded).
|
boolean |
loadModelParams() |
protected Double |
maximizationStep()
Returns the total change in model parameter values.
|
protected Double |
maximizationStepForEmissions() |
protected Double |
maximizationStepForTransitions() |
void |
saveModelParams() |
void |
setParamFile(String paramFile) |
void |
setStartingParams(List<Double> emmisions,
List<Double> transitions) |
void |
setTfIdfData(String dataFile) |
protected double |
smoothCounter(int i,
List<Double> counters,
List<Double> params)
Dirichlet smoothing
-------------------
Without a prior:
P(data | theta) = theta(i)^beta(i) = counters(i)
With a dirichlet prior:
P(data | theta)*p(theta) = theta(i)^(beta(i) + alpha(i)) =
theta(i)^beta(i) + theta(i)^alpha(i)
counters(i) + params(i)^alpha(i)
|
boolean |
train(List<List<Acronym>> corpus,
List<Map<String,String>> trueLabels) |
boolean |
train(List<List<Acronym>> corpus,
List<Map<String,String>> trueLabels,
boolean force) |
protected boolean |
trainCorpus(List<List<Acronym>> corpus,
List<Map<String,String>> trueLabels) |
boolean |
useTDIDF() |
AbbreviationAlignmentContainer<AbbvGapsHMM.Emissions,AbbvGapsHMM.States> |
viterbi(Acronym acronym) |
public AbbvGapsHMM()
public AbbvGapsHMM(String modelParamFile)
modelParamFile - After training, the model parameters will be saved to this file.public AbbvGapsHMM(String modelParamFile, boolean allowVowelsMatch)
modelParamFile - After training, the model parameters will be saved to this file.public boolean useTDIDF()
public void setTfIdfData(String dataFile) throws IOException
IOExceptionprotected void initStartProbs()
public void setParamFile(String paramFile)
public boolean train(List<List<Acronym>> corpus, List<Map<String,String>> trueLabels, boolean force)
public void initModelParamsAndCounters()
protected boolean trainCorpus(List<List<Acronym>> corpus, List<Map<String,String>> trueLabels)
public AbbreviationAlignmentContainer<AbbvGapsHMM.Emissions,AbbvGapsHMM.States> viterbi(Acronym acronym)
public void saveModelParams()
public boolean loadModelParams()
protected Double maximizationStep()
protected Double maximizationStepForTransitions()
protected double smoothCounter(int i,
List<Double> counters,
List<Double> params)
protected double getNewStateVal(double current,
double total)
protected Double maximizationStepForEmissions()
Copyright © 2016. All rights reserved.