Commits

Anonymous committed 496d3e4

test for uniform prior for Bayes

Comments (0)

Files changed (3)

Binary file modified.

src/main/scala/opennlp/textgrounder/app/RunApps.scala

     
     if(args.length==0){
     println("default args")
-    val args = new Array[String](14)
+    val args = new Array[String](16)
     args(0) = "--input-corpus"
 //    args(1) = "/home/abhimanu/textgrounder_temporal/data/corpora/temporal/docthresh-5"
-    args(1) = "/home/abhimanu/datasets/textgrounder/temporal/wiki-bio/" //wiki-bio gutts wiki-years
+    args(1) = "/home/abhimanu/datasets/textgrounder/temporal/gutts/" //wiki-bio gutts wiki-years
     args(2) = "--width-of-multi-cell"
     args(3) = "30"
     args(4) = "--eval-set"
     args(5) = "dev"
     args(6) = "--word-dist"
-    args(7) = "cikm"//"temporal-dirichlet" or "cikm"
+    args(7) = "temporal-dirichlet"//"temporal-dirichlet" or "cikm"
     args(8) = "--num-test-docs"
     args(9) = "10000"
     args(10) = "--strategy"			
-    args(11) = "partial-kl-divergence"	//partial-kl-divergence 
+    args(11) = "naive-bayes-with-baseline"	//partial-kl-divergence 
     									//naive-bayes-with-baseline (equal weight for prior)
     									//naive-bayes-no-baseline ()
     //NOTE: Naive Bayes has been currently coded for only Dirichlet/JM Smoothing
     //By default Bayes is chronon-docs
     args(12) = "--smoothing-par"
-    args(13) = "0.01"					//for JM=0.99  and cikm = 0.01
+    args(13) = "0.99"					//for JM=0.99  and cikm = 0.01
+    args(14) = "--bayes-prior"
+    args(15) = "chronon-docs"  					//"uniform" "chronon-docs"
+      //NOTE: always remeber to set "temporal-dirichlet" before doing bayes
     TemporalDocumentApp.main(args)
     } else  TemporalDocumentApp.main(args)
   }

src/main/scala/opennlp/textgrounder/temporal/TemporalResolution.scala

     val word_logprob =
       cell.combined_dist.word_dist.get_nbayes_logprob_smoothed(word_dist,params.smoothing_parameter)
     var baseline_logprob = 1.0/cell_grid.total_num_cells //uniform prior
-    println(baseline_logprob)
+//    println(baseline_logprob)
     if(params.bayes_prior=="chronon-docs"){
     	baseline_logprob = log(cell.combined_dist.num_docs_for_links.toDouble /
           cell_grid.total_num_docs_for_links)