Package edu.isi.karma.cleaning

Examples of edu.isi.karma.cleaning.Messager


        }
        vtmp.add(pair);
      }
      DataPreProcessor dpp = new DataPreProcessor(vtmp);
      dpp.run();
      Messager msger = new Messager();
      while (true) {

        Vector<String[]> result = new Vector<String[]>();
        System.out.print("Enter raw value\n");
        // open up standard input
        BufferedReader br = new BufferedReader(new InputStreamReader(
            System.in));
        String raw = null;
        raw = br.readLine();
        if (raw.compareTo("end") == 0) {
          break;
        }
        System.out.print("Enter tar value\n");
        // open up standard input
        String tar = null;
        tar = br.readLine();

        // learn the program
        String[] xStrings = { "<_START>" + raw + "<_END>", tar };
        examples.add(xStrings);
        for (String[] elem : examples) {
          System.out.println("Examples inputed: "
              + Arrays.toString(elem));
        }
        String ofpath = "/Users/bowu/Research/50newdata/tmp/"
            + nf.getName();
        CSVWriter cw = new CSVWriter(new FileWriter(new File(ofpath)));
        ProgSynthesis psProgSynthesis = new ProgSynthesis();       
        psProgSynthesis.inite(examples,dpp,msger); //
        Collection<ProgramRule> ps = psProgSynthesis.run_main();
        msger.updateCM_Constr(psProgSynthesis.partiCluster
            .getConstraints());
        msger.updateWeights(psProgSynthesis.partiCluster.weights);
        ProgramRule pr = ps.iterator().next();
        System.out.println(""+psProgSynthesis.myprog.toString());
        System.out.println("" + pr.toString());
        for(String org: vtmp)
        {
View Full Code Here


          xHashMap.put(index + "", line);
          index++;
        }
        DataPreProcessor dpp = new DataPreProcessor(vtmp);
        dpp.run();
        Messager msger = new Messager();
        Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
        if (entries.size() <= 1)
          return;
        ExampleSelection expsel = new ExampleSelection();
        ExampleSelection.firsttime = true;
        expsel.inite(xHashMap, null);
        int target = Integer.parseInt(expsel.Choose());
        String[] mt = { "<_START>" + entries.get(target)[0] + "<_END>",
            entries.get(target)[1] };
        examples.add(mt);
        ExampleSelection.firsttime = false;
        // accuracy record code
        ArrayList<double[]> accArrayList = new ArrayList<double[]>();
        while (true) // repeat as no incorrect answer appears.
        {
          if (examples.size() == 8) {
            System.out.println("Hello World");
          }
          long checknumber = 1;
          long iterAfterNoFatalError = 0;
          long isvisible = 0;
          HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
          Vector<String> resultString = new Vector<String>();
          xHashMap = new HashMap<String, String[]>();
          ProgSynthesis psProgSynthesis = new ProgSynthesis();
          HashMap<String, String> unlabeledData = new HashMap<String, String>();
          for (int i = 0; i < vtmp.size(); i++) {
            unlabeledData.put("" + i, vtmp.get(i));
          }
          psProgSynthesis.inite(examples, dpp, msger);
          Vector<ProgramRule> pls = new Vector<ProgramRule>();
          Collection<ProgramRule> ps = psProgSynthesis.run_main();
          // collect history contraints
          msger.updateCM_Constr(psProgSynthesis.partiCluster
              .getConstraints());
          msger.updateWeights(psProgSynthesis.partiCluster.weights);
          // constraints.addAll();
          if (ps != null) {
            pls.addAll(ps);
          } else {
            System.out.println("Cannot find any rule");
View Full Code Here

          xHashMap.put(index + "", line);
          index++;
        }
        DataPreProcessor dpp = new DataPreProcessor(vtmp);
        dpp.run();
        Messager msger = new Messager();
        Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
        if (entries.size() <= 1)
          return Double.MAX_VALUE;
        ExampleSelection expsel = new ExampleSelection();
        ExampleSelection.firsttime = true;
        expsel.inite(xHashMap, null);
        int target = Integer.parseInt(expsel.Choose());
        String[] mt = { "<_START>" + entries.get(target)[0] + "<_END>",
            entries.get(target)[1] };
        examples.add(mt);
        ExampleSelection.firsttime = false;
        // accuracy record code
        ArrayList<double[]> accArrayList = new ArrayList<double[]>();
        long stime = System.currentTimeMillis();
        boolean overtime = true;
        while (true) // repeat as no incorrect answer appears.
        {
          if (examples.size() == 4) {
            System.out.println("Hello World");
          }
          if (System.currentTimeMillis() - stime > 600000) {
            overtime = false;
            break;
          }
          long checknumber = 1;
          long iterAfterNoFatalError = 0;
          long isvisible = 0;
          HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
          Vector<String> resultString = new Vector<String>();
          xHashMap = new HashMap<String, String[]>();
          ProgSynthesis psProgSynthesis = new ProgSynthesis();
          HashMap<String, String> unlabeledData = new HashMap<String, String>();
          for (int i = 0; i < vtmp.size(); i++) {
            unlabeledData.put("" + i, vtmp.get(i));
          }
          psProgSynthesis.inite(examples, dpp, msger);
          Vector<ProgramRule> pls = new Vector<ProgramRule>();
          Collection<ProgramRule> ps = psProgSynthesis.run_main();
          // collect history contraints
          msger.updateCM_Constr(psProgSynthesis.partiCluster
              .getConstraints());
          msger.updateWeights(psProgSynthesis.partiCluster.weights);
          // constraints.addAll();
          if (ps != null) {
            pls.addAll(ps);
          } else {
            System.out.println("Cannot find any rule");
View Full Code Here

      xHashMap.put(index + "", line);
      index++;
    }
    DataPreProcessor dpp = new DataPreProcessor(vtmp);
    dpp.run();
    Messager msger = new Messager();
    Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
    ArrayList<double[]> accArrayList = new ArrayList<double[]>();
    int i = 0;
    while (i<exps.size()) // repeat as no incorrect answer appears.
    {
      String[] tmt = { "<_START>" + exps.get(i)[0] + "<_END>", exps.get(i)[1] };
      examples.add(tmt);
      xHashMap = new HashMap<String, String[]>();
      ProgSynthesis psProgSynthesis = new ProgSynthesis();
      psProgSynthesis.inite(examples, dpp, msger);
      Vector<ProgramRule> pls = new Vector<ProgramRule>();
      long t1 = System.currentTimeMillis();
      Collection<ProgramRule> ps = psProgSynthesis.run_main();
      long span = System.currentTimeMillis()-t1;
      timeres += span+",";
      // collect history contraints
      msger.updateCM_Constr(psProgSynthesis.partiCluster.getConstraints());
      msger.updateWeights(psProgSynthesis.partiCluster.weights);
      i++;
      // constraints.addAll();
      if (ps != null) {
        pls.addAll(ps);
        System.out.println("program: "+ps);
View Full Code Here

      xHashMap.put(index + "", line);
      index++;
    }
    DataPreProcessor dpp = new DataPreProcessor(vtmp);
    dpp.run();
    Messager msger = new Messager();
    Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
    ArrayList<double[]> accArrayList = new ArrayList<double[]>();
    int i = 0;
    while (i<exps.size()) // repeat as no incorrect answer appears.
    {
      String[] tmt = { "<_START>" + exps.get(i)[0] + "<_END>", exps.get(i)[1] };
      examples.add(tmt);
      xHashMap = new HashMap<String, String[]>();
      ProgSynthesis psProgSynthesis = new ProgSynthesis();
      psProgSynthesis.inite(examples, dpp, msger);
      Vector<ProgramRule> pls = new Vector<ProgramRule>();
      long t1 = System.currentTimeMillis();
      Collection<ProgramRule> ps = psProgSynthesis.adaptive_main();
      long span = System.currentTimeMillis()-t1;
      timeres += span+",";
      // collect history contraints
      msger.updateCM_Constr(psProgSynthesis.partiCluster.getConstraints());
      msger.updateWeights(psProgSynthesis.partiCluster.weights);
      i++;
      // constraints.addAll();
      if (ps != null) {
        pls.addAll(ps);
        System.out.println("program: "+ps);
View Full Code Here

            xHashMap.put(index + "", line);
            index++;
          }
          DataPreProcessor dpp = new DataPreProcessor(vtmp);
          dpp.run();
          Messager msger = new Messager();
          Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
          if (entries.size() <= 1)
            continue;
          ExampleSelection expsel = new ExampleSelection();
          ExampleSelection.firsttime = true;
          expsel.inite(xHashMap, null);
          int target = Integer.parseInt(expsel.Choose());
          String[] mt = {
              "<_START>" + entries.get(target)[0] + "<_END>",
              entries.get(target)[1] };
          examples.add(mt);
          ExampleSelection.firsttime = false;
          // accuracy record code
          ArrayList<double[]> accArrayList = new ArrayList<double[]>();

          while (true) // repeat as no incorrect answer appears.
          {
            long checknumber = 1;
            long iterAfterNoFatalError = 0;
            HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
            Vector<String> resultString = new Vector<String>();
            xHashMap = new HashMap<String, String[]>();
            ProgSynthesis psProgSynthesis = new ProgSynthesis();
            HashMap<String, String> unlabeledData = new HashMap<String, String>();
            for (int i = 0; i < vtmp.size(); i++) {
              unlabeledData.put("" + i, vtmp.get(i));
            }
            psProgSynthesis.inite(examples, dpp, msger);
            Vector<ProgramRule> pls = new Vector<ProgramRule>();
            Collection<ProgramRule> ps = psProgSynthesis
                .adaptive_main();
            // collect history contraints
            msger.updateCM_Constr(psProgSynthesis.partiCluster
                .getConstraints());
            msger.updateWeights(psProgSynthesis.partiCluster.weights);
            // constraints.addAll();
            if (ps != null) {
              pls.addAll(ps);
            } else {
              System.out.println("Cannot find any rule");
View Full Code Here

            xHashMap.put(index + "", line);
            index++;
          }
          DataPreProcessor dpp = new DataPreProcessor(vtmp);
          dpp.run();
          Messager msger = new Messager();
          Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>();
          if (entries.size() <= 1)
            continue;
          ExampleSelection expsel = new ExampleSelection();
          ExampleSelection.firsttime = true;
          expsel.inite(xHashMap, null);
          int target = Integer.parseInt(expsel.Choose());
          String[] mt = {
              "<_START>" + entries.get(target)[0] + "<_END>",
              entries.get(target)[1] };
          examples.add(mt);
          ExampleSelection.firsttime = false;
          // accuracy record code
          ArrayList<double[]> accArrayList = new ArrayList<double[]>();
          long stime = System.currentTimeMillis();
          boolean overtime = true;
          while (true) // repeat as no incorrect answer appears.
          {
            if (examples.size() == 8) {
              System.out.println("Hello World");
            }
            if (System.currentTimeMillis() - stime > 600000) {
              overtime = false;
              break;
            }
            long checknumber = 1;
            long iterAfterNoFatalError = 0;
            long isvisible = 0;
            HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
            Vector<String> resultString = new Vector<String>();
            xHashMap = new HashMap<String, String[]>();
            ProgSynthesis psProgSynthesis = new ProgSynthesis();
            HashMap<String, String> unlabeledData = new HashMap<String, String>();
            for (int i = 0; i < vtmp.size(); i++) {
              unlabeledData.put("" + i, vtmp.get(i));
            }
            psProgSynthesis.inite(examples, dpp, msger);
            Vector<ProgramRule> pls = new Vector<ProgramRule>();
            Collection<ProgramRule> ps = psProgSynthesis.run_main();
            // collect history contraints
            msger.updateCM_Constr(psProgSynthesis.partiCluster
                .getConstraints());
            msger.updateWeights(psProgSynthesis.partiCluster.weights);
            // constraints.addAll();
            if (ps != null) {
              pls.addAll(ps);
            } else {
              System.out.println("Cannot find any rule");
View Full Code Here

      DataPreProcessor dpp = (DataPreProcessor) wk.getDpp();
      if(dpp == null)
      {
        dpp = new DataPreProcessor(rows.values());
      }
      Messager msg = (Messager) wk.getMsg();
      if(msg == null)
      {
        msg = new Messager();
      }
      RamblerTransformationOutput rtf = applyRamblerTransformation(rows,dpp,msg);
      if (rtf.getTransformations().keySet().size() <= 0) {
        c.append(WorksheetUpdateFactory
            .createRegenerateWorksheetUpdates(worksheetId, getSuperSelection(workspace)));
View Full Code Here

      this.compResultString += originalVal + "\n";
      calAmbScore(id, originalVal, amb);
    }
    RamblerValueCollection vc = new RamblerValueCollection(rows);
    HashMap<String, Vector<String[]>> expFeData = new HashMap<String, Vector<String[]>>();
    Messager mg = null;
    if(wk.getMsg()!= null)
    {
      mg = (Messager) wk.getMsg();
    }
    else
    {
      mg = new Messager();
      wk.setMsg(mg);
    }
    DataPreProcessor dp = null;
    if(wk.getDpp()!= null)
    {
View Full Code Here

TOP

Related Classes of edu.isi.karma.cleaning.Messager

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.