def read_file(file_name):
    """
    :param file_name: Takes as input either the train, dev or test file names as a string
    :return: and outputs a list of lists containg datapoints consisting of a sentence (string) and a target (an integer)
    """
    with open(file_name, 'r') as text_file:
        l = []
        for line in text_file:
            l.append(line.rstrip().split('\t'))

        # Transforming target variables from stings to integers
        l = [(sentence.encode('latin-1').decode('utf-8'), int(target)) for sentence, target in l]
        return l