code: def get_relation_counts(
      mapped_triples: MappedTriples,
  ) -> pd.DataFrame:
      """
      Create a dataframe of relation frequencies.
  
      :param mapped_triples: shape: (num_triples, 3)
          The mapped triples.
  
      :return:
          A dataframe with columns ( relation_id | count )
      """
      return pd.DataFrame(
          data=dict(
              zip(
                  [RELATION_ID_COLUMN_NAME, COUNT_COLUMN_NAME],
                  _get_counts(mapped_triples=mapped_triples, column=1),
              )
          )
      )
  
imports: import hashlib
  import itertools
  import logging
  from collections import defaultdict
  from typing import Collection, DefaultDict, Iterable, Mapping, NamedTuple, Optional, Sequence, Set, Tuple, Union
  import numpy
  import pandas
  from tqdm.auto import tqdm
  from .None import TriplesFactory
  from ..constants import COLUMN_LABELS, TARGET_TO_INDEX
  from ..typing import COLUMN_HEAD, COLUMN_RELATION, COLUMN_TAIL, LABEL_HEAD, LABEL_RELATION, LABEL_TAIL, MappedTriples
label_desc: Use image node_id 20 for calling a global function with example usage: get_relation_counts(mapped_triples) and returns: pd