(questions, nlp)
return questions_matrix
Sums the word vectors of all the tokens in a question
	
	Input:
	questions: list of unicode objects
	nlp: an instance of the class English() from spacy.en

	Output:
	A numpy array of shape: (nb_samples, word_vec_dim)
Sums the word vectors of all the tokens in a question
	
	Input:
	questions: list of unicode objects
	nlp: an instance of the class English() from spacy.en
Sums the word vectors of all the tokens in a question Input : questions : list of unicode objects nlp : an instance of the class English () from spacy . en
def get_questions_matrix_sum(questions, nlp):
	'''
	Sums the word vectors of all the tokens in a question
	
	Input:
	questions: list of unicode objects
	nlp: an instance of the class English() from spacy.en

	Output:
	A numpy array of shape: (nb_samples, word_vec_dim)	
	'''
	assert not isinstance(questions, basestring)
	nb_samples = len(questions)
	word_vec_dim = nlp(questions[0])[0].vector.shape[0]
	questions_matrix = np.zeros((nb_samples, word_vec_dim))
	for i in xrange(len(questions)):
		tokens = nlp(questions[i])
		for j in xrange(len(tokens)):
			questions_matrix[i,:] += tokens[j].vector

	return questions_matrix
def get_questions_matrix_sum ( questions , nlp ) : assert not isinstance ( questions , basestring ) nb_samples = len ( questions ) word_vec_dim = nlp ( questions [ 0 ] ) [ 0 ] . vector . shape [ 0 ] questions_matrix = np . zeros ( ( nb_samples , word_vec_dim ) ) for i in xrange ( len ( questions ) ) : tokens = nlp ( questions [ i ] ) for j in xrange ( len ( tokens ) ) : questions_matrix [ i , : ] += tokens [ j ] . vector return questions_matrix