import json


def get_review_rating_from_file(json_file_path, limit=None):
    """Read in the json dataset file and return the reviews and ratings."""
    reviews = []
    num_processed = 0
    with open(json_file_path) as fin:
        for line in fin:
            num_processed += 1
            reviews.append(json.loads(line))
            if limit is not None and limit <= num_processed:
                break
    return reviews