Skip to content
Snippets Groups Projects
Commit 840a49ee authored by Eike Cochu's avatar Eike Cochu
Browse files

fixed jgibb modeling problems

fixed index file created as directory
added topicref initial reverse sorting
removed unused config reference
parent 2a2fa619
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ public abstract class Filebase implements Closeable {
}
}
try {
this.index = new FilebaseIndex(getModelFile("index"));
this.index = new FilebaseIndex(modelDir);
} catch (IOException e) {
throw new FilebaseException("could not read index: " + e.getMessage());
}
......
......@@ -59,12 +59,10 @@ public class DTMAnalyzer extends Analyzer {
this.outDirSeq = new File(outDir, "lda-seq");
this.vocab = new DTMVocabulary(modelDir);
this.sequences = new DTMSequenceIndex(modelDir);
index = new FilebaseIndex(modelDir);
config = Config.getConfig();
dbArticles = MongoService.getDatabaseService(config, ArticleFull.class);
dbTopics = MongoService.getDatabaseService(config, TopicFull.class);
dbWords = MongoService.getDatabaseService(config, Word.class);
this.index = new FilebaseIndex(modelDir);
this.dbArticles = MongoService.getDatabaseService(config, ArticleFull.class);
this.dbTopics = MongoService.getDatabaseService(config, TopicFull.class);
this.dbWords = MongoService.getDatabaseService(config, Word.class);
} catch (ConfigException | IOException | ParseException e) {
throw new AnalyzerException(e);
}
......
......@@ -7,6 +7,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
......@@ -213,6 +214,8 @@ public class JGibbAnalyzer extends Analyzer {
ref.setShare((double) ref.getCount() / reducedCount);
if (!newTopicRefs.isEmpty()) {
Collections.sort(newTopicRefs, Comparator.reverseOrder());
// update article with topic references (partial update)
ArticleFull article = new ArticleFull();
article.setId(index.get(articleIndex++));
......
......@@ -4,5 +4,5 @@ db.name=test
es.host=localhost
es.port=9300
tm.processor=corenlp
tm.analyzer=dtm
tm.analyzer=jgibb
tm.dtmpath=/home/eike/repos/master/dtm_release/dtm/main
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment