1. abhimanu
  2. textgrounder_temporal

Commits

abhimanu  committed c9f772b

bug introduced due to error analysis; casting everything to TemporalDirichletSmoothedDistribution

  • Participants
  • Parent commits 039c442
  • Branches textgrounder

Comments (0)

Files changed (1)

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

View file
     if(res.pred_degdist>parameters.analysis_error_limit)
     	stats.record_worst_predictions(res.document,res.pred_degdist, res.true_rank, 
         res.true_cell.asInstanceOf[TemporalCell], res.pred_cell)
+    if(res.document.dist.isInstanceOf[TemporalDirichletSmoothedWordDist]) 
+    { 
     val dist = res.document.dist.asInstanceOf[TemporalDirichletSmoothedWordDist]
     val all_words_dist = dist.factory.overall_word_probs
     for (word <- dist.counts.keys){
       if(all_words_dist.contains(word))
     	  stats.record_word_errors(dist.getWordFromInt(word),res.pred_degdist, parameters.analysis_word_document_frequency_limit)
-    }
+    	}
+    } 
+//    else if(res.document.dist.isInstanceOf[TemporalSmoothedWordDist]){
+//    val dist = res.document.dist.asInstanceOf[TemporalSmoothedWordDist]
+//    val all_words_dist = dist.factory.overall_word_probs
+//    for (word <- dist.counts.keys){
+//      if(all_words_dist.contains(word))
+//    	  stats.record_word_errors(dist.getWordFromInt(word),res.pred_degdist, parameters.analysis_word_document_frequency_limit)
+//    	}
+//    }
   }
 
   override def record_one_oracle_result(stats: TBasicEvalStats,