{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8f0f8fd1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from collections import defaultdict\n",
    "import funcy\n",
    "import re\n",
    "from suno_utils.utils.text import normalize_whitespace"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "88a9c87a",
   "metadata": {},
   "outputs": [],
   "source": [
    "q = \"\"\"select * from catalog_crowdtaskresult\"\"\"\n",
    "conn_str = \"postgresql://datasets:zCEYzdR9NQIP2uqo4qNnPd1PubSNGAiX@dpg-c8f7qjd0malemkj2461g.oregon-postgres.render.com/datasets\"\n",
    "\n",
    "raw_df = pd.read_sql(q, conn_str)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "47fa0a7b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(600, 8)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>created_at</th>\n",
       "      <th>updated_at</th>\n",
       "      <th>id</th>\n",
       "      <th>data</th>\n",
       "      <th>task_id</th>\n",
       "      <th>assignment_id</th>\n",
       "      <th>hit_id</th>\n",
       "      <th>worker_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2022-07-10 21:30:44.000211+00:00</td>\n",
       "      <td>2022-07-10 21:30:44.000235+00:00</td>\n",
       "      <td>bc5cecd2-a6e8-44db-9a91-2be87f372adc</td>\n",
       "      <td>{'CF39cdbd86bb54aefb2eb1da458eb1979e_callType'...</td>\n",
       "      <td>18e477f1-9df9-4591-a679-3381ac40e6f8</td>\n",
       "      <td>33FBRBDW6ZIYRHHF5OD9NWELIWO8C8</td>\n",
       "      <td>3UDTAB6HIGICPA7F8YL137B6UJK90A</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2022-07-10 21:31:21.213777+00:00</td>\n",
       "      <td>2022-07-10 21:31:21.213799+00:00</td>\n",
       "      <td>b950ae17-8c65-4c2f-a7de-9a3b641f7ede</td>\n",
       "      <td>{'CF4272c75fbbada5e2ae046fbda82577a2_callType'...</td>\n",
       "      <td>31a2da3a-3fe3-442b-b173-575dcd0f72c0</td>\n",
       "      <td>3URFVVM16G19X7Z205YMUMXVO51ZUD</td>\n",
       "      <td>3FHTJGYT9XJUS1Y73P61APY164QPGN</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        created_at                       updated_at  \\\n",
       "0 2022-07-10 21:30:44.000211+00:00 2022-07-10 21:30:44.000235+00:00   \n",
       "1 2022-07-10 21:31:21.213777+00:00 2022-07-10 21:31:21.213799+00:00   \n",
       "\n",
       "                                     id  \\\n",
       "0  bc5cecd2-a6e8-44db-9a91-2be87f372adc   \n",
       "1  b950ae17-8c65-4c2f-a7de-9a3b641f7ede   \n",
       "\n",
       "                                                data  \\\n",
       "0  {'CF39cdbd86bb54aefb2eb1da458eb1979e_callType'...   \n",
       "1  {'CF4272c75fbbada5e2ae046fbda82577a2_callType'...   \n",
       "\n",
       "                                task_id                   assignment_id  \\\n",
       "0  18e477f1-9df9-4591-a679-3381ac40e6f8  33FBRBDW6ZIYRHHF5OD9NWELIWO8C8   \n",
       "1  31a2da3a-3fe3-442b-b173-575dcd0f72c0  3URFVVM16G19X7Z205YMUMXVO51ZUD   \n",
       "\n",
       "                           hit_id worker_id  \n",
       "0  3UDTAB6HIGICPA7F8YL137B6UJK90A      None  \n",
       "1  3FHTJGYT9XJUS1Y73P61APY164QPGN      None  "
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# filter to correct task\n",
    "rows = []\n",
    "for _, row in raw_df.iterrows():\n",
    "    if \"_callType\" in str(row[\"data\"]):\n",
    "        rows.append(row)\n",
    "df = pd.concat(rows, axis=1).T.sort_values(by=\"created_at\")\n",
    "df = df[df[\"created_at\"] >= pd.to_datetime(\"2022-07-10 00:00:00+00:00\")]\n",
    "# df = df[df[\"created_at\"] >= pd.to_datetime(\"2022-07-11 15:00:00+00:00\")]\n",
    "df = df.reset_index(drop=True)\n",
    "print(df.shape)\n",
    "df.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "id": "e8961ef2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1950 ids labeled by 3+\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'automated_company_phone_tree',\n",
       " 'company_phone_tree',\n",
       " 'live_human',\n",
       " 'other',\n",
       " 'voicemail',\n",
       " 'voicemail_message'}"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "annotations = defaultdict(list)\n",
    "for _, row in df.iterrows():\n",
    "    for k, v in row[\"data\"].items():\n",
    "        # TODO: some have '.wav' in the ID\n",
    "        kk = k.replace(\".wav\", \"\")\n",
    "        vv = normalize_whitespace(re.sub(r\"[^a-z]\", \" \", v.lower())).replace(\" \", \"_\")\n",
    "        annotations[kk].append(vv)\n",
    "good_annotations = {k: v for k, v in annotations.items() if len(v) >= 3}\n",
    "print(len(good_annotations), \"ids labeled by 3+\")\n",
    "set(funcy.flatten(annotations.values()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "id": "8fd896bb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "145 disagreements found\n"
     ]
    }
   ],
   "source": [
    "remap_dict = {\n",
    "    \"automated_company_phone_tree\": \"phonetree\",\n",
    "    \"company_phone_tree\": \"phonetree\",\n",
    "    \"voicemail_message\": \"voicemail\",\n",
    "    \"live_human\": \"human\",\n",
    "}\n",
    "\n",
    "disagreements = {}\n",
    "for k, v in annotations.items():\n",
    "    vv = [remap_dict.get(e, e) for e in v]# if e != \"other\"]\n",
    "    if len(vv) >= 3 and len(set(vv)) > 1:\n",
    "        disagreements[k] = vv\n",
    "print(len(disagreements), \"disagreements found\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "9be0e301",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'CFcc1b83ace8ddf95c140e6746e95b719c_callType': ['human',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF45c9987b5d542fce050d56b9fdf98c82_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF38368b2da49dee28231a4e379a593cdd_callType': ['human', 'other', 'human'],\n",
       " 'CF6d44076b41c410f392c8026e16af0fcb_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF0aa0fec83c93d9808a105cbc81cc84ec_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CFcae4183b408ae80be0262572de569221_callType': ['other', 'human', 'human'],\n",
       " 'CF7d3a550775208175823bc6a11144d600_callType': ['human',\n",
       "  'voicemail',\n",
       "  'human'],\n",
       " 'CF02576d0767c15e10b1a53bd9ab13c155_callType': ['human',\n",
       "  'voicemail',\n",
       "  'human'],\n",
       " 'CF33ef29ec66d846658bec51d680a59642_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF47284476beece3f5f5e9cb40e8aea1df_callType': ['human', 'other', 'human'],\n",
       " 'CF25a0f0ffcb5965f080698360eb64c46c_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF6aff60690f7872ac05da998a25490cf7_callType': ['voicemail',\n",
       "  'human',\n",
       "  'human'],\n",
       " 'CF258f909b4606c318afed2182c4e82d6d_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF339545e641ef9faa99842f69aba4bbc2_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF6ba7d5dc0c89e7a3ff2794282a715487_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CFdc5d3cb133f28e160d3f6fcbe34bc7d2_callType': ['voicemail',\n",
       "  'human',\n",
       "  'human'],\n",
       " 'CF842b8babe9d9dc8c959440ed9d2f3529_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF9a02a33c1ad651e5da607457eb106b01_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF11065613d98d485b10058b985702ce1d_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF4052ffd4309585a4a390e7e47ea01124_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF24952c8ddbf1b4ed3c76b7e4e027bb33_callType': ['voicemail',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CFbb27a1ddc9b32ba397400f3d7a8b2a21_callType': ['voicemail',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF77276178d467d9f3c226ed3e0cbf832d_callType': ['human',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF8ab9d009b70322fdcb00a7a901a435eb_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF5a656c59fcac72e891ce5e14e84e9b30_callType': ['other',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CFdcd63affdc90439b5abba84ea41f8fa2_callType': ['voicemail',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CFedb5e9683b61afc17538b264c45015c2_callType': ['phonetree',\n",
       "  'other',\n",
       "  'phonetree'],\n",
       " 'CFf122c53be0d65f3ae9a8cb8d09faa257_callType': ['human', 'other', 'other'],\n",
       " 'CFe07452ae3938700a08bc7316eb9013b9_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF15270c86c9bfe7c84787a2b3f5cb6242_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF168f80ab8095cfa48cdd6deae49fa410_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CF24c8b41e714935f305a2b57fdc84f7f5_callType': ['phonetree',\n",
       "  'other',\n",
       "  'phonetree'],\n",
       " 'CF75ab536ad3b3eae3326fed1212d9448f_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CFce63d5b6597d18891b25eecb346d14bb_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF04226ca66d15cc48ff981bf25274e4f2_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CFe6399cb722d4c20be86870368e271a63_callType': ['voicemail',\n",
       "  'human',\n",
       "  'voicemail'],\n",
       " 'CFe195f420da03714d736d116d62d65416_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CF156ff5fa4b8fb7d7f200b9f1e48e2661_callType': ['phonetree',\n",
       "  'other',\n",
       "  'phonetree'],\n",
       " 'CF7d5de16a3c8d062bf9505d820705d145_callType': ['other',\n",
       "  'other',\n",
       "  'voicemail'],\n",
       " 'CF5300748ee848ad7f36a640c1d48bb43b_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CF7b532ed7bd69031d7d9dd9b4bd92d40f_callType': ['other',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CF893a6dc9c931ccbc90a9ef7f08925817_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF1718466904b580a35ae51ad2b34b0ec3_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF4f256f4d89caa6f16a8b32850db43a14_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'human'],\n",
       " 'CFbf9567e2bf3bd9b363e4bcbcd7f4f61e_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF28e1e8feefe5db4ae0a532f4129601a1_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CFbb62ab7325ab16c14eac2bc7c4322b52_callType': ['other',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CFd3748dbe3b31dc77e337a77350ec7e1a_callType': ['other', 'human', 'human'],\n",
       " 'CFf40a0d3969f6e76d1e0201f76d3b0429_callType': ['human', 'other', 'other'],\n",
       " 'CF23bd7bbc6073019106047dc185957d1a_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF4c3835349bbf5f0580f0621abd93e0d7_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CFda1bfc29a410208985f5d4f2552f5aa4_callType': ['human',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF0653a718e6d9f8e6ec1adb66a3374716_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF3996ef14dd711283b4a811bc4dd9512f_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF6d0cf2e2e113f0731cc624b0ca34d91e_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF926ead1a70929626a26d3b5787765c82_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF2a16810a0d6dd297ccbab6b46dad71b0_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CFd47286868766ce2d7fb5586a58d45c3a_callType': ['human',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF077f7e03fbdfdd961cce6623602fb906_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF672d0e4671e88089a948c20b1b6e8f4e_callType': ['human',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CF14ccc837b424f75acb530416515761b6_callType': ['other',\n",
       "  'other',\n",
       "  'phonetree'],\n",
       " 'CF4c5f5f904208ccb976a91aac4ef0d5af_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF7d13743aeae0e3984985d65b28868c2a_callType': ['other',\n",
       "  'other',\n",
       "  'phonetree'],\n",
       " 'CFdeba41362521ff7e847701425ce47740_callType': ['human',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CF05ac03e88557ad5915ae463aeffbc07f_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF40d822b0f15ab1604b34b0509ea4de9b_callType': ['other', 'human', 'human'],\n",
       " 'CFab59289ff2e93ed4025081dd574db0fa_callType': ['human',\n",
       "  'other',\n",
       "  'phonetree'],\n",
       " 'CFcba854228972e7259b7f1388ce3c3a96_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CFe15f07ee34cf8de622a1eddeaf66360a_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CFc1296882c3a535dd62b77aa1890d1b24_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CF5207ed7089bf676f1b21ca8183d7b8e6_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF74788ea87d18090c8d1816733d5b2ce2_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF53e8a1d79c548a1cba68e31a91f70759_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF9aed6a5aa24153706be2e947e302e48a_callType': ['other', 'human', 'other'],\n",
       " 'CF082f86dac47d98b520df93a5f488c489_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CFbd9953f5a837e60c555890e8da7a3db9_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF2f6c3774fb45fb86aa0c09ee068d7c69_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CFdd77eb861504f7b7bc791ef079ff67dd_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF05bc0801e8b57cc0353214e8d8337497_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CFee63dc2faa0ede4fc3b151ecda63b1c5_callType': ['other',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF42015e0e23d2e3dc8c6911bab91cb982_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF5d44f2f225fdee8ff48054206f0b36f5_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CF521cf98ea464e30fdf632dbfa39480ad_callType': ['other',\n",
       "  'other',\n",
       "  'phonetree'],\n",
       " 'CFf78cd3edb614351b97a341f403f3f8d6_callType': ['voicemail',\n",
       "  'other',\n",
       "  'voicemail',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF4d01a410253b07a076ec62b9e939936d_callType': ['other',\n",
       "  'other',\n",
       "  'voicemail'],\n",
       " 'CFda0821eff5b09c5d49cecef532bcd29a_callType': ['other',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CFfa604c791c214c82af289ad5b79ba04d_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF16958a3332c7b8dd774d814af154f2d3_callType': ['other',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CF45d8e9245b2192ae0528b819aca4d5d5_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CF4c64137fb749861397173a375e4d825b_callType': ['human',\n",
       "  'voicemail',\n",
       "  'human'],\n",
       " 'CFcb35007666d38ed9ed18854ad55c082c_callType': ['voicemail',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF01505a3e685488424f5f518ca259a1cb_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CF1cb77fe0294808bf5f0a773181726ed4_callType': ['other', 'human', 'other'],\n",
       " 'CF3dd8dc5dbbb6e5d48456631cd544d3fb_callType': ['other',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CFe64eeb578ec9d50bcd1212721577a283_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CF8acccf507d67af910add3ed284398341_callType': ['human', 'human', 'other'],\n",
       " 'CF4e01532916d014120563bfa74de315f5_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF847e66ceaa4a7768f052f009f7f610d3_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CFda5bcad53ef8b89dc667d4165005c9fe_callType': ['other',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF25a2355a509352440ee3c6d4855b017d_callType': ['human',\n",
       "  'voicemail',\n",
       "  'human'],\n",
       " 'CFc6c7cd3d264979dd3ed00a15444ab539_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CF33916f71f1fbe91b0e78bbbc4ff579f8_callType': ['other',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF8da95e522d9c40973f149c8597d66e01_callType': ['phonetree',\n",
       "  'human',\n",
       "  'human'],\n",
       " 'CF56034f3eb897645fd27338e2efdcfdc1_callType': ['voicemail',\n",
       "  'human',\n",
       "  'other'],\n",
       " 'CF5489458c8f2b6e8302e16e95f40572b9_callType': ['other',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CFcd6ada5aa35e0257ca65e7fd390cc5db_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF494b5d443ae7641d97ace7af79ac5885_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CF6fc914729bb6b11a9a0ac25c063e059f_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CF92bb93960db0b782a3e5f07d2936ecc5_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CFaaf1d40ad888a7ea4da9336530f6f015_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF79ae5d2577ca918581437aa9c7e0fb2c_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF915bf70f0315cde59fede8091b8b334a_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF139b6e572fda66d5780184db578db4d6_callType': ['other',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF92fef8f4942127f983167c14f1027aa1_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF65576345a766a97f2cf0a847293b4fad_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CFdf1e1571042c892b586b853aef395db8_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CFa2610e447d3fa80aa3ec72aa509a8e7c_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF0bad4f1461db32814e682b7650d67de4_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CFd5c2cf8d620cbe2fc5de207b02da31c1_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CFf12b114bd3fe6a50d1385916bb987018_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CFe1656c68aa3a1e3436883153ed2d4eb6_callType': ['phonetree',\n",
       "  'human',\n",
       "  'human'],\n",
       " 'CF39ea664c112700132396d37054e220e4_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF58245d0e8a19e804cce1cad2137f3593_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CFe6910583a68fd23d8841960f8ae73f93_callType': ['other',\n",
       "  'other',\n",
       "  'phonetree'],\n",
       " 'CF97462972bc4e71c3f12340b4ad48710b_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'voicemail'],\n",
       " 'CF288f7c5e450b54c4fdaa8c032e66b920_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF44f1d6442da475a516150a9466303d86_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'phonetree'],\n",
       " 'CFd33f13b526e9ded67f74ba7b8dfbc73e_callType': ['other',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF204fd64c41792f0764a746f627efc4b5_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF79625ca244ed0216d84673db0bfbcad9_callType': ['human', 'human', 'other'],\n",
       " 'CFc299092c00edc7fc697c6c19d0a8c60c_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CFcd9e14a8087be4ecc725b36ece963686_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'voicemail'],\n",
       " 'CFe468425d6021607fb3dd29b97ed5d29c_callType': ['voicemail',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CFdab04a551911bca7a05ee1b0d64f5d5c_callType': ['voicemail',\n",
       "  'human',\n",
       "  'voicemail'],\n",
       " 'CFdea64328e65caf0c96dbc381acec4317_callType': ['voicemail',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF68e9fcf5a49dddc75c13ae02104f96e9_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF809a93c16d5933c003bac6ea03051608_callType': ['phonetree',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF98f99e7e04d5f639da57e0db62b7b497_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF8c02459aea54d5ddaf6142b51742c9e1_callType': ['other',\n",
       "  'phonetree',\n",
       "  'other'],\n",
       " 'CF5d2c460ec0cb43817d95176d0f8c9b60_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF7996f1d5515791f971926c63a281d653_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'other'],\n",
       " 'CF7c323b5a3ebda85b5693db95f584f8f6_callType': ['phonetree',\n",
       "  'other',\n",
       "  'other'],\n",
       " 'CF063e31905c78b30e6f638db52581ad20_callType': ['voicemail',\n",
       "  'phonetree',\n",
       "  'phonetree'],\n",
       " 'CF3e159fb6a609735962d60fb8ab0e00c3_callType': ['human', 'other', 'other'],\n",
       " 'CFc7a153b5832f2e4d7ebf1af1bae7944a_callType': ['phonetree',\n",
       "  'voicemail',\n",
       "  'other']}"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "disagreements"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f62d1c89",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ba9884dc",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "71a55485",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b7d73b5c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "4dbd399c",
   "metadata": {},
   "source": [
    "## Playground"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a38d32b4",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "3c9ea42d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9b1ec9da-244b-4c61-8c47-71740b8968c8    31\n",
       "e7ffd8f9-2236-4268-aa56-fb8457858572     8\n",
       "762bbd34-3f57-4694-8b9f-7998a609da82     5\n",
       "40e00207-f2f4-425a-8fc9-4c7b34ea71d1     4\n",
       "11222025-7899-4c7e-b254-afb29da3623f     4\n",
       "                                        ..\n",
       "36cd91cf-78bf-4b0f-82e3-db67e195ae06     2\n",
       "071ec33c-1a79-4f69-9a17-f13b127dcff6     2\n",
       "360cf799-470b-4ded-8ec6-a47bbfcea211     2\n",
       "b96ba568-6b83-4d8e-9435-a7c47cc76be1     2\n",
       "622476db-a79d-431a-b854-df41644799fb     2\n",
       "Name: task_id, Length: 202, dtype: int64"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"task_id\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "8db42e1c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "undefined                         3\n",
       "3OSWBBLG1PGYBAO1DSKCN1DWUCTDXJ    3\n",
       "3DEL4X4ELH419LJS9O7Q0MNXC1PYX4    2\n",
       "3Q5C1WP23XKVHWOFRTHMUGL3BJP15L    2\n",
       "3HPZF4IVNXCD6N8XISB3M92NAKHCYX    2\n",
       "                                 ..\n",
       "3O6CYIULEOK53CUXPIEFVI3D790UWX    1\n",
       "39PAAFCODXJDOAF3Z3J94KYXHMSVTY    1\n",
       "3W8CV64QJDIPMUB5W8XOYJ6CF0FH9V    1\n",
       "3Z7EFSHGNKXO6IINDWP13VVE9B2CX1    1\n",
       "3B2X28YI37YSDY6LY9KGSYCCUQJ6BI    1\n",
       "Name: assignment_id, Length: 629, dtype: int64"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"assignment_id\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "8ff933a7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3B6F54KMSCVU1EOWDNPSY7Z6RXJ1SG    22\n",
       "3VO4XFFP2F5WZKOLAZHW4HBICVXQ7C     6\n",
       "3FBEFUUYSUOL843Z2TFI83WHDUV6AA     5\n",
       "3IZVJEBJ7K3M9CB7ELVHPWNQMQG6ZB     5\n",
       "3P888QFVYDD3KQGKRLYYF3XD2N0QO1     4\n",
       "                                  ..\n",
       "3IZVJEBJ7K3M9CB7ELVHPWNQMPV6ZO     2\n",
       "3E24UO25R99AA8X0CCK09YGM2LS6OM     2\n",
       "3V0TR1NRWKL7THZLJ5M3B5C3HDI4A0     2\n",
       "3NC6WP7WKR3G9WL8UGOEOMSLTPJWWO     2\n",
       "3EGKVCRQG6BSAYIXEQA6M50GUW2BYN     2\n",
       "Name: hit_id, Length: 205, dtype: int64"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"hit_id\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "baa96833",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "aa326884",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c2d9f011",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9c6c847a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
