Skip to content

Commit

Permalink
evaluation problem fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
budzianowski committed Oct 17, 2018
1 parent 23acc39 commit e4922d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions model/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ def evaluateGeneratedDialogue(dialog, goal, realDialogue, real_requestables):
match_stat = 0
if domain in ['restaurant', 'hotel', 'attraction', 'train']:
goal_venues = queryResultVenues(domain, goal[domain]['informable'], real_belief=True)
if len(venue_offered[domain]) > 0 and venue_offered[domain][0] in goal_venues:
if type(venue_offered[domain]) is str and '_name' in venue_offered[domain]:
match += 1
match_stat = 1
elif '_name' in venue_offered[domain]:
elif len(venue_offered[domain]) > 0 and venue_offered[domain][0] in goal_venues:
match += 1
match_stat = 1
else:
Expand Down Expand Up @@ -259,7 +259,6 @@ def evaluateGeneratedDialogue(dialog, goal, realDialogue, real_requestables):
return success, match, stats



def evaluateRealDialogue(dialog, filename):
"""Evaluation of the real dialogue.
First we loads the user goal and then go through the dialogue history.
Expand Down Expand Up @@ -359,14 +358,15 @@ def evaluateRealDialogue(dialog, filename):
if domain in ['restaurant', 'hotel', 'attraction', 'train']:
goal_venues = queryResultVenues(domain, dialog['goal'][domain]['info'], real_belief=True)
#print(goal_venues)
if len(venue_offered[domain]) > 0 and venue_offered[domain][0] in goal_venues:
if type(venue_offered[domain]) is str and '_name' in venue_offered[domain]:
match += 1
match_stat = 1
elif '_name' in venue_offered[domain]:
elif len(venue_offered[domain]) > 0 and venue_offered[domain][0] in goal_venues:
match += 1
match_stat = 1

else:
if '[' + domain + '_name]' in venue_offered[domain]:
if domain + '_name' in venue_offered[domain]:
match += 1
match_stat = 1

Expand Down

0 comments on commit e4922d6

Please sign in to comment.