Package cc.mallet.grmm.util

Examples of cc.mallet.grmm.util.LabelsAssignment


    StringTokenization tokenization = new StringTokenization (buf);
    tokenization.addAll (spans);
    carrier.setData (tokenization);

    carrier.setTarget (new LabelsAssignment (new LabelsSequence (lbls)));
    return carrier;
  }
View Full Code Here


  }

  public LabelsSequence getBestLabels (Instance inst)
  {
    Assignment assn = bestAssignment (inst);
    LabelsAssignment gold = (LabelsAssignment) inst.getTarget ();
    return gold.toLabelsSequence (assn);
  }
View Full Code Here

    protected abstract void addInstantiatedCliques (UnrolledGraph graph, FeatureVectorSequence fvs, LabelsAssignment lblseq);

    public void addInstantiatedCliques (UnrolledGraph graph, Instance instance)
    {
      FeatureVectorSequence fvs = (FeatureVectorSequence) instance.getData ();
      LabelsAssignment lblseq = (LabelsAssignment) instance.getTarget ();
      addInstantiatedCliques (graph, fvs, lblseq);
    }
View Full Code Here

      Iterator it1 = testList.iterator ();
      Iterator it2 = returnedList.iterator ();
      while (it1.hasNext ()) {
        Instance inst = (Instance) it1.next ();
//      System.out.println ("\n\nInstance");
        LabelsAssignment lblseq = (LabelsAssignment) inst.getTarget ();
        LabelsSequence target = lblseq.getLabelsSequence ();
        LabelsSequence returned = (LabelsSequence) it2.next ();
//      System.out.println (target);
        compareLabelings (results, returned, target);
      }
View Full Code Here

    // This isn't pretty, but I swear there's
    //  not an easy way...
    private void setupAlphabet (Instance inst)
    {
      LabelsAssignment lblseq = (LabelsAssignment) inst.getTarget ();
      factors = new TIntArrayList [lblseq.numSlices ()];
      for (int i = 0; i < lblseq.numSlices (); i++) {
        LabelAlphabet dict = lblseq.getOutputAlphabet (i);
        factors[i] = new TIntArrayList (dict.size ());
        for (int j = 0; j < dict.size (); j++) {
          int idx = alphabet.lookupIndex (dict.lookupObject (j));
          factors[i].add (idx);
        }
View Full Code Here

    }

    // convenience method
    public Variable varOfIndex (int t, int j)
    {
      LabelsAssignment lblseq = (LabelsAssignment) instance.getTarget ();
      return lblseq.varOfIndex (t, j);
    }
View Full Code Here

      return lblseq.varOfIndex (t, j);
    }

    public int numSlices ()
    {
      LabelsAssignment lblseq = (LabelsAssignment) instance.getTarget ();
      return lblseq.numSlices ();
    }
View Full Code Here

    StringTokenization tokenization = new StringTokenization (buf);
    tokenization.addAll (spans);
    carrier.setData (tokenization);

    carrier.setTarget (new LabelsAssignment (new LabelsSequence (lbls)));
    return carrier;
  }
View Full Code Here

      Iterator it1 = testList.iterator ();
      Iterator it2 = returnedList.iterator ();
      while (it1.hasNext ()) {
        Instance inst = (Instance) it1.next ();
//      System.out.println ("\n\nInstance");
        LabelsAssignment lblseq = (LabelsAssignment) inst.getTarget ();
        LabelsSequence target = lblseq.getLabelsSequence ();
        LabelsSequence returned = (LabelsSequence) it2.next ();
//      System.out.println (target);
        compareLabelings (results, returned, target);
      }
View Full Code Here

    // This isn't pretty, but I swear there's
    //  not an easy way...
    private void setupAlphabet (Instance inst)
    {
      LabelsAssignment lblseq = (LabelsAssignment) inst.getTarget ();
      factors = new TIntArrayList [lblseq.numSlices ()];
      for (int i = 0; i < lblseq.numSlices (); i++) {
        LabelAlphabet dict = lblseq.getOutputAlphabet (i);
        factors[i] = new TIntArrayList (dict.size ());
        for (int j = 0; j < dict.size (); j++) {
          int idx = alphabet.lookupIndex (dict.lookupObject (j));
          factors[i].add (idx);
        }
View Full Code Here

TOP

Related Classes of cc.mallet.grmm.util.LabelsAssignment

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.