def _get_rating_weight(
  ratings: pd.DataFrame, noteParams: pd.DataFrame, raterParams: pd.DataFrame
) -> pd.DataFrame:
  """Computes the weight of each rating based on the distance between the note and the rater.

  Args:
    ratings: initial input ratings DF containing all ratings
    noteParams: MF results for notes
    raterParams: MF results for raters

  Returns:
    pd.DataFrame containing the weight for reach rating, where a rating is identified by a
    {noteId, raterId} pair.
  """
  # obtain normalized factors
  normedNotes = _normalize_factors(noteParams, c.noteIdKey, c.internalNoteFactor1Key)
  normedRaters = _normalize_factors(raterParams, c.raterParticipantIdKey, c.internalRaterFactor1Key)
  # prune ratings to eliminate cases where the note or rater isn't included
  # and simultaneously add factor data
  ratings = ratings.merge(normedNotes, on=c.noteIdKey, how="inner")
  ratings = ratings.merge(normedRaters, on=c.raterParticipantIdKey, how="inner")
  # normalize impact factors
  ratings[c.ratingWeightKey] = _get_weight_from_distance(
    np.abs(ratings[c.internalRaterFactor1Key] - ratings[c.internalNoteFactor1Key])
  )
  # return relevant columns
  return ratings[[c.noteIdKey, c.raterParticipantIdKey, c.ratingWeightKey]]
Computes the weight of each rating based on the distance between the note and the rater.

  Args:
    ratings: initial input ratings DF containing all ratings
    noteParams: MF results for notes
    raterParams: MF results for raters

  Returns:
    pd.DataFrame containing the weight for reach rating, where a rating is identified by a
    {noteId, raterId} pair.
  
sourcecode/scoring/tag_filter.py