def _set_top_tags()

in sourcecode/scoring/explanation_tags.py [0:0]


  def _set_top_tags(row: pd.Series) -> pd.Series:
    # Note that row[c.firstTagKey] and row[c.secondTagKey] are both Counter
    # objects mapping tags to counts due to the aggregation above.
    tagTuples = [
      (count, c.notHelpfulTagsTiebreakMapping[tag], c.notHelpfulTagsEnumMapping[tag])
      for tag, count in (row[c.firstTagKey] + row[c.secondTagKey]).items()
      if (tag is not None) and not pd.isna(tag)
    ]
    tags = [tsvId for (_, tieBreakId, tsvId) in sorted(tagTuples, reverse=True)[:2]]
    topNotHelpfulTags = ",".join([str(tag) for tag in tags])
    row[c.authorTopNotHelpfulTagValues] = topNotHelpfulTags
    return row