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 { ...@@ -33,7 +33,7 @@ public abstract class Filebase implements Closeable {
} }
} }
try { try {
this.index = new FilebaseIndex(getModelFile("index")); this.index = new FilebaseIndex(modelDir);
} catch (IOException e) { } catch (IOException e) {
throw new FilebaseException("could not read index: " + e.getMessage()); throw new FilebaseException("could not read index: " + e.getMessage());
} }
......
...@@ -59,12 +59,10 @@ public class DTMAnalyzer extends Analyzer { ...@@ -59,12 +59,10 @@ public class DTMAnalyzer extends Analyzer {
this.outDirSeq = new File(outDir, "lda-seq"); this.outDirSeq = new File(outDir, "lda-seq");
this.vocab = new DTMVocabulary(modelDir); this.vocab = new DTMVocabulary(modelDir);
this.sequences = new DTMSequenceIndex(modelDir); this.sequences = new DTMSequenceIndex(modelDir);
index = new FilebaseIndex(modelDir); this.index = new FilebaseIndex(modelDir);
this.dbArticles = MongoService.getDatabaseService(config, ArticleFull.class);
config = Config.getConfig(); this.dbTopics = MongoService.getDatabaseService(config, TopicFull.class);
dbArticles = MongoService.getDatabaseService(config, ArticleFull.class); this.dbWords = MongoService.getDatabaseService(config, Word.class);
dbTopics = MongoService.getDatabaseService(config, TopicFull.class);
dbWords = MongoService.getDatabaseService(config, Word.class);
} catch (ConfigException | IOException | ParseException e) { } catch (ConfigException | IOException | ParseException e) {
throw new AnalyzerException(e); throw new AnalyzerException(e);
} }
......
...@@ -7,6 +7,7 @@ import java.io.IOException; ...@@ -7,6 +7,7 @@ import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
...@@ -213,6 +214,8 @@ public class JGibbAnalyzer extends Analyzer { ...@@ -213,6 +214,8 @@ public class JGibbAnalyzer extends Analyzer {
ref.setShare((double) ref.getCount() / reducedCount); ref.setShare((double) ref.getCount() / reducedCount);
if (!newTopicRefs.isEmpty()) { if (!newTopicRefs.isEmpty()) {
Collections.sort(newTopicRefs, Comparator.reverseOrder());
// update article with topic references (partial update) // update article with topic references (partial update)
ArticleFull article = new ArticleFull(); ArticleFull article = new ArticleFull();
article.setId(index.get(articleIndex++)); article.setId(index.get(articleIndex++));
......
...@@ -4,5 +4,5 @@ db.name=test ...@@ -4,5 +4,5 @@ db.name=test
es.host=localhost es.host=localhost
es.port=9300 es.port=9300
tm.processor=corenlp tm.processor=corenlp
tm.analyzer=dtm tm.analyzer=jgibb
tm.dtmpath=/home/eike/repos/master/dtm_release/dtm/main 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