{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "955df765",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "4495af27",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(\"test_verbit_format_2.json\") as f:\n",
    "    data = json.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "3c7a9982",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': '5a06f8d2-dfd7-4f67-8d84-0551eba0115a', 'text': 'Barry Magliarditi'},\n",
       " {'id': 'bfea2067-e12a-485b-85d0-8999eeb33b65', 'text': 'Ronan Leonard'}]"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[\"speakers\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "7c6d2d66",
   "metadata": {},
   "outputs": [],
   "source": [
    "tokens = []\n",
    "for s in data[\"segments\"]:\n",
    "    for e in s[\"tokens\"]:\n",
    "        tokens.append(e)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "03c16404",
   "metadata": {},
   "outputs": [],
   "source": [
    "# token format\n",
    "{\n",
    "    'text': str,\n",
    "    'start_time': float,\n",
    "    'end_time': float,\n",
    "    'kind': Union['line_break', 'space', 'tag', 'punctuation', 'word'],\n",
    "    'confidence': Union[0, 0.5, 1],  # not present for ['line_break',  'space']\n",
    "}\n",
    "\n",
    "# tag text: '[LAUGHTER]', '[inaudible]', ...?\n",
    "# space always ' ' and line_break always '\\n' and symbols only here\n",
    "# punctuation always ',', '.', '?' and symbols only here\n",
    "# TODO: what about 3.6?\n",
    "\n",
    "# (phon) can appear as text\n",
    "# hesitation dangling dash\n",
    "# Uh-huh vs Mm-hmm (rev)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e083e225",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d1221274",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e3051395",
   "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
}
