Package org.maltparserx.parser.guide

Examples of org.maltparserx.parser.guide.GuideException


      if (method.predict(featureVector, decision)) {
        return featureVector;
      }
      return null;
    } catch (NullPointerException e) {
      throw new GuideException("The learner cannot be found. ", e);
    }
  }
View Full Code Here


   * @param divideFeatureIndexVector the divide feature index vector
   * @throws MaltChainedException
   */
  public void moveAllInstances(AtomicModel model, FeatureFunction divideFeature, ArrayList<Integer> divideFeatureIndexVector) throws MaltChainedException {
    if (method == null) {
      throw new GuideException("The learner cannot be found. ");
    } else if (model == null) {
      throw new GuideException("The guide model cannot be found. ");
    } else if (divideFeature == null) {
      throw new GuideException("The divide feature cannot be found. ");
    } else if (divideFeatureIndexVector == null) {
      throw new GuideException("The divide feature index vector cannot be found. ");
    }
    ((Modifiable)divideFeature).setFeatureValue(index);
    method.moveAllInstances(model.getMethod(), divideFeature, divideFeatureIndexVector);
    method.terminate();
    method = null;
View Full Code Here

      method.train(featureVector);
      method.terminate();
      method = null;
     
    } catch (NullPointerException e) { 
      throw new GuideException("The learner cannot be found. ", e);
    }
   

  }
View Full Code Here

    try
      Constructor<?> constructor = clazz.getConstructor(argTypes);
      this.method = (LearningMethod)constructor.newInstance(arguments);
    } catch (NoSuchMethodException e) {
      throw new GuideException("The learner class '"+clazz.getName()+"' cannot be initialized. ", e);
    } catch (InstantiationException e) {
      throw new GuideException("The learner class '"+clazz.getName()+"' cannot be initialized. ", e);
    } catch (IllegalAccessException e) {
      throw new GuideException("The learner class '"+clazz.getName()+"' cannot be initialized. ", e);
    } catch (InvocationTargetException e) {
      throw new GuideException("The learner class '"+clazz.getName()+"' cannot be initialized. ", e);
    }
  }
View Full Code Here

   *
   * @return the parent guide model
   */
  public Model getParent() throws MaltChainedException {
    if (parent == null) {
      throw new GuideException("The atomic model can only be used by a parent model. ");
    }
    return parent;
  }
View Full Code Here

    }
  }
 
  public void noMoreInstances() throws MaltChainedException {
    if (guide.getGuideMode() == ClassifierGuide.GuideMode.CLASSIFY) {
      throw new GuideException("The decision model could not create it's model. ");
    }

    if (instanceModel != null) {
      instanceModel.noMoreInstances();
      instanceModel.train();
View Full Code Here

    }
  }
 
  public void noMoreInstances() throws MaltChainedException {
    if (guide.getGuideMode() == ClassifierGuide.GuideMode.CLASSIFY) {
      throw new GuideException("The decision model could not create it's model. ");
    }
    if (instanceModel != null) {
      instanceModel.noMoreInstances();
      instanceModel.train();
    }
View Full Code Here

    }
  }
 
  public void addInstance(GuideDecision decision) throws MaltChainedException {
    if (decision instanceof SingleDecision) {
      throw new GuideException("A branched decision model expect more than one decisions. ");
    }
    featureModel.update();
    final SingleDecision singleDecision = ((MultipleDecision)decision).getSingleDecision(decisionIndex);
    if (instanceModel == null) {
      initInstanceModel(singleDecision.getTableContainer().getTableContainerName());
View Full Code Here

    return true;
  }
 
  public FeatureVector predictExtract(GuideDecision decision) throws MaltChainedException {
    if (decision instanceof SingleDecision) {
      throw new GuideException("A branched decision model expect more than one decisions. ");
    }
    featureModel.update();
    final SingleDecision singleDecision = ((MultipleDecision)decision).getSingleDecision(decisionIndex);
    if (instanceModel == null) {
      initInstanceModel(singleDecision.getTableContainer().getTableContainerName());
View Full Code Here

    return instanceModel.extract(); // TODO handle many feature vectors
  }
 
  public boolean predictFromKBestList(GuideDecision decision) throws MaltChainedException {
    if (decision instanceof SingleDecision) {
      throw new GuideException("A branched decision model expect more than one decisions. ");
    }
   
    boolean success = false;
    final SingleDecision singleDecision = ((MultipleDecision)decision).getSingleDecision(decisionIndex);
    if (decisionIndex+1 < decision.numberOfDecisions()) {
View Full Code Here

TOP

Related Classes of org.maltparserx.parser.guide.GuideException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.