Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/edu/stanford/nlp/dcoref/CoNLL2011DocumentReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public Document getNextDocument()
docIterator = new DocumentIterator(curFile.getAbsolutePath(), options);
}
while ( ! docIterator.hasNext()) {
logger.info("Processed " + docIterator.docCnt + " documents in " + curFile.getAbsolutePath());
logger.finest("Processed " + docIterator.docCnt + " documents in " + curFile.getAbsolutePath());
docIterator.close();
curFileIndex++;
if (curFileIndex >= fileList.size()) {
Expand All @@ -131,7 +131,7 @@ public Document getNextDocument()
docIterator = new DocumentIterator(curFile.getAbsolutePath(), options);
}
Document next = docIterator.next();
SieveCoreferenceSystem.logger.fine("Reading document: " + next.getDocumentID());
SieveCoreferenceSystem.logger.finest("Reading document: " + next.getDocumentID());
return next;
} catch (IOException ex) {
throw new RuntimeIOException(ex);
Expand Down
2 changes: 1 addition & 1 deletion src/edu/stanford/nlp/dcoref/CoNLLMentionExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public Document nextDoc() throws Exception {
sentence.set(SemanticGraphCoreAnnotations.BasicDependenciesAnnotation.class, basicDeps);
sentence.set(SemanticGraphCoreAnnotations.EnhancedDependenciesAnnotation.class, deps);
} catch(Exception e) {
logger.log(Level.WARNING, "Exception caught during extraction of Stanford dependencies. Will ignore and continue...", e);
logger.log(Level.SEVERE, "Exception caught during extraction of Stanford dependencies. Will ignore and continue...", e);
}
}
}
Expand Down
58 changes: 29 additions & 29 deletions src/edu/stanford/nlp/dcoref/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,35 +121,35 @@ protected Constants() {} // static class but extended by jcoref

/** print the values of variables in this class */
public static void printConstants(Logger logger) {
if (Constants.USE_ANIMACY_LIST) logger.info("USE_ANIMACY_LIST on");
else logger.info("USE_ANIMACY_LIST off");
if (Constants.USE_ANIMACY_LIST) logger.info("USE_ANIMACY_LIST on");
else logger.info("USE_ANIMACY_LIST off");
if (Constants.USE_DISCOURSE_SALIENCE) logger.info("use discourse salience");
else logger.info("not use discourse salience");
if (Constants.USE_TRUECASE) logger.info("use truecase annotator");
else logger.info("not use truecase annotator");
if (Constants.USE_DISCOURSE_CONSTRAINTS) logger.info("USE_DISCOURSE_CONSTRAINTS on");
else logger.info("USE_DISCOURSE_CONSTRAINTS off");
if (Constants.USE_GOLD_POS) logger.info("USE_GOLD_POS on");
else logger.info("USE_GOLD_POS off");
if (Constants.USE_GOLD_NE) logger.info("use gold NE type annotation");
else logger.info("use Stanford NER");
if (Constants.USE_GOLD_PARSES) logger.info("USE_GOLD_PARSES on");
else logger.info("USE_GOLD_PARSES off");
if (Constants.USE_GOLD_SPEAKER_TAGS) logger.info("USE_GOLD_SPEAKER_TAGS on");
else logger.info("USE_GOLD_SPEAKER_TAGS off");
if (Constants.USE_GOLD_MENTIONS) logger.info("USE_GOLD_MENTIONS on");
else logger.info("USE_GOLD_MENTIONS off");
if (Constants.USE_GOLD_MENTION_BOUNDARIES) logger.info("USE_GOLD_MENTION_BOUNDARIES on");
else logger.info("USE_GOLD_MENTION_BOUNDARIES off");
if (Constants.USE_CONLL_AUTO) logger.info("use conll auto set -> if GOLD_NE, GOLD_PARSE, GOLD_POS, etc turned on, use auto");
else logger.info("use conll gold set -> if GOLD_NE, GOLD_PARSE, GOLD_POS, etc turned on, use gold");
if (Constants.REMOVE_SINGLETONS) logger.info("REMOVE_SINGLETONS on");
else logger.info("REMOVE_SINGLETONS off");
if (Constants.REMOVE_APPOSITION_PREDICATENOMINATIVES) logger.info("REMOVE_APPOSITION_PREDICATENOMINATIVES on");
else logger.info("REMOVE_APPOSITION_PREDICATENOMINATIVES off");
logger.info("=================================================================");
if (Constants.USE_ANIMACY_LIST) logger.fine("USE_ANIMACY_LIST on");
else logger.fine("USE_ANIMACY_LIST off");
if (Constants.USE_ANIMACY_LIST) logger.fine("USE_ANIMACY_LIST on");
else logger.fine("USE_ANIMACY_LIST off");
if (Constants.USE_DISCOURSE_SALIENCE) logger.fine("use discourse salience");
else logger.fine("not use discourse salience");
if (Constants.USE_TRUECASE) logger.fine("use truecase annotator");
else logger.fine("not use truecase annotator");
if (Constants.USE_DISCOURSE_CONSTRAINTS) logger.fine("USE_DISCOURSE_CONSTRAINTS on");
else logger.fine("USE_DISCOURSE_CONSTRAINTS off");
if (Constants.USE_GOLD_POS) logger.fine("USE_GOLD_POS on");
else logger.fine("USE_GOLD_POS off");
if (Constants.USE_GOLD_NE) logger.fine("use gold NE type annotation");
else logger.fine("use Stanford NER");
if (Constants.USE_GOLD_PARSES) logger.fine("USE_GOLD_PARSES on");
else logger.fine("USE_GOLD_PARSES off");
if (Constants.USE_GOLD_SPEAKER_TAGS) logger.fine("USE_GOLD_SPEAKER_TAGS on");
else logger.fine("USE_GOLD_SPEAKER_TAGS off");
if (Constants.USE_GOLD_MENTIONS) logger.fine("USE_GOLD_MENTIONS on");
else logger.fine("USE_GOLD_MENTIONS off");
if (Constants.USE_GOLD_MENTION_BOUNDARIES) logger.fine("USE_GOLD_MENTION_BOUNDARIES on");
else logger.fine("USE_GOLD_MENTION_BOUNDARIES off");
if (Constants.USE_CONLL_AUTO) logger.fine("use conll auto set -> if GOLD_NE, GOLD_PARSE, GOLD_POS, etc turned on, use auto");
else logger.fine("use conll gold set -> if GOLD_NE, GOLD_PARSE, GOLD_POS, etc turned on, use gold");
if (Constants.REMOVE_SINGLETONS) logger.fine("REMOVE_SINGLETONS on");
else logger.fine("REMOVE_SINGLETONS off");
if (Constants.REMOVE_APPOSITION_PREDICATENOMINATIVES) logger.fine("REMOVE_APPOSITION_PREDICATENOMINATIVES on");
else logger.fine("REMOVE_APPOSITION_PREDICATENOMINATIVES off");
logger.fine("=================================================================");
}

}
8 changes: 4 additions & 4 deletions src/edu/stanford/nlp/dcoref/CorefScorer.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ public void printF1(Logger logger, boolean printF1First) {
if (printF1First) {
String str = "F1 = "+F1+", P = "+P+" ("+(int) precisionNumSum+"/"+(int) precisionDenSum+"), R = "+R+" ("+(int) recallNumSum+"/"+(int) recallDenSum+")";
if(scoreType == ScoreType.Pairwise){
logger.fine("Pairwise "+str);
logger.finest("Pairwise "+str);
} else if(scoreType == ScoreType.BCubed){
logger.fine("B cubed "+str);
logger.finest("B cubed "+str);
} else {
logger.fine("MUC "+str);
logger.finest("MUC "+str);
}
} else {
logger.fine("& "+PP+" & "+RR + " & "+F1F1);
logger.finest("& "+PP+" & "+RR + " & "+F1F1);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/edu/stanford/nlp/dcoref/Document.java
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ private boolean findSpeaker(int utterNum, int sentNum, List<CoreMap> sentences,
}
}
} else {
SieveCoreferenceSystem.logger.warning("Cannot find node in dependency for word " + word);
SieveCoreferenceSystem.logger.info("Cannot find node in dependency for word " + word);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ protected void findHead(CoreMap s, List<Mention> mentions) {
if (start < 0 || start >= m.originalSpan.size()) {
SieveCoreferenceSystem.logger.warning("Invalid index for head " + start + "=" + m.headIndex + "-" + m.startIndex
+ ": originalSpan=[" + StringUtils.joinWords(m.originalSpan, " ") + "], head=" + m.headWord);
SieveCoreferenceSystem.logger.warning("Setting head string to entire mention");
SieveCoreferenceSystem.logger.fine("Setting head string to entire mention");
m.headIndex = m.startIndex;
m.headWord = m.originalSpan.size() > 0 ? m.originalSpan.get(0) : sent.get(m.startIndex);
m.headString = m.originalSpan.toString();
Expand Down
30 changes: 15 additions & 15 deletions src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,12 @@ public static double runAndScoreCoref(SieveCoreferenceSystem corefSystem,
conllMentionEvalErrFile = conllOutput +"-"+timeStamp+ ".eval.err.txt";
conllMentionCorefEvalFile = conllOutput +"-"+timeStamp+ ".coref.eval.txt";
conllMentionCorefEvalErrFile = conllOutput +"-"+timeStamp+ ".coref.eval.err.txt";
logger.info("CONLL MENTION GOLD FILE: " + conllOutputMentionGoldFile);
logger.info("CONLL MENTION PREDICTED FILE: " + conllOutputMentionPredictedFile);
logger.info("CONLL MENTION EVAL FILE: " + conllMentionEvalFile);
logger.fine("CONLL MENTION GOLD FILE: " + conllOutputMentionGoldFile);
logger.fine("CONLL MENTION PREDICTED FILE: " + conllOutputMentionPredictedFile);
logger.fine("CONLL MENTION EVAL FILE: " + conllMentionEvalFile);
if (!Constants.SKIP_COREF) {
logger.info("CONLL MENTION PREDICTED WITH COREF FILE: " + conllOutputMentionCorefPredictedFile);
logger.info("CONLL MENTION WITH COREF EVAL FILE: " + conllMentionCorefEvalFile);
logger.fine("CONLL MENTION WITH COREF EVAL FILE: " + conllMentionCorefEvalFile);
}
writerGold = new PrintWriter(new FileOutputStream(conllOutputMentionGoldFile));
writerPredicted = new PrintWriter(new FileOutputStream(conllOutputMentionPredictedFile));
Expand Down Expand Up @@ -502,13 +502,13 @@ public static double runAndScoreCoref(SieveCoreferenceSystem corefSystem,
// runConllEval(corefSystem.conllMentionEvalScript, conllOutputMentionGoldFile, conllOutputMentionPredictedFile, conllMentionEvalFile, conllMentionEvalErrFile);

String summary = getConllEvalSummary(corefSystem.conllMentionEvalScript, conllOutputMentionGoldFile, conllOutputMentionPredictedFile);
logger.info("\nCONLL EVAL SUMMARY (Before COREF)");
logger.fine("\nCONLL EVAL SUMMARY (Before COREF)");
printScoreSummary(summary, logger, false);

if (!Constants.SKIP_COREF) {
// runConllEval(corefSystem.conllMentionEvalScript, conllOutputMentionGoldFile, conllOutputMentionCorefPredictedFile, conllMentionCorefEvalFile, conllMentionCorefEvalErrFile);
summary = getConllEvalSummary(corefSystem.conllMentionEvalScript, conllOutputMentionGoldFile, conllOutputMentionCorefPredictedFile);
logger.info("\nCONLL EVAL SUMMARY (After COREF)");
logger.fine("\nCONLL EVAL SUMMARY (After COREF)");
printScoreSummary(summary, logger, true);
printFinalConllScore(summary);
if (corefSystem.optimizeConllScore) {
Expand Down Expand Up @@ -561,7 +561,7 @@ public static void runAndScoreCorefDist(String runDistCmd, Properties props, Str
String outStr = outSos.toString();
String errStr = errSos.toString();
logger.info("Finished distributed coref: " + runDistCmd + ", props=" + propsFile);
logger.info("Output: " + outStr);
logger.fine("Output: " + outStr);
if (errStr.length() > 0) {
logger.info("Error: " + errStr);
}
Expand Down Expand Up @@ -1216,18 +1216,18 @@ public void printF1(boolean printF1First) {
}

private void printSieveScore(Document document, DeterministicCorefSieve sieve) {
logger.fine("===========================================");
logger.fine("pass"+currentSieve+": "+ sieve.flagsToString());
logger.finest("===========================================");
logger.finest("pass"+currentSieve+": "+ sieve.flagsToString());
scoreMUC.get(currentSieve).printF1(logger);
scoreBcubed.get(currentSieve).printF1(logger);
scorePairwise.get(currentSieve).printF1(logger);
logger.fine("# of Clusters: "+document.corefClusters.size() + ",\t# of additional links: "+additionalLinksCount
logger.finest("# of Clusters: "+document.corefClusters.size() + ",\t# of additional links: "+additionalLinksCount
+",\t# of additional correct links: "+additionalCorrectLinksCount
+",\tprecision of new links: "+1.0*additionalCorrectLinksCount/additionalLinksCount);
logger.fine("# of total additional links: "+linksCountInPass.get(currentSieve).second()
logger.finest("# of total additional links: "+linksCountInPass.get(currentSieve).second()
+",\t# of total additional correct links: "+linksCountInPass.get(currentSieve).first()
+",\taccumulated precision of this pass: "+1.0*linksCountInPass.get(currentSieve).first()/linksCountInPass.get(currentSieve).second());
logger.fine("--------------------------------------");
logger.finest("--------------------------------------");
}
/** Print coref link info */
private static void printLink(Logger logger, String header, IntTuple src, IntTuple dst, List<List<Mention>> orderedMentionsBySentence) {
Expand All @@ -1248,7 +1248,7 @@ protected static void printList(Logger logger, String... args) {
sb.append(arg);
sb.append('\t');
}
logger.fine(sb.toString());
logger.finest(sb.toString());
}

/** print a coref link information including context and parse tree */
Expand Down Expand Up @@ -1481,7 +1481,7 @@ private static void printScoreSummary(String summary, Logger logger, boolean aft
sb.append(line).append("\n");
}
}
logger.info(sb.toString());
logger.finest(sb.toString());
}
}
/** Print average F1 of MUC, B^3, CEAF_E */
Expand All @@ -1494,7 +1494,7 @@ private static void printFinalConllScore(String summary) {
F1s[i++] = Double.parseDouble(f1Matcher.group(1));
}
double finalScore = (F1s[0]+F1s[1]+F1s[3])/3;
logger.info("Final conll score ((muc+bcub+ceafe)/3) = " + (new DecimalFormat("#.##")).format(finalScore));
logger.fine("Final conll score ((muc+bcub+ceafe)/3) = " + (new DecimalFormat("#.##")).format(finalScore));
}

private static double getFinalConllScore(String summary, String metricType, String scoreType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public int assignSyntacticHead(EntityMention ent, Tree tree, List<CoreLabel> tok
headPos = label.get(CoreAnnotations.BeginIndexAnnotation.class);
} else {
logger.fine("WARNING: failed to find syntactic head for entity: " + ent + " in tree: " + tree);
logger.fine("Fallback strategy: will set head to last token in mention: " + tokens.get(headPos));
logger.finest("Fallback strategy: will set head to last token in mention: " + tokens.get(headPos));
}
ent.setHeadTokenPosition(headPos);

Expand Down Expand Up @@ -430,7 +430,7 @@ private Tree findPartialSpan(Tree current, int start) {
}

private Tree funkyFindLeafWithApproximateSpan(Tree root, String token, int index, int approximateness) {
logger.fine("Looking for " + token + " at pos " + index + " plus upto " + approximateness + " in tree: " + root.pennString());
logger.finest("Looking for " + token + " at pos " + index + " plus upto " + approximateness + " in tree: " + root.pennString());
List<Tree> leaves = root.getLeaves();
for (Tree leaf : leaves) {
CoreLabel label = CoreLabel.class.cast(leaf.label());
Expand All @@ -444,7 +444,7 @@ private Tree funkyFindLeafWithApproximateSpan(Tree root, String token, int index
// but it does happen (VERY RARELY) on some weird web text that includes SGML tags with spaces
// TODO: does this mean that somehow tokenization is different for the parser? check this by throwing an Exception in KBP
logger.severe("GenericDataSetReader: WARNING: Failed to find head token");
logger.severe(" when looking for " + token + " at pos " + index + " plus upto " + approximateness + " in tree: " + root.pennString());
logger.finest(" when looking for " + token + " at pos " + index + " plus upto " + approximateness + " in tree: " + root.pennString());
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/edu/stanford/nlp/ie/machinereading/MachineReading.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public List<String> run() throws Exception {
MachineReadingProperties.logger.severe("Reading auxiliary dataset from " + MachineReadingProperties.auxDataPath + "...");
aux = loadOrMakeSerializedSentences(MachineReadingProperties.auxDataPath, auxReader, new File(
MachineReadingProperties.serializedAuxTrainingSentencesPath));
MachineReadingProperties.logger.severe("Done reading auxiliary dataset.");
MachineReadingProperties.logger.info("Done reading auxiliary dataset.");
}
}

Expand Down Expand Up @@ -355,7 +355,7 @@ private static List<String> printTask(String taskName, Set<ResultsPrinter> print
for (ResultsPrinter rp : printers){
String msg = rp.printResults(gold, pred);
retMsg.add(msg);
MachineReadingProperties.logger.severe("Overall " + taskName + " results, using printer " + rp.getClass() + ":\n" + msg);
MachineReadingProperties.logger.info("Overall " + taskName + " results, using printer " + rp.getClass() + ":\n" + msg);
}
return retMsg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private EventMention convertAceEventMention(
ExtractionObject o = entityMap.get(arg.getId());
if(o == null){
logger.severe("READER ERROR: Failed to find event argument with id " + arg.getId());
logger.severe("This happens because a few event mentions illegally span multiple sentences. Will ignore this mention.");
logger.fine("This happens because a few event mentions illegally span multiple sentences. Will ignore this mention.");
return null;
}
convertedArgs.add(o);
Expand Down Expand Up @@ -387,7 +387,7 @@ private RelationMention convertAceRelationMention(AceRelationMention aceRelation
ExtractionObject o = entityMap.get(arg.getContent().getId());
if(o == null){
logger.severe("READER ERROR: Failed to find relation argument with id " + arg.getContent().getId());
logger.severe("This happens because a few relation mentions illegally span multiple sentences. Will ignore this mention.");
logger.fine("This happens because a few relation mentions illegally span multiple sentences. Will ignore this mention.");
return null;
}
convertedArgs.add(o);
Expand All @@ -398,7 +398,7 @@ private RelationMention convertAceRelationMention(AceRelationMention aceRelation

if(argNames.size() != 2 || ! argNames.get(0).equalsIgnoreCase("arg-1") || ! argNames.get(1).equalsIgnoreCase("arg-2")){
logger.severe("READER ERROR: Invalid succession of arguments in relation mention: " + argNames);
logger.severe("ACE relations must have two arguments. Will ignore this mention.");
logger.fine("ACE relations must have two arguments. Will ignore this mention.");
return null;
}

Expand Down Expand Up @@ -436,25 +436,25 @@ private EntityMention convertAceEntityMention(AceEntityMention entityMention, St
int extEnd = ext.getTokenEnd() - tokenOffset + 1;
if (extStart < 0) {
logger.severe("READER ERROR: Invalid extent start " + extStart + " for entity mention " + entityMention.getId() + " in document " + docId + " in sentence " + sentence);
logger.severe("This may happen due to incorrect EOS detection. Adjusting entity extent.");
logger.finest("This may happen due to incorrect EOS detection. Adjusting entity extent.");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe incorrect should be in keyword set.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, actually, I think this one is good because this is about the error details rather than the error.

extStart = 0;
}
if (extEnd > sentence.get(CoreAnnotations.TokensAnnotation.class).size()) {
logger.severe("READER ERROR: Invalid extent end " + extEnd + " for entity mention " + entityMention.getId() + " in document " + docId + " in sentence " + sentence);
logger.severe("This may happen due to incorrect EOS detection. Adjusting entity extent.");
logger.finest("This may happen due to incorrect EOS detection. Adjusting entity extent.");
extEnd = sentence.get(CoreAnnotations.TokensAnnotation.class).size();
}

int headStart = head.getTokenStart() - tokenOffset;
int headEnd = head.getTokenEnd() - tokenOffset + 1;
if (headStart < 0) {
logger.severe("READER ERROR: Invalid head start " + headStart + " for entity mention " + entityMention.getId() + " in document " + docId + " in sentence " + sentence);
logger.severe("This may happen due to incorrect EOS detection. Adjusting entity head span.");
logger.finest("This may happen due to incorrect EOS detection. Adjusting entity head span.");
headStart = 0;
}
if(headEnd > sentence.get(CoreAnnotations.TokensAnnotation.class).size()){
logger.severe("READER ERROR: Invalid head end " + headEnd + " for entity mention " + entityMention.getId() + " in document " + docId + " in sentence " + sentence);
logger.severe("This may happen due to incorrect EOS detection. Adjusting entity head span.");
logger.finest("This may happen due to incorrect EOS detection. Adjusting entity head span.");
headEnd = sentence.get(CoreAnnotations.TokensAnnotation.class).size();
}

Expand Down
Loading