Commit 1b04826e9c8d19c7e829cb9b9261112b8918d6b3
1 parent
c9b1021d
release
Showing
3 changed files
with
14 additions
and
0 deletions
nicolas-train/src/main/java/pl/waw/ipipan/zil/summ/nicolas/eval/SummarizeTestCorpus.java
... | ... | @@ -57,7 +57,11 @@ public class SummarizeTestCorpus { |
57 | 57 | |
58 | 58 | private static Map<String, String> summarizeTexts(Map<String, TText> id2preprocessedText, Nicolas nicolas) throws NicolasException { |
59 | 59 | Map<String, String> id2summary = Maps.newHashMap(); |
60 | + int textNumber = 0; | |
60 | 61 | for (Map.Entry<String, TText> entry : id2preprocessedText.entrySet()) { |
62 | + if (textNumber++ % 10 == 0) { | |
63 | + LOG.info("{} texts summarized.", textNumber); | |
64 | + } | |
61 | 65 | TText text = entry.getValue(); |
62 | 66 | int targetSize = calculateTargetSize(text); |
63 | 67 | String summary = nicolas.summarizeThrift(text, targetSize); |
... | ... |
nicolas-train/src/main/java/pl/waw/ipipan/zil/summ/nicolas/train/model/Settings.java
... | ... | @@ -4,6 +4,7 @@ import weka.classifiers.Classifier; |
4 | 4 | import weka.classifiers.meta.AttributeSelectedClassifier; |
5 | 5 | import weka.classifiers.trees.LMT; |
6 | 6 | import weka.classifiers.trees.RandomForest; |
7 | +import weka.classifiers.trees.RandomTree; | |
7 | 8 | |
8 | 9 | public class Settings { |
9 | 10 | |
... | ... | @@ -16,6 +17,10 @@ public class Settings { |
16 | 17 | |
17 | 18 | public static Classifier getMentionClassifier() { |
18 | 19 | RandomForest classifier = new RandomForest(); |
20 | + RandomTree tree = new RandomTree(); | |
21 | + tree.setMaxDepth(10); | |
22 | + tree.setMinNum(2); | |
23 | + classifier.setClassifier(tree); | |
19 | 24 | classifier.setNumIterations(NUM_ITERATIONS); |
20 | 25 | classifier.setSeed(SEED); |
21 | 26 | classifier.setNumExecutionSlots(NUM_EXECUTION_SLOTS); |
... | ... | @@ -24,6 +29,10 @@ public class Settings { |
24 | 29 | |
25 | 30 | public static Classifier getSentenceClassifier() { |
26 | 31 | RandomForest classifier = new RandomForest(); |
32 | + RandomTree tree = new RandomTree(); | |
33 | + tree.setMaxDepth(10); | |
34 | + tree.setMinNum(2); | |
35 | + classifier.setClassifier(tree); | |
27 | 36 | classifier.setNumIterations(NUM_ITERATIONS); |
28 | 37 | classifier.setSeed(SEED); |
29 | 38 | classifier.setNumExecutionSlots(NUM_EXECUTION_SLOTS); |
... | ... |
nicolas-train/src/main/java/pl/waw/ipipan/zil/summ/nicolas/train/pipeline/TrainAllModels.java
... | ... | @@ -44,6 +44,7 @@ public class TrainAllModels { |
44 | 44 | LOG.info("Building classifier..."); |
45 | 45 | classifier.buildClassifier(instances); |
46 | 46 | LOG.info("...done. Build classifier: {}", classifier); |
47 | + instances.clear(); | |
47 | 48 | |
48 | 49 | String target = TARGET_MODEL_DIR + targetPath; |
49 | 50 | LOG.info("Saving classifier at: {}", target); |
... | ... |