Skip to content

Commit 5e34b9f

Browse files
committed
Minor fixes interactive simulation
1 parent 11d4304 commit 5e34b9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

interactive_captioning_simulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ def generate_constrained_hypothesis(beam_searcher, src_seq, fixed_words_user, pa
122122
for ii in range(i + 1, len(unk_words)):
123123
hypothesis.append(unk_words[ii])
124124
else: # We put each unknown word in the corresponding gap
125-
for i, index in enumerate(unk_indices):
125+
for i, index in list(enumerate(unk_indices)):
126126
if index < len(hypothesis):
127-
hypothesis[index] = unk_words[i]
127+
hypothesis[index] = list(unk_words)[i]
128128
else:
129129
hypothesis.append(unk_words[i])
130130

@@ -458,7 +458,7 @@ def interactive_simulation():
458458
logger.debug(u"Cutting hypothesis")
459459

460460
# 2.4 Security assertion
461-
assert hypothesis == reference, "Error: The final hypothesis does not match with the reference! \n" \
461+
assert hypothesis in references, "Error: The final hypothesis does not match with the reference! \n" \
462462
"\t Split: %s \n" \
463463
"\t Sentence: %d \n" \
464464
"\t Hypothesis: %s\n" \

0 commit comments

Comments
 (0)