In my code, I get the Person recognition from the first classifier, and for the second one which I made, I added some words to be recognized or annotated as Organization but it does not annotate Person.
I need to get the benefit from the two of them, how can I do that?
I'm using Netbeans, and this is the code:
String serializedClassifier = "classifiers/english.all.3class.distsim.crf.ser.gz";
String serializedClassifier2 = "/Users/ha/stanford-ner-2014-10-26/classifiers/dept-model.ser.gz";
if (args.length > 0) {
serializedClassifier = args[0];
}
AbstractSequenceClassifier<CoreLabel> classifier = CRFClassifier.getClassifier(serializedClassifier);
AbstractSequenceClassifier<CoreLabel> classifier2 = CRFClassifier.getClassifier(serializedClassifier2);
String fileContents = IOUtils.slurpFile("/Users/ha/NetBeansProjects/NERtry/src/nertry/input.txt");
List<List<CoreLabel>> out = classifier.classify(fileContents);
List<List<CoreLabel>> out2 = classifier2.classify(fileContents);
for (List<CoreLabel> sentence : out) {
System.out.print("\nenglish.all.3class.distsim.crf.ser.gz: ");
for (CoreLabel word : sentence) {
System.out.print(word.word() + '/' + word.get(CoreAnnotations.AnswerAnnotation.class) + ' ');
}
for (List<CoreLabel> sentence2 : out2) {
System.out.print("\ndept-model.ser.gz");
for (CoreLabel word2 : sentence2) {
System.out.print(word2.word() + '/' + word2.get(CoreAnnotations.AnswerAnnotation.class) + ' ');
}
System.out.println();
}
}
The problem comes from the result I get:
english.all.3class.distsim.crf.ser.gz: What/O date/O did/O James/PERSON started/O his/O job/O in/O Human/O and/O Finance/O ?/O
dept-model.ser.gzWhat/O date/O did/O James/ORGANIZATION started/O his/O job/O in/O Human/ORGANIZATION and/O Finance/ORGANIZATION ?/O
where it recognize the names as organization from the second classifier, and I need it to be annotated as PERSON. Any help?