def get_idx_from_sent(sent, word_idx_map, max_l=51, k=300, filter_h=5):
 x = []
 pad = (filter_h - 1)
 for i in xrange(pad):
  x.append(0)
 words = sent.split()
 for word in words:
  if (word in word_idx_map):
   x.append(word_idx_map[word])
 while (len(x) < (max_l + (2 * pad))):
  x.append(0)
 return x

def get_idx_from_sent ( sent , word_idx_map , max_l = 51 , k = 300 , filter_h = 5 ) : x = [ ] pad = ( filter_h - 1 ) for i in xrange ( pad ) : x . append ( 0 ) words = sent . split ( ) for word in words : if ( word in word_idx_map ) : x . append ( word_idx_map [ word ] ) while ( len ( x ) < ( max_l + ( 2 * pad ) ) ) : x . append ( 0 ) return x
transforms sentence into a list of indices .