Skip to content

Commit 614b936

Browse files
committed
Add a logging line which tells us which tags are in the tagger used by the srparser
1 parent 83b38bb commit 614b936

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/edu/stanford/nlp/parser/shiftreduce/ShiftReduceParser.java

+2
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ private void train(List<Pair<String, FileFilter>> trainTreebankPath,
534534
if (op.testOptions.preTag) {
535535
Timing retagTimer = new Timing();
536536
tagger = Tagger.loadModel(op.testOptions.taggerSerializedFile);
537+
log.info("Retagging with tagger model: " + op.testOptions.taggerSerializedFile);
538+
log.info("Known tags in the tagger model: " + tagger.tagSet());
537539
redoTags(binarizedTrees, tagger, nThreads);
538540
retagTimer.done("Retagging");
539541
}

src/edu/stanford/nlp/tagger/common/Tagger.java

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package edu.stanford.nlp.tagger.common;
22

33
import java.util.List;
4+
import java.util.Set;
45

56
import edu.stanford.nlp.ling.HasWord;
67
import edu.stanford.nlp.ling.TaggedWord;
@@ -24,6 +25,8 @@ public abstract class Tagger implements Function<List<? extends HasWord>,List<Ta
2425
@Override
2526
public abstract List<TaggedWord> apply(List<? extends HasWord> in);
2627

28+
public abstract Set<String> tagSet();
29+
2730
public static Tagger loadModel(String path) {
2831
// TODO: we can avoid ReflectionLoading if we instead use the
2932
// serialization mechanism in MaxentTagger. Similar to ParserGrammar

src/edu/stanford/nlp/tagger/maxent/MaxentTagger.java

+1
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ public String getTag(int index) {
358358
return tags.getTag(index);
359359
}
360360

361+
@Override
361362
public Set<String> tagSet() {
362363
return tags.tagSet();
363364
}

0 commit comments

Comments
 (0)