001 package org.maltparser.ml;
002
003 import java.io.BufferedWriter;
004 import java.util.ArrayList;
005
006 import org.maltparser.core.exception.MaltChainedException;
007 import org.maltparser.core.feature.FeatureVector;
008 import org.maltparser.core.feature.function.FeatureFunction;
009 import org.maltparser.core.syntaxgraph.DependencyStructure;
010 import org.maltparser.parser.history.action.SingleDecision;
011
012
013 public interface LearningMethod {
014 public static final int BATCH = 0;
015 public static final int CLASSIFY = 1;
016 public void addInstance(SingleDecision decision, FeatureVector featureVector) throws MaltChainedException;
017 public void finalizeSentence(DependencyStructure dependencyGraph) throws MaltChainedException;
018 public void noMoreInstances() throws MaltChainedException;
019 public void train(FeatureVector featureVector) throws MaltChainedException;
020 public void moveAllInstances(LearningMethod method, FeatureFunction divideFeature, ArrayList<Integer> divideFeatureIndexVector) throws MaltChainedException;
021 public void terminate() throws MaltChainedException;
022 public boolean predict(FeatureVector features, SingleDecision decision) throws MaltChainedException;
023 public BufferedWriter getInstanceWriter();
024 public void increaseNumberOfInstances();
025 public void decreaseNumberOfInstances();
026 }