Skip to content

Commit

Permalink
Merge pull request #23 from kowey/config-fixes
Browse files Browse the repository at this point in the history
[MRG + 1] Config fixes
  • Loading branch information
kowey committed Jun 3, 2015
2 parents 597023e + 8a4d66e commit f9535ba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
7 changes: 7 additions & 0 deletions irit_rst_dt/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ def sanity_check_config(self):
"ERROR! -----------------^^^^^--------------------"
"").format("\n".join(bad_confs))
sys.exit(oops)
if TEST_EVALUATION_KEY is not None and TEST_CORPUS is None:
oops = ("Sorry, there's an error in your configuration:\n"
"You have requested a test evaluation, but have not "
"specified a test corpus to run.\n"
"Hint: it's ok to specify a test corpus without "
"specifiying a test eval")
sys.exit(oops)
if TEST_EVALUATION_KEY is not None and self.test_evaluation is None:
oops = ("Sorry, there's an error in your configuration.\n"
"I don't dare to start evaluation until you fix it.\n"
Expand Down
25 changes: 13 additions & 12 deletions irit_rst_dt/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
combined_key,
decoder_last,
decoder_local,
# mk_joint,
mk_post)
mk_joint,
#mk_post,
)

# PATHS

Expand Down Expand Up @@ -73,8 +74,8 @@
needed.
"""

TEST_CORPUS = None
# TEST_CORPUS = 'tiny'
# TEST_CORPUS = None
TEST_CORPUS = 'corpus/RSTtrees-WSJ-main-1.0/TEST'
"""Corpora for use in FINAL testing.
You should probably leave this set to None until you've tuned and
Expand All @@ -86,7 +87,7 @@
"""

TEST_EVALUATION_KEY = None
# TEST_EVALUATION_KEY = 'maxent-AD.L_jnt-mst'
# TEST_EVALUATION_KEY = 'maxent-AD.L-jnt-mst'
"""Evaluation to use for testing.
Leave this to None until you think it's OK to look at the test data.
Expand Down Expand Up @@ -208,16 +209,16 @@ def _core_parsers(klearner):
"""
# joint
joint = [
# mk_joint(klearner, decoder_last()),
# mk_joint(klearner, DECODER_LOCAL),
# mk_joint(klearner, decoder_mst()),
mk_joint(klearner, decoder_last()),
mk_joint(klearner, DECODER_LOCAL),
mk_joint(klearner, decoder_mst()),
]

# postlabeling
post = [
mk_post(klearner, decoder_last()),
mk_post(klearner, DECODER_LOCAL),
mk_post(klearner, decoder_mst()),
# mk_post(klearner, decoder_last()),
# mk_post(klearner, DECODER_LOCAL),
# mk_post(klearner, decoder_mst()),
]
if klearner.attach.payload.can_predict_proba:
return joint + post
Expand Down Expand Up @@ -269,7 +270,7 @@ def _mk_last_intras(klearner, kconf):
"""
kconf = Keyed(key=combined_key('last', kconf),
payload=kconf.payload)
econf_last = mk_post(klearner, decoder_last())
econf_last = mk_joint(klearner, decoder_last())
return [combine_intra(IntraInterPair(intra=econf_last, inter=p),
kconf,
primary='inter')
Expand Down

0 comments on commit f9535ba

Please sign in to comment.