Package gannuCF.classifiers

Examples of gannuCF.classifiers.Classifier


    System.out.print(".");
    Decision decision=new Decision(target,window);
    // TODO Auto-generated method stub
    if(target.getSenses().size()>1)
    {
      Classifier c;
      if(this.getValue("classifier")==null)
        this.addParameters("classifier:gannuCF.classifiers.NaiveBayes;");
      File f=new File("./data/classifiers/"+this.dict.getCompleteName()+"/"+Dictionary.normalizeLemmaforFile(target.getLemma())+"_"+this.getValue("classifier")+".gcl");
      if(f.exists())
      {
        c=(Classifier)Util.loadObject(f);
      }
      else
      {
       
        c=(Classifier)Class.forName(this.getValue("classifier")).newInstance();
        c.addParameters(this.getParameterString());
        c.train(target);
        File dir=new File("./data/classifiers/"+this.dict.getCompleteName()+"/");
        if(!dir.exists())
          dir.mkdirs();
        Util.writeObject(f, c);
      }
      ArrayList<String> sample=new ArrayList<String>(window.size());     
      for(AmbiguousWord word:window)
      {
        sample.add(word.getLemma());       
      }
      float w[]=c.classify(sample);
      for(int j=0;j<target.getSenses().size();j++)
      {
        ArrayList<String> dwords=new ArrayList<String>(window.size());
        for(AmbiguousWord word:window)
        {
View Full Code Here

TOP

Related Classes of gannuCF.classifiers.Classifier

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.