Commit 8b492eb07bb7064e3529737e4170adf609932dd6
1 parent
1ed8f98c
Add head_model and nominal_mention_model command line arguments.
Showing
1 changed file
with
12 additions
and
4 deletions
src/main/java/pl/waw/ipipan/zil/core/md/Main.java
... | ... | @@ -144,7 +144,7 @@ public class Main { |
144 | 144 | |
145 | 145 | if (args.length != 2 && args.length != 3) { |
146 | 146 | logger.error("Wrong usage! should be: " + Main.class.getSimpleName() |
147 | - + " input_dir result_dir [zero_subject_model]"); | |
147 | + + " input_dir result_dir [head_model] [nominal_mention_model] [zero_subject_model]"); | |
148 | 148 | return; |
149 | 149 | } |
150 | 150 | |
... | ... | @@ -159,13 +159,21 @@ public class Main { |
159 | 159 | logger.error(outputDir + " is not a directory!"); |
160 | 160 | return; |
161 | 161 | } |
162 | - if (args.length == 3) { | |
162 | + if (args.length == 5) { | |
163 | 163 | try { |
164 | + InputStream headDetectionModelStream; | |
165 | + headDetectionModelStream = new FileInputStream(new File(args[3])); | |
166 | + headModel = new HeadDetector(headDetectionModelStream); | |
167 | + | |
168 | + InputStream nominalMentionsDetectionModelStream; | |
169 | + nominalMentionsDetectionModelStream = new FileInputStream(new File(args[4])); | |
170 | + nominalMentionModel = new NominalMentionDetector(nominalMentionsDetectionModelStream); | |
171 | + | |
164 | 172 | InputStream zeroSubjectDetectionModelStream; |
165 | - zeroSubjectDetectionModelStream = new FileInputStream(new File(args[2])); | |
173 | + zeroSubjectDetectionModelStream = new FileInputStream(new File(args[5])); | |
166 | 174 | zeroSubjectModel = new ZeroSubjectDetector(zeroSubjectDetectionModelStream); |
167 | 175 | } catch (IOException e) { |
168 | - logger.error("Unable to load model from file: " + args[2] + ": " + e, e); | |
176 | + logger.error("Unable to load model: " + e, e); | |
169 | 177 | return; |
170 | 178 | } |
171 | 179 | } |
... | ... |