def get_ratings_and_sentiments(df):
    """
    Rating entry: (user, item, rating)
    Sentiment entry: (user, item, [(feature, opinion, str(sentiment))]
    """
    sentiment = []
    rating = []
    for record in df:
        rating.append((record["user"], record["item"], record["rating"]))

        sent = [record["user"], record["item"]]

        triplets = []
        if record.get("sentence"):
            for i in record["sentence"]:
                triplets.append((i[0], i[1], str(i[-1])))
        sent.append(triplets)
        sentiment.append(tuple(sent))
    return rating, sentiment