Package gannuWSD.algorithms

Examples of gannuWSD.algorithms.WSDAlgorithm


        for(String wsdconf:wsdconfig)
          for(int c=0;c<csize;c++)
            for(int b=0;b<bsize;b++)
              for(int t=0;t<tsize;t++)
              {
                WSDAlgorithm wsd=TestSet.instantiateAlgorithm(wsdNode,dict);
                  WSDAlgorithm backoff=TestSet.instantiateAlgorithm(backoffNode,dict);
                  WSDAlgorithm tie=TestSet.instantiateAlgorithm(tieNode,dict);                 
                  if(wsd==null)
                    throw new Exception("You must specify a valid wsd class!");
                 
                Test testx=new Test(inputs,wsd,backoff,tie,testsetsnames.get(tindex),sensefilters.get(tindex),sources,dict);
                  ts.add(testx);
                  ArrayList<KeyString> configs=testx.getConfigurations();
                  configs.add(new KeyString("wsd",wsdconf));
                  wsd.setSkipFilters(sfilters);
                  if(backoff!=null)
                    backoff.setSkipFilters(bsfilters);
                  if(tie!=null)
                    tie.setSkipFilters(tsfilters);
                  if(combos.size()>0)
                    wsd.setWindowFilters(combos.get(c));
                  else
                    wsd.setWindowFilters(new ArrayList<WindowFilter>(1));
                if(backoff!=null)
                  backoff.setWindowFilters(bfilters);
                if(tie!=null)
                  tie.setWindowFilters(tfilters);

                if(b<backoffconfig.size())
                  configs.add(new KeyString("backoff",backoffconfig.get(b)));
                if(t<tieconfig.size())
                  configs.add(new KeyString("tie",tieconfig.get(t)));
View Full Code Here


* @return The newly created WSDAlgorithm.
* @throws Exception
*/
private static WSDAlgorithm instantiateAlgorithm(Element item,
      DataBroker dict)throws Exception {
     WSDAlgorithm algo=null;
     if(!item.getAttribute("class").equals("none"))
     { 
      algo=(WSDAlgorithm)Class.forName(item.getAttribute("class")).newInstance();
      algo.setDict(dict);
     }
    return algo;
  }
View Full Code Here

        String text=Input.generateSGFFromRaw(f,data);
        if(Boolean.parseBoolean(args[3]))
        {
          Input test=new Input(text,data);
          System.out.println("Disambiguating file...");
          WSDAlgorithm wsd=new FirstSense();         
          ArrayList<SkipFilter> skipFilters=new ArrayList<SkipFilter>();
          //TODO
          //SkipNotOSD filter=new SkipNotOSD();
          //filter.addParameters("corpus:sgfSamples/semcor3.0/");
          //skipFilters.add(filter);
          wsd.setSkipFilters(skipFilters);
          ArrayList<WindowFilter> filters=new ArrayList<WindowFilter>(1);                 
          wsd.setWindowFilters(filters);         
          ArrayList<Decision> ds=wsd.solve(test, null, null, data);
          System.out.println("Modifying file...");
          Input.modifyAndSaveSGF(f.getCanonicalPath()+".sgf",ds);
        }
        System.out.println("Saving...");
      }
View Full Code Here

TOP

Related Classes of gannuWSD.algorithms.WSDAlgorithm

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.