From 612153c674be3dc5ed41390d9e4f5ca7ac769265 Mon Sep 17 00:00:00 2001 From: dtk0528 Date: Sat, 8 Apr 2017 17:01:10 +0800 Subject: [PATCH] Fix missing last word Not removing the last word in current_caption_ind --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.py b/model.py index 6163889..a82318e 100644 --- a/model.py +++ b/model.py @@ -265,7 +265,7 @@ def train(): current_video_masks[ind][:len(current_feats_vals[ind])] = 1 current_captions = current_batch['Description'].values - current_caption_ind = map(lambda cap: [wordtoix[word] for word in cap.lower().split(' ')[:-1] if word in wordtoix], current_captions) + current_caption_ind = map(lambda cap: [wordtoix[word] for word in cap.lower().split(' ') if word in wordtoix], current_captions) current_caption_matrix = sequence.pad_sequences(current_caption_ind, padding='post', maxlen=n_frame_step-1) current_caption_matrix = np.hstack( [current_caption_matrix, np.zeros( [len(current_caption_matrix),1]) ] ).astype(int)