cc.mallet.pipe
Class FeatureSequenceConvolution
- java.lang.Object
-
- cc.mallet.pipe.Pipe
-
- cc.mallet.pipe.FeatureSequenceConvolution
-
- All Implemented Interfaces:
- AlphabetCarrying, java.io.Serializable
public class FeatureSequenceConvolution extends Pipe
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description FeatureSequenceConvolution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Instancepipe(Instance carrier)construct word co-occurrence features from the original sequence do combinatoric, n choose 2, can be extended to n choose 3 public void convolution() { int fi = -1; int pre = -1; int i,j; int curLen = length; for(i = 0; i < curLen-1; i++) { for(j = i + 1; j < curLen; j++) { pre = features[i]; fi = features[j]; Object preO = dictionary.lookupObject(pre); Object curO = dictionary.lookupObject(fi); Object coO = preO.toString() + "_" + curO.toString(); add(coO); } } }-
Methods inherited from class cc.mallet.pipe.Pipe
alphabetsMatch, getAlphabet, getAlphabets, getDataAlphabet, getInstanceId, getTargetAlphabet, instanceFrom, instancesFrom, instancesFrom, isDataAlphabetSet, isTargetProcessing, newIteratorFrom, precondition, readResolve, setDataAlphabet, setOrCheckDataAlphabet, setOrCheckTargetAlphabet, setTargetAlphabet, setTargetProcessing
-
-
-
-
Method Detail
-
pipe
public Instance pipe(Instance carrier)
construct word co-occurrence features from the original sequence do combinatoric, n choose 2, can be extended to n choose 3 public void convolution() { int fi = -1; int pre = -1; int i,j; int curLen = length; for(i = 0; i < curLen-1; i++) { for(j = i + 1; j < curLen; j++) { pre = features[i]; fi = features[j]; Object preO = dictionary.lookupObject(pre); Object curO = dictionary.lookupObject(fi); Object coO = preO.toString() + "_" + curO.toString(); add(coO); } } }
-
-
DataMelt 3.0 © DataMelt by jWork.ORG