Skip to content

Commit

Permalink
Minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gangeli committed Sep 8, 2011
1 parent cfe50e5 commit 9d25439
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
14 changes: 7 additions & 7 deletions run
Expand Up @@ -18,7 +18,7 @@ env!(
o('Xrunhprof:cpu=samples'),
# o('Xrunhprof:cpu=samples,heap=sites'),
o('server'),
o('Xmx3000M'),
o('Xmx2500M'),
o('ea'),
'time.Entry',

Expand All @@ -36,7 +36,7 @@ env!(
'2', #G n^3 + V k logk combined mult/merge (special case of 3)
'3'), #G n^3 + |D_max| k logk lazy evaluation
o('rulePrior', 0.001),
o('lexPrior', 0.001),
selo(nil,'lexPrior', 0.1,0.01,0.001),
selo(1,'ckyCountType',
'all',
'bestAll',
Expand Down Expand Up @@ -65,7 +65,7 @@ env!(
# o('allowPartialTime'),
# o('hardEM'),
# <training>
o('beam', 100),
selo(nil,'beam', 100,1000),
o('iters', 20),
o('scoreBeam', 5),
o('maxSearchTime', 10000),
Expand All @@ -89,10 +89,10 @@ env!(
# o('instantAsDay'),

# -- DATA --
o('train', 'NYT[0,100]'),
o('dev', 'NYT[1000,1020]'),
# o('train', 'English[0,142]'),
# o('dev', 'English[142,162]'),
# o('train', 'NYT[0,1000]'),
# o('dev', 'NYT[1000,1100]'),
o('train', 'English[0,142]'),
o('dev', 'English[142,162]'),
o('test', 'English[162,182]'), #real test data
o('devTest'), #uncomment for real test

Expand Down
5 changes: 4 additions & 1 deletion src/time/DataProcessors.scala
Expand Up @@ -724,7 +724,10 @@ abstract class TempEval2RetokTask extends Task[CoreMapDatum] {
}
println("TAGGING " + lang)
val lemma = new MorphaAnnotator(false)
val pos = new POSTaggerAnnotator(false)
val pos = new POSTaggerAnnotator(
System.getenv("HOME") +
"/lib/data/bidirectional-distsim-wsj-0-18.tagger",
false)
(0 until d.numExamples).foreach{ case (docIndex:Int) =>
//(process)
val map:Annotation
Expand Down
12 changes: 6 additions & 6 deletions src/time/Entry.scala
Expand Up @@ -160,19 +160,19 @@ object U {
def rand:Double = G.random.nextDouble
def randInt(begin:Int,end:Int):Int = G.random.nextInt(end-begin)+begin

private val isInt = """^(\-?[0-9]+)$""".r
private val canInt = """^(\-?[0-9]+\.0+)$""".r
private val IsInt = """^(\-?[0-9]+)$""".r
private val CanInt = """^\-?[0-9]+(\.0+)?(E[0-9]+)?$""".r
def isInt(str:String):Boolean = {
str match {
case isInt(e) => true
case canInt(e) => true
case IsInt(e) => true
case CanInt(e,f) => true
case _ => false
}
}
def str2int(str:String):Int = {
str match {
case isInt(e) => str.toInt
case canInt(e) => str.toDouble.toInt
case IsInt(e) => str.toInt
case CanInt(e,f) => str.toDouble.toInt
case _ => throw new IllegalArgumentException("Not an integer: " + str)
}
}
Expand Down

0 comments on commit 9d25439

Please sign in to comment.