sequence
Class LinearTagger

java.lang.Object
  extended by sequence.LinearTagger
All Implemented Interfaces:
Serializable

public class LinearTagger
extends Object
implements Serializable

A linear model for sequence classification. It has the form h(x) = arg_max_y f(x,y).w where x and y are sequences of identical length, and f(x,y) decomposes over pairs of positions on y.

Author:
kuzman
See Also:
Serialized Form

Field Summary
 double[] w
           
 
Constructor Summary
LinearTagger(Alphabet xAlpha, Alphabet yAlpha, SequenceFeatureFunction fxy)
           
 
Method Summary
 int[] label(SparseVector[] x)
          use the Viterbi algorithm to find arg_max_y f(x,y) .
 void readObject(ObjectInputStream in)
           
 double[][][] scores(SparseVector[] x)
          at each position 0<=t
 void writeObject(ObjectOutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

w

public double[] w
Constructor Detail

LinearTagger

public LinearTagger(Alphabet xAlpha,
                    Alphabet yAlpha,
                    SequenceFeatureFunction fxy)
Method Detail

scores

public double[][][] scores(SparseVector[] x)
at each position 0<=t
Parameters:
x -
Returns:
result[t][ytm1][yt] = f(x,ytm1,yt).w

label

public int[] label(SparseVector[] x)
use the Viterbi algorithm to find arg_max_y f(x,y) . w

Parameters:
x -
Returns:
y that maximizes f(x,y) . w

writeObject

public void writeObject(ObjectOutputStream out)
                 throws IOException
Throws:
IOException

readObject

public void readObject(ObjectInputStream in)
                throws IOException,
                       ClassNotFoundException
Throws:
IOException
ClassNotFoundException


Copyright © 2009. All Rights Reserved.