def _make_note_info_from_ratings(
    self,
    notes: pd.DataFrame,
    ratings: pd.DataFrame,
  ) -> pd.DataFrame:
    """Generate features derived from peer or local ratings associated with a note.

    Generated features include user helpfulness and tag ratings, buckets of rating counts,
    stats about rater factor distributions and ratios of tags across ratings.

    Args:
      notes: DF specifying which notes should be included in the output
      ratings: DF containing peer or local ratings to base the features on
    """
    # Augment notes with features.  Note that attributes of the note (e.g. author,
    # creation time) should always be available because we filter to notes with the creation time
    # in the last year, inherently removing any deleted notes where the creation time is unavailable.
    helpfulnessRatings = self._get_helpfulness_ratings(notes[[c.noteIdKey]], ratings)
    notes = notes.merge(helpfulnessRatings, how="inner")
    userHelpfulTags = self._get_user_tag_ratings(
      notes[[c.noteIdKey]], ratings, _USER_HELPFUL_TAGS, c.helpfulTagsTSVOrder
    )
    notes = notes.merge(userHelpfulTags, how="inner")
    userNotHelpfulTags = self._get_user_tag_ratings(
      notes[[c.noteIdKey]], ratings, _USER_NOT_HELPFUL_TAGS, c.notHelpfulTagsTSVOrder
    )
    notes = notes.merge(userNotHelpfulTags, how="inner")
    bucketCounts = self._get_bucket_count_totals(notes[[c.noteIdKey]], ratings)
    notes = notes.merge(bucketCounts, how="inner")
    helpfulStats = self._get_helpful_rating_stats(notes[[c.noteIdKey]], ratings)
    notes = notes.merge(helpfulStats, how="inner")
    tagRatios = self._get_tag_ratios(notes[[c.noteIdKey]], ratings)
    notes = notes.merge(tagRatios, how="inner")
    return notes
Generate features derived from peer or local ratings associated with a note.

    Generated features include user helpfulness and tag ratings, buckets of rating counts,
    stats about rater factor distributions and ratios of tags across ratings.

    Args:
      notes: DF specifying which notes should be included in the output
      ratings: DF containing peer or local ratings to base the features on
    
sourcecode/scoring/pflip_plus_model.py