def score_notes(
    self, noteStats: pd.DataFrame, currentLabels: pd.DataFrame, statusColumn: str
  ) -> Tuple[pd.DataFrame, Optional[pd.DataFrame]]:
    """Flip notes from CRH to NMR based on group models."""
    # Generate the set of note status updates
    probationaryNMRNotes = noteStats[
      (noteStats[c.groupRatingStatusKey].isin({c.needsMoreRatings, c.currentlyRatedNotHelpful}))
      & (noteStats[c.modelingGroupKey] == self._groupNumber)
    ][[c.noteIdKey]]
    # Identify notes which are currently CRH or NYH.
    currentCRHNotes = currentLabels[
      currentLabels[statusColumn].isin({c.currentlyRatedHelpful, c.needsYourHelp})
    ][[c.noteIdKey]]
    # Identify candidate note status updates
    noteStatusUpdates = probationaryNMRNotes.merge(currentCRHNotes, on=c.noteIdKey, how="inner")

    # Set note status and return
    noteStatusUpdates[statusColumn] = c.needsMoreRatings

    return (noteStatusUpdates, None)
Flip notes from CRH to NMR based on group models.
sourcecode/scoring/scoring_rules.py