Ejemplo n.º 1
0
  public void persistentDocumentStream() throws IOException, URISyntaxException {
    //	lda.getLda().write(new File(this.rootDir+"model.mallet"));
    //	lda.getLda().printTopWords(new File(this.rootDir+"words.txt"), 10, false);

    //	if(settings.localStore)
    lda.getLda().write(new File(this.rootDir + "model.mallet"));

    // persistent words per topic
    if (settings.hbaseImport) {

      List<Phrases> phrasesList = lda.getLda().getPhrases();

      for (int k = 0; k < phrasesList.size(); k++) {
        Phrases phrases = phrasesList.get(k);
        List<NGram> words = phrases.getSortedNGrams(settings.maxWordsPerTopic, 0);

        HBaseProxyManager.getProxy().putWords(words, k, ts);
      }
    }
  }