1. abhimanu
  2. textgrounder_temporal

Commits

abhimanu  committed 039c442

Error Analysis code for the paper (only including words in training)

  • Participants
  • Parent commits 7019c83
  • Branches textgrounder

Comments (0)

Files changed (2)

File .cache

  • Ignore whitespace
Binary file modified.

File src/main/scala/opennlp/textgrounder/temporal/TemporalEvaluation.scala

View file
  • Ignore whitespace
     	stats.record_worst_predictions(res.document,res.pred_degdist, res.true_rank, 
         res.true_cell.asInstanceOf[TemporalCell], res.pred_cell)
     val dist = res.document.dist.asInstanceOf[TemporalDirichletSmoothedWordDist]
+    val all_words_dist = dist.factory.overall_word_probs
     for (word <- dist.counts.keys){
-      stats.record_word_errors(dist.getWordFromInt(word),res.pred_degdist, parameters.analysis_word_document_frequency_limit)
+      if(all_words_dist.contains(word))
+    	  stats.record_word_errors(dist.getWordFromInt(word),res.pred_degdist, parameters.analysis_word_document_frequency_limit)
     }
   }