001package org.maltparser.ml; 002 003import java.io.BufferedWriter; 004import java.util.ArrayList; 005 006import org.maltparser.core.exception.MaltChainedException; 007import org.maltparser.core.feature.FeatureVector; 008import org.maltparser.core.feature.function.FeatureFunction; 009import org.maltparser.core.syntaxgraph.DependencyStructure; 010import org.maltparser.parser.history.action.SingleDecision; 011 012 013public 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() 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}