def read_IMDB(file_name):
    """
    :param file_name: Takes as input the IMDB dataset file name as a string
    :return: and outputs a list of lists containg datapoins consisting of a sentence (string) and a target (an integer)
    """
    with open(file_name, 'r', encoding="latin-1") as text_file:
        l = []
        target_string_to_int = {'negative': 0, 'positive': 1}
        lines = text_file.readlines()[1:]
        for i, line in enumerate(lines):
            l.append(line.rstrip().rsplit(',', 1))

        # Transforming target variables from stings to integers
        l = [(sentence[1:-1], target_string_to_int[target]) for sentence, target in l]
        return l