{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "e7eb03ea",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fa1a598b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a9594109",
   "metadata": {},
   "outputs": [],
   "source": [
    "import tqdm\n",
    "import pandas as pd\n",
    "import json\n",
    "\n",
    "from suno_utils.utils.notebook import _"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "18e74570",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "5574012e",
   "metadata": {},
   "source": [
    "## get transcripts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "04d2b3ed",
   "metadata": {},
   "outputs": [],
   "source": [
    "from suno_utils.web.rev import get_auth_string\n",
    "from suno_utils.web.rev import get_transcript, wait_till_done\n",
    "\n",
    "client_api_key = \"_CbCcpYaSu4DF8NuQJdWniWG2Ls\"\n",
    "user_api_key = \"hYhwAFC3w39VN23lwpzn26Jy1CA=\"\n",
    "\n",
    "AUTH_STR = get_auth_string(client_api_key, user_api_key)\n",
    "transcript_ids = wait_till_done(AUTH_STR, \"TC0299517215\")\n",
    "transcripts = [get_transcript(AUTH_STR, transcript_id) for transcript_id in transcript_ids]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3adf47a8",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9ecd8f80",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "3d644332",
   "metadata": {},
   "source": [
    "## Test Transcript parser"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2022dc97",
   "metadata": {},
   "outputs": [],
   "source": [
    "from suno_utils.web.rev import parse_transcript\n",
    "from suno_utils.utils.alignment import format_tokens_as_turns\n",
    "\n",
    "with open(\"tmp/bla.pkl\", \"rb\") as f:\n",
    "    transcripts = pickle.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "9aaa52b6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "87.3% tokens aligned\n"
     ]
    }
   ],
   "source": [
    "speaker_names, align_meta = parse_transcript(transcripts[9])\n",
    "print(\"{}% tokens aligned\".format(round(np.mean([t[\"success\"] for t in align_meta if t[\"type\"] == \"text\"]) * 100, 1)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "103ee71c",
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# for s, t in format_tokens_as_turns(align_meta):\n",
    "#     print(f\"Speaker {s}:\")\n",
    "#     print(t)\n",
    "#     print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "540622fd",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ec5165fc",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "9cb590c4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "aussie_100\t\t find_cc_podcasts.ipynb  old\t\t\t  tmp\r\n",
      "bulk_download_rss.ipynb  find_india.ipynb\t organize_metadata.ipynb\r\n"
     ]
    }
   ],
   "source": [
    "!ls /home/georg/notebooks/datasets/podcasts/"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fa08336e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3fd494f4",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "c222b398",
   "metadata": {},
   "source": [
    "## Make slices"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "4fbc805a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import pickle\n",
    "import shutil\n",
    "\n",
    "from suno_utils.utils.conversion import Audio\n",
    "from suno_utils.utils.slicer import get_annotated_segments\n",
    "from suno_utils.web.rev import parse_transcript\n",
    "\n",
    "DATA_DIR = \"/home/georg/notebooks/datasets/podcasts/aussie_100/\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "6a27a54f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# shutil.rmtree(DATA_DIR, ignore_errors=True)\n",
    "# os.makedirs(DATA_DIR, exist_ok=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "85cc3693",
   "metadata": {},
   "outputs": [],
   "source": [
    "episode_metas = pd.read_csv(\"old/10_ep_aussie_100.csv\").to_dict(orient=\"records\")\n",
    "with open(\"tmp/bla.pkl\", \"rb\") as f:\n",
    "    transcripts = pickle.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "d3a70ff9",
   "metadata": {},
   "outputs": [],
   "source": [
    "def _get_podcast_segments(audio, transcript):\n",
    "    speaker_names, align_meta = parse_transcript(transcript)\n",
    "    segments = get_annotated_segments(audio, align_meta)\n",
    "    return segments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "05287688",
   "metadata": {},
   "outputs": [],
   "source": [
    "# test slice making\n",
    "# episode_meta, transcript = episode_metas[3], transcripts[3]\n",
    "\n",
    "# audio = Audio.from_file(\"old/\" + episode_meta[\"wav_filepath\"])\n",
    "# slice_meta = _get_podcast_slices(audio, transcript)\n",
    "\n",
    "# slice_cov_frac = np.sum([to_s - from_s for _, (from_s, to_s), _ in slice_meta]) / audio.duration_s\n",
    "# print(\"{}% slice coverage\".format(round(slice_cov_frac * 100, 1)))\n",
    "# # 97.0% slice coverage"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "id": "50569c74",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "10it [00:04,  2.29it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "91.3% avg segment coverage\n",
      "133 total segments\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "cov_l = []\n",
    "segment_metas = []\n",
    "for episode_meta, transcript in tqdm.tqdm(zip(episode_metas, transcripts)):\n",
    "    audio = Audio.from_file(\"old/\" + episode_meta[\"wav_filepath\"])\n",
    "    segments = _get_podcast_segments(audio, transcript)\n",
    "    segment_cov_frac = np.sum([to_s - from_s for _, (from_s, to_s), _ in segments]) / audio.duration_s\n",
    "    cov_l.append(segment_cov_frac)\n",
    "    # skip everything pre-1min\n",
    "    segments = [e for e in segments if e[1][0] >= 60]\n",
    "    # write segments and make metadata\n",
    "    for segment_audio, (start_s, end_s), tokens in segments:\n",
    "        start_ms = int(start_s * 1_000)\n",
    "        end_ms = int(end_s * 1_000)\n",
    "        segment_id = f\"{episode_meta['file_id']}__{start_ms}__{end_ms}\"\n",
    "        segment_filepath = f\"{DATA_DIR}segments/{episode_meta['file_id']}/{start_ms}__{end_ms}.wav\"\n",
    "        os.makedirs(os.path.dirname(segment_filepath), exist_ok=True)\n",
    "        segment_audio.write_wav(segment_filepath)\n",
    "        segment_metas.append({\n",
    "            \"source_id\": episode_meta[\"file_id\"],\n",
    "            \"source_offset_s\": start_s,\n",
    "            \"id\": segment_id,\n",
    "            \"uri\": segment_filepath,\n",
    "            \"duration_s\": end_s - start_s,\n",
    "            \"transcript\": {\n",
    "                \"tokens\": tokens,\n",
    "            },\n",
    "        })\n",
    "print(\"{}% avg segment coverage\".format(round(np.mean(cov_l) * 100, 1)))\n",
    "print(len(segment_metas), \"total segments\")\n",
    "# 91.3% avg slice coverage\n",
    "# 133 total slices"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "7dd865c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(DATA_DIR + \"segment_meta.json\", \"w\") as f:\n",
    "    json.dump(segment_metas, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "bc93fe1d",
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# from suno_utils.utils.alignment import format_tokens_as_turns\n",
    "# import random\n",
    "\n",
    "# idx_list = list(range(len(segment_metas)))\n",
    "# random.shuffle(idx_list)\n",
    "\n",
    "# for idx in idx_list[:5]:\n",
    "#     segment_meta = segment_metas[idx]\n",
    "#     print(\"-\" * 10)\n",
    "#     print(f\"({segment_meta['id']})\")\n",
    "#     Audio.from_file(segment_meta[\"filepath\"]).play()\n",
    "#     for s, t in format_tokens_as_turns(segment_meta[\"transcript\"][\"tokens\"]):\n",
    "#         print()\n",
    "#         print(f\"Speaker {s}:\")\n",
    "#         print(f\"{t}\")\n",
    "#     print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "258c06f6",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3f15a38e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "18ff5264",
   "metadata": {},
   "source": [
    "## Normalization"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "932d26ad",
   "metadata": {},
   "outputs": [],
   "source": [
    "from suno_utils.utils.notebook import transcribe, Audio\n",
    "\n",
    "DATA_DIR = \"/home/georg/notebooks/datasets/podcasts/aussie_100/\"\n",
    "\n",
    "with open(DATA_DIR + \"segment_meta.json\") as f:\n",
    "    segment_metas = json.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "a4cf166c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Transcribing:   0%|          | 0/17 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[NeMo W 2022-04-25 17:48:51 nemo_logging:349] /home/georg/venvs/ml/lib/python3.8/site-packages/torch/autocast_mode.py:162: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling\n",
      "      warnings.warn('User provided device_type of \\'cuda\\', but CUDA is not available. Disabling')\n",
      "    \n"
     ]
    }
   ],
   "source": [
    "asr_predictions = transcribe([e[\"uri\"] for e in segment_metas], n_workers=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "24c5d01f",
   "metadata": {},
   "outputs": [],
   "source": [
    "DEFAULT_TAG_REPR_MAP = {\n",
    "    \"hesitation\": \"--\",\n",
    "    \"laughter\": \"[laughter]\",\n",
    "}\n",
    "\n",
    "\n",
    "def format_tokens_as_turns(tokens, tag_repr_map=DEFAULT_TAG_REPR_MAP):\n",
    "    \"\"\"split into speaker turns\"\"\"\n",
    "    turns = []\n",
    "    cur_speaker = None\n",
    "    tmp = []\n",
    "    for token in tokens:\n",
    "        if token[\"type\"] == \"tag\":\n",
    "            if token[\"value\"] in tag_repr_map:\n",
    "                tmp.append(tag_repr_map[token[\"value\"]])\n",
    "            continue\n",
    "        if token[\"speaker_id\"] != cur_speaker and len(tmp) > 0:\n",
    "            turns.append((cur_speaker, \" \".join(tmp)))\n",
    "            tmp = []\n",
    "        tmp.append(token[\"value\"])\n",
    "        cur_speaker = token[\"speaker_id\"]\n",
    "    if len(tmp) > 0:\n",
    "        turns.append((cur_speaker, \" \".join(tmp)))\n",
    "    return turns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "8ea64a52",
   "metadata": {},
   "outputs": [],
   "source": [
    "from suno_utils.utils.text_normalizer import normalize, normalize_mp\n",
    "from suno_utils.utils.aligner import format_tokens_as_turns\n",
    "\n",
    "transcript_turns = []\n",
    "for segment_meta in segment_metas:\n",
    "    transcript_turns.append([\n",
    "        t for _, t in format_tokens_as_turns(segment_meta[\"transcript\"][\"tokens\"], tag_repr_map={})\n",
    "    ])\n",
    "    \n",
    "_, transcript_turns_norm = normalize_mp(transcript_turns, asr_predictions, n_cores=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "c0a6aaff",
   "metadata": {},
   "outputs": [],
   "source": [
    "for segment_meta, turns_norm, asr_pred in zip(segment_metas, transcript_turns_norm, asr_predictions):\n",
    "    segment_meta[\"transcript\"][\"text_normalized\"] = \" \".join(turns_norm)\n",
    "    segment_meta[\"transcript\"][\"asr_prediction\"] = asr_pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c4c90bd9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# TODO: rank prior on norms to choose if nemo facepalms and cer all high\n",
    "# normalize(transcript_turns[8], asr_predictions[8])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "450fcb45",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(DATA_DIR + \"segment_meta_post_norm.json\", \"w\") as f:\n",
    "    json.dump(segment_metas, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ae66c0e7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c4eacfe1",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0b63ef6a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "e090b7ce",
   "metadata": {},
   "source": [
    "## Timestamps (optional)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "7144455d",
   "metadata": {},
   "outputs": [],
   "source": [
    "from suno_utils.utils.notebook import transcribe, Audio\n",
    "\n",
    "DATA_DIR = \"/home/georg/notebooks/datasets/podcasts/aussie_100/\"\n",
    "\n",
    "with open(DATA_DIR + \"segment_meta_post_norm.json\") as f:\n",
    "    segment_metas = json.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "e4c6a6f7",
   "metadata": {},
   "outputs": [],
   "source": [
    "from suno_utils.web.mfa import align_tokens, align_text\n",
    "\n",
    "conda_sh_filepath = \"/home/georg/anaconda3/etc/profile.d/conda.sh\"\n",
    "env_name = \"mfa\"\n",
    "\n",
    "audio_filepaths = [e[\"uri\"] for e in segment_metas]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "26afeda9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0/133 failed.\n"
     ]
    }
   ],
   "source": [
    "transcripts_tokens = [e[\"transcript\"][\"tokens\"] for e in segment_metas]\n",
    "word_aligments = align_tokens(audio_filepaths, transcripts_tokens, conda_sh_filepath, env_name, num_cores=5)\n",
    "n_failed = len(transcripts_tokens) - len([_ for e in word_aligments if e is not None])\n",
    "print(\"{}/{} failed.\".format(n_failed, len(transcripts_tokens)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "55fd5fbc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0/133 failed.\n"
     ]
    }
   ],
   "source": [
    "transcripts_norm = [e[\"transcript\"][\"text_normalized\"] for e in segment_metas]\n",
    "word_aligments_norm = align_text(audio_filepaths, transcripts_norm, conda_sh_filepath, env_name, num_cores=5)\n",
    "n_failed = len(transcripts_norm) - len([_ for e in word_aligments_norm if e is not None])\n",
    "print(\"{}/{} failed.\".format(n_failed, len(transcripts_norm)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "c978d868",
   "metadata": {},
   "outputs": [],
   "source": [
    "for segment_meta, word_aligment, word_aligment_norm in zip(segment_metas, word_aligments, word_aligments_norm):\n",
    "    segment_meta[\"transcript\"][\"alignment\"] = word_aligment\n",
    "    segment_meta[\"transcript\"][\"alignment\"] = word_aligment_norm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "ab1a05cc",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(DATA_DIR + \"segment_meta_post_align.json\", \"w\") as f:\n",
    "    json.dump(segment_metas, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7496ca48",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "76d3071a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c2a8c069",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "6db01585",
   "metadata": {},
   "source": [
    "## deverbalizer (optional)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "e89f9e21",
   "metadata": {},
   "outputs": [],
   "source": [
    "# from suno_utils.utils.text_denormalizer import denormalize\n",
    "\n",
    "# # denormalize(\" I -- I -- I -- I like coffee, coffee\")\n",
    "# denormalize(\"yesterday I -- anyways, [laughter], I like coffee, coffee\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a7b2b8dc",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6991ecfd",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "632ebdea",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "4f94a394",
   "metadata": {},
   "source": [
    "## Filter (asr based etc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "e15eba07",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(DATA_DIR + \"segment_meta_post_norm.json\") as f:\n",
    "    segment_metas = json.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "45a937ae",
   "metadata": {},
   "outputs": [],
   "source": [
    "from nemo.collections.asr.metrics.wer import word_error_rate\n",
    "\n",
    "def _get_cer(a, b):\n",
    "    if a == b:\n",
    "        return 0\n",
    "    cer = word_error_rate([a], [b], use_cer=True)\n",
    "    return cer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "a1df4e61",
   "metadata": {},
   "outputs": [],
   "source": [
    "from suno_utils.utils.aligner import format_tokens_as_turns\n",
    "\n",
    "metric_df = pd.DataFrame({\n",
    "    \"transcript\": [\" \".join([t for _, t in format_tokens_as_turns(e[\"transcript\"][\"tokens\"])]) for e in segment_metas],\n",
    "    \"transcript_norm\": [e[\"transcript\"][\"text_normalized\"] for e in segment_metas],\n",
    "    \"asr_pred\": [e[\"transcript\"][\"asr_prediction\"] for e in segment_metas],\n",
    "})\n",
    "metric_df[\"cer\"] = [\n",
    "    _get_cer(a, b) for a, b in zip(metric_df[\"transcript_norm\"].values, metric_df[\"asr_pred\"].values)\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "f17fac80",
   "metadata": {},
   "outputs": [],
   "source": [
    "# for idx, row in metric_df[metric_df[\"transcript\"].str.contains(r\"[0-9]\")].sort_values(\"cer\", ascending=False).head(20).iterrows():\n",
    "#     print(\"idx: {}, cer: {}%\".format(idx, round(row[\"cer\"] * 100, 1)))\n",
    "#     print(\"  \" + row[\"transcript\"])\n",
    "#     print(\"  \" + row[\"transcript_norm\"])\n",
    "#     print(\"  \" + row[\"asr_pred\"])\n",
    "#     print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1d6a879c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# TODO: Mm-hmm vs mhm\n",
    "# TODO: contractions don't become expanded\n",
    "\n",
    "# TODO: improvements for normalizer\n",
    "#   can we add custom rules?\n",
    "#   can we keep track of replacement indices (worst case difflib)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "id": "add0be12",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(DATA_DIR + \"segment_meta_post_filter.json\", \"w\") as f:\n",
    "    json.dump(segment_metas, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ea37d95c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "70b83be3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "75abd2d5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "bc900f73",
   "metadata": {},
   "source": [
    "## corpus distribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "id": "e1a3ca09",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(DATA_DIR + \"segment_meta_post_filter.json\") as f:\n",
    "    segment_metas = json.load(f)\n",
    "    \n",
    "DIST_DIR = \"/home/georg/notebooks/datasets/podcasts/aussie_100/dist/\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "id": "7547d9c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# !mkdir /home/georg/notebooks/datasets/podcasts/aussie_100/dist\n",
    "# !mkdir /home/georg/notebooks/datasets/podcasts/aussie_100/dist/aussie_100\n",
    "# !mkdir /home/georg/notebooks/datasets/podcasts/aussie_100/dist/aussie_100/segments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 178,
   "id": "980f633b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100 slices\n"
     ]
    }
   ],
   "source": [
    "import shutil\n",
    "import copy\n",
    "import hashlib\n",
    "\n",
    "def _get_hash(s, n=None):\n",
    "    uuid = hashlib.sha256(str(s).encode(\"utf-8\")).hexdigest()\n",
    "    if n is not None:\n",
    "        uuid = uuid[:n]\n",
    "    return uuid\n",
    "\n",
    "random.seed(6006)\n",
    "idx_list = list(range(len(segment_metas)))\n",
    "random.shuffle(idx_list)\n",
    "\n",
    "out_segments_meta = []\n",
    "for idx in idx_list:\n",
    "    segment_meta = segment_metas[idx]\n",
    "    segment_id = _get_hash(segment_meta[\"id\"], n=16)\n",
    "    \n",
    "    from_filepath = segment_meta[\"uri\"]\n",
    "    segment_filepath = \"segments/{}.wav\".format(segment_id)\n",
    "    to_filepath = DIST_DIR + \"aussie_100/\" + segment_filepath\n",
    "    shutil.copy(from_filepath, to_filepath)\n",
    "    \n",
    "    out_tokens = []\n",
    "    for token in segment_meta[\"transcript\"][\"tokens\"]:\n",
    "        out_token = {\n",
    "            \"type\": token[\"type\"],\n",
    "            \"value\": token[\"value\"],\n",
    "        }\n",
    "        if \"speaker_id\" in token:\n",
    "            out_token[\"speaker_id\"] = _get_hash(segment_meta[\"source_id\"] + str(token[\"speaker_id\"]), n=16)\n",
    "        out_tokens.append(out_token)\n",
    "        \n",
    "    out_segments_meta.append({\n",
    "        \"source_id\": _get_hash(segment_meta[\"source_id\"], n=16),\n",
    "        \"uid\": segment_id,\n",
    "        \"filepath\": segment_filepath,\n",
    "        \"duration_s\": round(segment_meta[\"duration_s\"], 2),\n",
    "        \"transcript\": {\n",
    "            \"text_normalized\": segment_meta[\"transcript\"][\"text_normalized\"],\n",
    "            \"tokens\": out_tokens,\n",
    "        }\n",
    "    })\n",
    "    if len(out_segments_meta) == 100:\n",
    "        break\n",
    "        \n",
    "print(len(out_segments_meta), \"segments\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "id": "77dc7378",
   "metadata": {},
   "outputs": [],
   "source": [
    "# print(json.dumps(out_segments_meta[1], indent=2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 179,
   "id": "f3cae4a4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# with open(DIST_DIR + \"aussie_100/meta.jsonl\", \"w\") as f:\n",
    "#     for m in out_segments_meta:\n",
    "#         f.write(json.dumps(m) + \"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "id": "3dd23aa1",
   "metadata": {},
   "outputs": [],
   "source": [
    "# !cd /home/georg/notebooks/datasets/podcasts/aussie_100/dist && tar -czf aussie_100.tar.gz aussie_100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1d2e1868",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e90e8d0f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "10a4c391",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "612e707f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1d907dbd",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1733b3e3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "1c313f0c",
   "metadata": {},
   "source": [
    "## Playground"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "fe75bce3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAx8AAADQCAYAAABm8txZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAo6klEQVR4nO3deXxU9b3/8fc3mUkmG1khbMHgyiIoEBWNVq0WEResimhrxav32lbtta1a0Wpdqvfn75b2erWirV6v6M+lgLiguAt1AUSgyqpVWmQTCCEJhOzJ9/fHmUlmORMSIGdIfD0fDx6Z+Z7vOed7znc582HO94yx1goAAAAAulpSogsAAAAA4NuB4AMAAACAJwg+AAAAAHiC4AMAAACAJwg+AAAAAHiC4AMAAACAJ3ydyVxQUGCLi4u7qCgAAAAAurt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nnnzJmj9evXa82aNdq+fbuGDh2qq666qnV5QUGBli9frunTp2vatGl6/PHHI9afPn26cnNztWbNGq1atUrHHnts67L77rtPeXl5am5u1hlnnKEVK1Zo5MiRkqTs7GytXLlSTz31lH7+85/r1Vdf1T333KM333xTAwYMUGVl5QE5F9x2BQAAAHShBx98UMccc4zGjh2rjRs36ssvv4yb98MPP9SkSZOUlJSkvn376vTTT49YfuGFF0qSxowZo/Xr17uuf+mll0qSjj766NbgQpJmzpyp0aNHa9SoUVq9erXWrFnTuuyyyy5r/bto0SJJUmlpqa688ko99thjam5u3reDj8I3HwAAAEAXWbBggd555x0tWrRI6enpOu2001RXV7fP20tNTZUkJScnq6mpqcPr/fOf/9S0adP0ySefKDc3V1deeWVEOYwxMa8fffRRffzxx3rttdc0ZswYLVu2LO43Nh3FNx8AAABAF6mqqlJubq7S09P1+eefa/Hixe3mLy0t1QsvvKCWlhZt27ZNCxYs6NT+SktLNXPmTEnSmjVrtHKlMw9l165dysjIUHZ2trZt26bXX389Yr2//OUvrX9PPPFESdK6det0wgkn6J577lHv3r21cePGTpXFDd98AAAAoMeLNxm8q40fP16PPvqohg4dqqOOOkpjx45tN/9FF12kd999V8OGDVNRUZFGjx6t7OzsDu/v2muv1ZQpUzRs2DANGTJEw4cPV3Z2to444giNGjVKQ4YMUVFRkUpLSyPWq6io0MiRI5WamqrnnntOknTzzTfryy+/lLVWZ5xxho455pjOn4Aoxlrb4cwlJSV26dKl+71TAAAAwAtr167V0KFDE12MTqmurlZmZqbKy8t1/PHH66OPPlLfvn07tG5zc7MaGxsVCAS0bt06nXnmmfriiy+UkpISd53i4mItXbpUBQUFnS6r2/k1xiyz1pa45eebDwAAAOAgcu6556qyslINDQ264447Ohx4SM6jdk8//XQ1NjbKWqvp06e3G3h4jeADAAAAOIh0dp5HuKysLHX2TiW3p2Z1FSacAwAAoEfrzDQDdNy+nFeCDwAAAPRYgUBA5eXlBCAHmLVW5eXlCgQCnVqP264AAADQYw0cOFCbNm1SWV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/LOldd/Iu6AICDA8EHAHz7TJW0zlp7rLX2ZpflR0u6UNJxku6TVGOtHSVpkaQrgnn+LOln1toxkm6SNN1lO6WSloe9/42ks6y1x0g6Pyx9qaRT9uN4AADdhC/RBQAAHHTmW2t3S9ptjKmS882EJK2UNNIYkynpJEmzjDGhdVJdttNPUlnY+48kPWmMmSlpTlj6dkn9D2D5AQAHKYIPAEC0+rDXLWHvW+RcN5IkVVprj93LdmolZYfeWGt/Yow5QdI5kpYZY8ZYa8slBYJ5AQA9HLddAcC3z25JWfu6srV2l6R/GmMmSZJxHOOSda2kw0NvjDGHWWs/ttb+Rs43IkXBRUdKWrWv5QEAdB8EHwDwLRP8tuGj4OTv3+3jZn4o6WpjzGeSVkua6JLnfUmjTNu9Wb8zxqwMTm5fKOmzYPrpkl7bx3IAALoRHrULAOgyxpj/ljTXWvtOnOWpkv4q6WRrbZOnhQMAeI5vPgAAXek/JKW3s3yQpKkEHgDw7cA3HwAAAAA8wTcfAAAAADxB8AEAAADAEwQfAAAAADxB8AEAAADAEwQfAAAAADzx/wFuIEVmInBJigAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1008x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "min_x = 0\n",
    "max_x = audio.duration_s\n",
    "\n",
    "x_audio = np.arange(min_x, max_x + 0.01, 0.01)\n",
    "\n",
    "y_slice = np.array([np.nan] * len(x_audio))\n",
    "for start_s, end_s in slice_intervals:\n",
    "    y_slice[int(round(start_s*100)):int(round(end_s*100))] = 1\n",
    "    \n",
    "y_vad = np.array([np.nan] * len(x_audio))\n",
    "for e in vad_gaps:\n",
    "    y_vad[int(round(e.lower*100)):int(round(e.upper*100))] = 0.9\n",
    "    \n",
    "y_align = np.array([np.nan] * len(x_audio))\n",
    "for e in align_gaps:\n",
    "    y_align[int(round(e.lower*100)):int(round(e.upper*100))] = 0.8\n",
    "\n",
    "    \n",
    "plt.figure(figsize=(14, 3))\n",
    "plt.plot(x_audio, y_slice, linewidth=5, label=\"slices\")\n",
    "plt.plot(x_audio, y_vad, linewidth=5, label=\"vad gaps\")\n",
    "plt.plot(x_audio, y_align, linewidth=5, label=\"align gaps\")\n",
    "gca().axes.get_yaxis().set_visible(False)\n",
    "plt.legend()\n",
    "plt.xlabel(\"time (s)\")\n",
    "plt.show();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "554a3576",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b34c6371",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f41f79ca",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "091c12f9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "7ce82fd1",
   "metadata": {},
   "source": [
    "## multi gpu nemo pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c4af4fe9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "with open(\"/home/mikey/notebooks/datasets/mixed-sample-metadata_big.json\") as f:\n",
    "    data = json.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "07d46ef9",
   "metadata": {},
   "outputs": [],
   "source": [
    "from suno_utils.web.nemo import transcribe_multi_gpu\n",
    "filepaths = [e[\"uri\"] for e in data[:200]]\n",
    "out = transcribe_multi_gpu(filepaths, quiet=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6891adaf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "200\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "['arthur witney went on to create the k language a proprietary array language',\n",
       " 'lasers pointed at aircraft are a hazard to aviation']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(len(out))\n",
    "out[:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cf8267b7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f9272038",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e78b3a53",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "c88d5747",
   "metadata": {},
   "source": [
    "## Playground"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "919508a2",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(\"transcribeMe_1139063__4bab9d63-c1ce-4c65-be67-75bbc711ccb4__0__300000.json\") as f:\n",
    "    d = json.load(f)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "ed46a4c2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['speaker', 'words'])"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d[\"text\"][0].keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "73bc5221",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello. My name is Barry Williame Magliarditi, your host of this episode of the Freedom Series, uh, livestream session, and today, I've got Ronan Leonard on the phone, uh, on the call from lockdown in Sicktoria, Melbourne. Mate, how you doing today?\n",
      "\n",
      "Very well, thanks. Well, today is either yesterday, today, or tomorrow, right? There are no weekends. It's just one of those three days. [laughter] It's like--\n",
      "\n",
      "Yeah.\n",
      "\n",
      "--déjà vu all over again.\n",
      "\n",
      "Yep. Absolutely. Absolutely. Well, I, I guess, uh, super excited for us to chat today, and we're gonna chat to-- so Ronan's a cofounder of a disruptive management consulting company that helps organizations get a three to seven times increase in engagement by identifying the unmet needs of their customers. Uh, and what I'd like us to kinda dive into a little bit today is talk about the hypernormalization of low engagement due to mass communication tools, which have sacrificed efficiency for relevancy. And before we do, uh, I'd like to just, just extend a warm welcome to everyone who's watching us live. Wherever you are in the world, whatever platform you're on, um, welcome to the show. [Raffi?] from my team, uh, hey, [Raffi?]. How you doing, mate? He's out there, uh, overseeing all your comments and questions. So let's make this as-- uh, I guess as conversational as possible. So any questions you've got for myself or Ronan, please put them in the chat of wherever you're watching this, and, uh, we'll get them answered here. Hit the like button. Let us know that you're watching. And also, uh, why not start a watch party and share it across your feed to other business owners and entrepreneurs as well? So, Ronan, let's talk a little bit about the hypernormalization. Where do we kick off with this?\n",
      "\n",
      "We probably kick off with the fact that everybody would agree that it's costing them far more to reach fewer people on just about every social media platform.\n",
      "\n",
      "Absolutely.\n",
      "\n",
      "So what they tend to do is just produce more content. Uh, you know, Gary V's telling small business owners to film the day in the life and, and chop up all this content [inaudible]. Let's be honest. Who's going to watch it? If you don't-- if you haven't already built a, uh, a following of, of people across these social media platforms, just pushing more content out there isn't gonna get you more engagement. So there's a couple of things within that. First off, we, we-- as I say, communication tools become the norms. Everyone builds a funnel. Everybody, uh, creates a piece of content and pushes it out to four or five platforms at the same time, and we exponentially are creating more and more content but with fewer and fewer engagement. At the same time, we're kinda waving the white flag and going, \"Okay. Well, if, if my conversion rate's only 3%, then I've just gotta put more people into a funnel and, and then another 100 people, another 100 people in to get my 3 people to come out of that--\"\n",
      "\n",
      "Yeah.\n",
      "\n",
      "--without ever really addressing the root cause of that, which is you probably don't know your customers well enough. You don't know what they're thinking. You don't know their unmet needs. You don't know what they're really worried or concerned about, their beliefs and their concerns. And therefore, you just think, \"Well, it's okay. There's a-- there's a never-ending stream of customers out there,\" eh, which is fine for a very small business, right? If you've got a very small business and you've got a huge target market, uh, you go, \"Oh, that's not a problem.\" But you r-reach this point where you've saturated the market. Everyone's either heard of you or not interested 'cause, again, you don't know what they're really interested in or, as I said, it just gets more and more expensive to put people into that, that funnel or your marketing sequence. So would you agree with that, Barry? What are you-- what are your thoughts on that?\n",
      "\n",
      "Yeah. Well, I-- yes. It's a-- it's a very interesting topic, and, um, you know, we're seeing-- like, obviously, Google platform's quite expensive to, to advertise on. But, you know, you're speaking to a target audience. If you look at Eugene Schwartz's five levels of awareness, you go from, you know, unaware through to problem aware--\n",
      "\n",
      "Mm-hmm.\n",
      "\n",
      "--solution aware, product aware, most aware. You know, you speak to someone on Google if you're advertising there who's product or most aware. So therefore, you are paying more for a click or for a lead, um, but you're also speaking to a more qualified buyer. Now, the problem with that is is that you are competing against, um, other companies like for like, or perceivedly like for like, whereas advertising on social platforms like Facebook or Instagram where people aren't going there to look up your products or service, if you're able to present a piece of, you know, content or an ad or a funnel, um, something that buys their attention, you can get a much cheaper click because you're reaching someone who's either, like, problem or solution aware.\n",
      "\n",
      "Yeah.\n",
      "\n",
      "You've got a chance to influence them more. But I think you're right because, you know, I see many business owners start with-- entrepreneurs start with going after a mass target market. Now, in the beginning, it's okay. They're trying to be everything to everyone, and they're trying to find, like, message-to-market fit. Yet there does become a point in business where that needs to change. And this is where I see a challenge that a lot of entrepreneurs face is they're too rigid in their approach to growing business. It's like they start off doing something, and they get some form of result, so they keep just doing all that same stuff without even--\n",
      "\n",
      "Mm-hmm.\n",
      "\n",
      "--challenging whether or not what they're doing is effective. And as you said, it's like they produce content, but do they have the metrics in place to measure which piece of content is actually piquing the curiosity of their audience? Which piece of content is actually gonna [inaudible]?\n",
      "\n"
     ]
    }
   ],
   "source": [
    "for s in d[\"text\"]:\n",
    "    print(\" \".join([t[\"name\"] for t in s[\"words\"]]))\n",
    "    print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "5b7a7d03",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name': 'Hello.'}"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[\"words\"][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "e71e4632",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'name': 'Hello.'},\n",
       " {'name': 'My'},\n",
       " {'name': 'name'},\n",
       " {'name': 'is'},\n",
       " {'name': 'Barry'},\n",
       " {'name': 'Williame'},\n",
       " {'name': 'Magliarditi,'},\n",
       " {'name': 'your'},\n",
       " {'name': 'host'},\n",
       " {'name': 'of'},\n",
       " {'name': 'this'},\n",
       " {'name': 'episode'},\n",
       " {'name': 'of'},\n",
       " {'name': 'the'},\n",
       " {'name': 'Freedom'},\n",
       " {'name': 'Series,'},\n",
       " {'name': 'uh,'},\n",
       " {'name': 'livestream'},\n",
       " {'name': 'session,'},\n",
       " {'name': 'and'},\n",
       " {'name': 'today,'},\n",
       " {'name': \"I've\"},\n",
       " {'name': 'got'},\n",
       " {'name': 'Ronan'},\n",
       " {'name': 'Leonard'},\n",
       " {'name': 'on'},\n",
       " {'name': 'the'},\n",
       " {'name': 'phone,'},\n",
       " {'name': 'uh,'},\n",
       " {'name': 'on'},\n",
       " {'name': 'the'},\n",
       " {'name': 'call'},\n",
       " {'name': 'from'},\n",
       " {'name': 'lockdown'},\n",
       " {'name': 'in'},\n",
       " {'name': 'Sicktoria,'},\n",
       " {'name': 'Melbourne.'},\n",
       " {'name': 'Mate,'},\n",
       " {'name': 'how'},\n",
       " {'name': 'you'},\n",
       " {'name': 'doing'},\n",
       " {'name': 'today?'}]"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fc46e107",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a486092c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c94958ce",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "31a212cd",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "37f12b05",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c36f53a7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ede8f0af",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "044bf70a",
   "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
}
