You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lt.lm/src/main/java/de/tudarmstadt/lt/lm/app/PerplexityClient.java
+35-11Lines changed: 35 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,8 @@ public PerplexityClient(String args[]) {
68
68
opts.addOption(OptionBuilder.withLongOpt("port").withArgName("port-number").hasArg().withDescription(String.format("Specifies the port on which the rmi registry listens (default: %d).", Registry.REGISTRY_PORT)).create("p"));
69
69
opts.addOption(OptionBuilder.withLongOpt("selftest").withDescription("Run a selftest, compute perplexity of ngrams in specified LM.").create("s"));
70
70
opts.addOption(OptionBuilder.withLongOpt("quiet").withDescription("Run with minimum outout on stdout.").create("q"));
71
-
opts.addOption(OptionBuilder.withLongOpt("noov").hasOptionalArg().withArgName("{true|false}").withDescription("Do not consider oov terms, i.e. ngrams that end in an oov term. (default: false)").create());
71
+
opts.addOption(OptionBuilder.withLongOpt("skipoov").hasOptionalArg().withArgName("{true|false}").withDescription("Do not consider oov terms, i.e. ngrams that end in an oov term. (default: false)").create());
72
+
opts.addOption(OptionBuilder.withLongOpt("skipoovreflm").hasOptionalArg().withArgName("{true|false}").withDescription("Do not consider oov terms regarding the oovreflm, i.e. ngrams that end in an oov term. (default: false)").create());
72
73
opts.addOption(OptionBuilder.withLongOpt("oovreflm").withArgName("identifier").hasArg().withDescription("Do not consider oov terms with respect to the provided lm, i.e. ngrams that end in an oov term in the referenced lm. (default use current lm)").create());
73
74
opts.addOption(OptionBuilder.withLongOpt("host").withArgName("hostname").hasArg().withDescription("Specifies the hostname on which the rmi registry listens (default: localhost).").create("h"));
74
75
opts.addOption(OptionBuilder.withLongOpt("file").withArgName("name").hasArg().withDescription("Specify the file or directory that contains '.txt' files that are used as source for testing perplexity with the specified language model. Specify '-' to pipe from stdin. (default: '-').").create("f"));
@@ -89,9 +90,13 @@ public PerplexityClient(String args[]) {
@@ -114,6 +119,7 @@ public PerplexityClient(String args[]) {
114
119
boolean_selftest;
115
120
boolean_quiet;
116
121
boolean_no_oov;
122
+
boolean_no_oov_reflm;
117
123
boolean_one_ngram_per_line;
118
124
PrintStream_pout;
119
125
@@ -126,6 +132,8 @@ public PerplexityClient(String args[]) {
126
132
ModelPerplexity<String> _perplexity_all = null;
127
133
ModelPerplexity<String> _perplexity_file = null;
128
134
135
+
long_oovreflm_oov_terms = 0;
136
+
long_oovreflm_oov_ngrams = 0;
129
137
long_oov_terms = 0;
130
138
long_oov_ngrams = 0;
131
139
long_num_ngrams = 0;
@@ -192,22 +200,30 @@ public boolean accept(File f) {
192
200
try{ run(newInputStreamReader(newFileInputStream(f), "UTF-8")); }catch(Exceptione){LOG.error("{}: Could not compute perplexity from file '{}'.", _rmi_string, f.getAbsolutePath(), e);}
0 commit comments