def build_movieid2title(dataset_path):
    """Builds a mapping between item ids and the title of each item."""
    filename = "movies.dat"
    movieid2title = {}
    with open(dataset_path / filename, "r", encoding="ISO-8859-1") as f:
        for line in f:
            line = line.strip("\n").split("::")
            movieid2title[line[0]] = line[1]
    return movieid2title