sequence
Class LinearTagger
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
w
public double[] w
LinearTagger
public LinearTagger(Alphabet xAlpha,
Alphabet yAlpha,
SequenceFeatureFunction fxy)
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.