src/build_embeddings.py
def store_embeddings_to_txt_file(dict, filename):
	"""
	DESCRIPTION: 
	     Stores a python dictionary of the form (word, [vector of embeddings]) (which represents
	     the word embeddings matrix of our model) to a txt file. 
	INPUT:
	    dict: python dictionary of the form (word, [vector of embeddings])
	    filename: name of the file to write the word embeddings dictionary
	"""
	with open(filename, "w") as f:
		for k, v in dict.items():
			line = k + str(v) + '\n'
			f.write(str(k+' '))
			for i in v:
				f.write("%s " % i)
			f.write('\n')

	DESCRIPTION: 
	     Stores a python dictionary of the form (word, [vector of embeddings]) (which represents
	     the word embeddings matrix of our model) to a txt file. 
	INPUT:
	    dict: python dictionary of the form (word, [vector of embeddings])
	    filename: name of the file to write the word embeddings dictionary
	
Stores a python dictionary of the form (word, [vector of embeddings]) (which represents
the word embeddings matrix of our model) to a txt file.
INPUT:
dict: python dictionary of the form (word, [vector of embeddings])
filename: name of the file to write the word embeddings dictionary
Stores a python dictionary of the form ( word [ vector of embeddings ] ) ( which represents the word embeddings matrix of our model ) to a txt file . INPUT : dict : python dictionary of the form ( word [ vector of embeddings ] ) filename : name of the file to write the word embeddings dictionary
def store_embeddings_to_txt_file(dict, filename):
	with open(filename, "w") as f:
		for k, v in dict.items():
			line = k + str(v) + '\n'
			f.write(str(k+' '))
			for i in v:
				f.write("%s " % i)
			f.write('\n')
def store_embeddings_to_txt_file ( dict , filename ) : with open ( filename , "w" ) as f : for k , v in dict . items ( ) : line = k + str ( v ) + '\n' f . write ( str ( k + ' ' ) ) for i in v : f . write ( "%s " % i ) f . write ( '\n' )
DESCRIPTION:
Stores a python dictionary of the form (word, [vector of embeddings]) (which represents
the word embeddings matrix of our model) to a txt file.
DESCRIPTION : Stores a python dictionary of the form ( word [ vector of embeddings ] ) ( which represents the word embeddings matrix of our model ) to a txt file .
"""
	DESCRIPTION: 
	     Stores a python dictionary of the form (word, [vector of embeddings]) (which represents
	     the word embeddings matrix of our model) to a txt file. 
	INPUT:
	    dict: python dictionary of the form (word, [vector of embeddings])
	    filename: name of the file to write the word embeddings dictionary
	"""
dict
filename