HMM Mallet Learning Problems

I am afraid at the moment with Mallet ridiculously poor documentation regarding HMM. I managed to import the data into instances (adapted from the ImportExample.java fragment), and I'm just wondering how it can be used to train the HMM model. At first I started by creating an instance of HMM, but was not sure whether to look for:

HMM hmm = new HMM(instances.getDataAlphabet(), instances.getTargetAlphabet()); 

Or use the same data alphabet twice:

  HMM hmm = new HMM(instances.getDataAlphabet(), instances.getDataAlphabet()); 

Anyway when I get to

  hmm.train(instances); 

I get the following error:

cc.mallet.types.FeatureVectorSequence cannot be dropped

I would be grateful for any help you can provide.

Greetings

+4
source share
1 answer

I managed to solve this particular problem and thought that it could be useful for others with the same problem. There is a solution in the example package in the beater: http://hg-iesl.cs.umass.edu/hg/mallet/file/83adf71b0824/src/cc/mallet/examples/TrainHMM.java

The main problem was how you imported the data through the pipe. Also from what I can say, it helps if the data is in this format:

 TOKEN TAG TOKEN TAG 

I assume you might have functions between TOKEN and TAG, but I'm not 100% sure. If anyone knows any good examples and documentation about using HMM in a hammer, let me know.

+2
source

All Articles