Skip to content

Commit

Permalink
Ability to disable scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kukiela committed Apr 5, 2018
1 parent 481c11d commit d175da3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ def answer_subsentence_diffrence_by_distance(index, question, answer):
# Score response
def score_answers(question, answers):

# Scoring enabled?
if not score_settings['use_scoring']:
return {'score': list(reversed(range(-len(answers) + 1, 1))), 'score_modifiers': [] * len(answers)}

# Functions to run
functions = [
check_urls,
Expand Down
6 changes: 6 additions & 0 deletions setup/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
# response score settings
score = {

# Either to use scoring or score responses by order only
'use_scoring': True,

# File with blacklisted answers
'answers_subsentence_score_file': os.path.join(package_path, 'setup/answers_subsentence_score.txt'),

Expand Down Expand Up @@ -235,3 +238,6 @@

if preprocessing['joined_vocab']:
hparams['share_vocab'] = True

if not score['use_scoring']:
score['bad_response_threshold'] = 0

0 comments on commit d175da3

Please sign in to comment.