Package cc.mallet.types

Examples of cc.mallet.types.IDSorter


    int[] topicCounts = new int[ numTopics ];

    IDSorter[] sortedTopics = new IDSorter[ numTopics ];
    for (int topic = 0; topic < numTopics; topic++) {
      // Initialize the sorters with dummy values
      sortedTopics[topic] = new IDSorter(topic, topic);
    }

    if (max < 0 || max > numTopics) {
      max = numTopics;
    }
View Full Code Here


        wordCount+=count;
       
        IDSorter[] sortedTypes = new IDSorter[numTypes];
        //sort word in topic k
        for (int type=0; type < numTypes; type++) {
          sortedTypes[type] = new IDSorter(type, nkt.get(k)[type]);
        }
       
        Arrays.sort(sortedTypes);
     
        Alphabet alphabet = instances.getDataAlphabet();
View Full Code Here

          wordCount+=nk.get(k);
         
          IDSorter[] sortedTypes = new IDSorter[numTypes];
          //sort word in topic k
          for (int type=0; type < numTypes; type++) {
            sortedTypes[type] = new IDSorter(type, nkt.get(k)[type]);
          }
         
          Arrays.sort(sortedTypes);
       
          Alphabet alphabet = instances.getDataAlphabet();
View Full Code Here

            DataBag topic = BagFactory.getInstance().newDefaultBag();
           
            // Get the set of keywords with weights for this topic and add them as tuples
            // to the databag used to represent this topic
            while (iterator.hasNext() && topic.size() < numKeywords) {
                IDSorter info = iterator.next();
                Tuple weightedWord = TupleFactory.getInstance().newTuple(2);
                String wordToken = model.alphabet.lookupObject(info.getID()).toString(); // get the actual term text
                weightedWord.set(0, wordToken);
                weightedWord.set(1, info.getWeight()); // the raw weight of the term
                topic.add(weightedWord);
            }
            Tuple topicTuple = TupleFactory.getInstance().newTuple(2);
            topicTuple.set(0, topicNum);
            topicTuple.set(1, topic);
View Full Code Here

TOP

Related Classes of cc.mallet.types.IDSorter

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.