def read_file(filepath):
    """
	for a given file, change it into list of words and numbers, will call this in build_trie

	Parameters
	----------
	filepath: Name of the file we will use

	Return
	------
	a list of words and a list of corresponding weights


	"""
    file = open(filepath, 'r', encoding='utf-8')
    data = file.readlines()
    data_list = []
    for i in range(len(data)):
        if i != 0:
            data_list.append(data[i])
    num_list = []
    word_list = []
    for l in data_list:
        if l != '\n':
            entry = l.split('\t')
            num_list.append(int(entry[0]))
            word_list.append(entry[1][:-1])
    return num_list, word_list
