{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Download and convert publicly available transcripts to OA format\n",
    "- Friends dialogue (git repository)\n",
    "- The Office dialogue (Kaggle dataset)\n",
    "- Marvel Cinematic Universe dialogue (Kaggle dataset)\n",
    "- Doctor Who dialogue (Kaggle dataset)\n",
    "- Star Trek dialogue (git repository)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LAION-AI/Open-Assistant/blob/data/datasets/tv_dialogue/public.ipynb)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# uncomment and run below lines to set up if running in colab\n",
    "# !git clone https://github.com/LAION-AI/Open-Assistant.git\n",
    "# %cd Open-Assistant/data/datasets/tv_dialogue\n",
    "# !pip install -r requirements.txt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# download data, you can get your kaggle.json file from your account page https://www.kaggle.com/me/account\n",
    "import kaggle"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# import required packages\n",
    "import os\n",
    "import io\n",
    "import re\n",
    "import requests\n",
    "import json\n",
    "import time\n",
    "import warnings\n",
    "\n",
    "try:\n",
    "    from BeautifulSoup import BeautifulSoup\n",
    "except ImportError:\n",
    "    from bs4 import BeautifulSoup\n",
    "from tqdm import tqdm\n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "from typing import Tuple, Optional, Any"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Friends"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "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>season_id</th>\n",
       "      <th>episode_id</th>\n",
       "      <th>scene_id</th>\n",
       "      <th>utterance_id</th>\n",
       "      <th>speaker</th>\n",
       "      <th>tokens</th>\n",
       "      <th>transcript</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u001</td>\n",
       "      <td>Monica Geller</td>\n",
       "      <td>[['There', \"'s\", 'nothing', 'to', 'tell', '!']...</td>\n",
       "      <td>There's nothing to tell! He's just some guy I ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u002</td>\n",
       "      <td>Joey Tribbiani</td>\n",
       "      <td>[[\"C'mon\", ',', 'you', \"'re\", 'going', 'out', ...</td>\n",
       "      <td>C'mon, you're going out with the guy! There's ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u003</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['All', 'right', 'Joey', ',', 'be', 'nice', '...</td>\n",
       "      <td>All right Joey, be nice. So does he have a hum...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u004</td>\n",
       "      <td>Phoebe Buffay</td>\n",
       "      <td>[['Wait', ',', 'does', 'he', 'eat', 'chalk', '...</td>\n",
       "      <td>Wait, does he eat chalk?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u005</td>\n",
       "      <td>unknown</td>\n",
       "      <td>[]</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67368</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u017</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['Oh', ',', 'it', \"'s\", 'gon', 'na', 'be', 'o...</td>\n",
       "      <td>Oh, it's gonna be okay.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67369</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u018</td>\n",
       "      <td>Rachel Green</td>\n",
       "      <td>[['Do', 'you', 'guys', 'have', 'to', 'go', 'to...</td>\n",
       "      <td>Do you guys have to go to the new house right ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67370</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u019</td>\n",
       "      <td>Monica Geller</td>\n",
       "      <td>[['We', 'got', 'some', 'time', '.']]</td>\n",
       "      <td>We got some time.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67371</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u020</td>\n",
       "      <td>Rachel Green</td>\n",
       "      <td>[['Okay', ',', 'should', 'we', 'get', 'some', ...</td>\n",
       "      <td>Okay, should we get some coffee?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67372</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u021</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['Sure', '.'], ['Where', '?']]</td>\n",
       "      <td>Sure. Where?</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>67373 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      season_id episode_id scene_id utterance_id         speaker  \\\n",
       "0           s01        e01      c01         u001   Monica Geller   \n",
       "1           s01        e01      c01         u002  Joey Tribbiani   \n",
       "2           s01        e01      c01         u003   Chandler Bing   \n",
       "3           s01        e01      c01         u004   Phoebe Buffay   \n",
       "4           s01        e01      c01         u005         unknown   \n",
       "...         ...        ...      ...          ...             ...   \n",
       "67368       s10        e18      c11         u017   Chandler Bing   \n",
       "67369       s10        e18      c11         u018    Rachel Green   \n",
       "67370       s10        e18      c11         u019   Monica Geller   \n",
       "67371       s10        e18      c11         u020    Rachel Green   \n",
       "67372       s10        e18      c11         u021   Chandler Bing   \n",
       "\n",
       "                                                  tokens  \\\n",
       "0      [['There', \"'s\", 'nothing', 'to', 'tell', '!']...   \n",
       "1      [[\"C'mon\", ',', 'you', \"'re\", 'going', 'out', ...   \n",
       "2      [['All', 'right', 'Joey', ',', 'be', 'nice', '...   \n",
       "3      [['Wait', ',', 'does', 'he', 'eat', 'chalk', '...   \n",
       "4                                                     []   \n",
       "...                                                  ...   \n",
       "67368  [['Oh', ',', 'it', \"'s\", 'gon', 'na', 'be', 'o...   \n",
       "67369  [['Do', 'you', 'guys', 'have', 'to', 'go', 'to...   \n",
       "67370               [['We', 'got', 'some', 'time', '.']]   \n",
       "67371  [['Okay', ',', 'should', 'we', 'get', 'some', ...   \n",
       "67372                    [['Sure', '.'], ['Where', '?']]   \n",
       "\n",
       "                                              transcript  \n",
       "0      There's nothing to tell! He's just some guy I ...  \n",
       "1      C'mon, you're going out with the guy! There's ...  \n",
       "2      All right Joey, be nice. So does he have a hum...  \n",
       "3                               Wait, does he eat chalk?  \n",
       "4                                                    NaN  \n",
       "...                                                  ...  \n",
       "67368                            Oh, it's gonna be okay.  \n",
       "67369  Do you guys have to go to the new house right ...  \n",
       "67370                                  We got some time.  \n",
       "67371                   Okay, should we get some coffee?  \n",
       "67372                                       Sure. Where?  \n",
       "\n",
       "[67373 rows x 7 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# friends via https://github.com/emorynlp/character-mining\n",
    "friends = pd.read_csv(\n",
    "    \"https://raw.githubusercontent.com/emorynlp/character-mining/master/tsv/friends_transcripts.tsv\", sep=\"\\t\"\n",
    ")\n",
    "friends"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "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>season_id</th>\n",
       "      <th>episode_id</th>\n",
       "      <th>scene_id</th>\n",
       "      <th>utterance_id</th>\n",
       "      <th>speaker</th>\n",
       "      <th>tokens</th>\n",
       "      <th>transcript</th>\n",
       "      <th>group</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u001</td>\n",
       "      <td>Monica Geller</td>\n",
       "      <td>[['There', \"'s\", 'nothing', 'to', 'tell', '!']...</td>\n",
       "      <td>There's nothing to tell! He's just some guy I ...</td>\n",
       "      <td>s01_e01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u002</td>\n",
       "      <td>Joey Tribbiani</td>\n",
       "      <td>[[\"C'mon\", ',', 'you', \"'re\", 'going', 'out', ...</td>\n",
       "      <td>C'mon, you're going out with the guy! There's ...</td>\n",
       "      <td>s01_e01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u003</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['All', 'right', 'Joey', ',', 'be', 'nice', '...</td>\n",
       "      <td>All right Joey, be nice. So does he have a hum...</td>\n",
       "      <td>s01_e01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u004</td>\n",
       "      <td>Phoebe Buffay</td>\n",
       "      <td>[['Wait', ',', 'does', 'he', 'eat', 'chalk', '...</td>\n",
       "      <td>Wait, does he eat chalk?</td>\n",
       "      <td>s01_e01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u005</td>\n",
       "      <td>unknown</td>\n",
       "      <td>[]</td>\n",
       "      <td>NaN</td>\n",
       "      <td>s01_e01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67368</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u017</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['Oh', ',', 'it', \"'s\", 'gon', 'na', 'be', 'o...</td>\n",
       "      <td>Oh, it's gonna be okay.</td>\n",
       "      <td>s10_e18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67369</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u018</td>\n",
       "      <td>Rachel Green</td>\n",
       "      <td>[['Do', 'you', 'guys', 'have', 'to', 'go', 'to...</td>\n",
       "      <td>Do you guys have to go to the new house right ...</td>\n",
       "      <td>s10_e18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67370</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u019</td>\n",
       "      <td>Monica Geller</td>\n",
       "      <td>[['We', 'got', 'some', 'time', '.']]</td>\n",
       "      <td>We got some time.</td>\n",
       "      <td>s10_e18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67371</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u020</td>\n",
       "      <td>Rachel Green</td>\n",
       "      <td>[['Okay', ',', 'should', 'we', 'get', 'some', ...</td>\n",
       "      <td>Okay, should we get some coffee?</td>\n",
       "      <td>s10_e18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67372</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u021</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['Sure', '.'], ['Where', '?']]</td>\n",
       "      <td>Sure. Where?</td>\n",
       "      <td>s10_e18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>67373 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      season_id episode_id scene_id utterance_id         speaker  \\\n",
       "0           s01        e01      c01         u001   Monica Geller   \n",
       "1           s01        e01      c01         u002  Joey Tribbiani   \n",
       "2           s01        e01      c01         u003   Chandler Bing   \n",
       "3           s01        e01      c01         u004   Phoebe Buffay   \n",
       "4           s01        e01      c01         u005         unknown   \n",
       "...         ...        ...      ...          ...             ...   \n",
       "67368       s10        e18      c11         u017   Chandler Bing   \n",
       "67369       s10        e18      c11         u018    Rachel Green   \n",
       "67370       s10        e18      c11         u019   Monica Geller   \n",
       "67371       s10        e18      c11         u020    Rachel Green   \n",
       "67372       s10        e18      c11         u021   Chandler Bing   \n",
       "\n",
       "                                                  tokens  \\\n",
       "0      [['There', \"'s\", 'nothing', 'to', 'tell', '!']...   \n",
       "1      [[\"C'mon\", ',', 'you', \"'re\", 'going', 'out', ...   \n",
       "2      [['All', 'right', 'Joey', ',', 'be', 'nice', '...   \n",
       "3      [['Wait', ',', 'does', 'he', 'eat', 'chalk', '...   \n",
       "4                                                     []   \n",
       "...                                                  ...   \n",
       "67368  [['Oh', ',', 'it', \"'s\", 'gon', 'na', 'be', 'o...   \n",
       "67369  [['Do', 'you', 'guys', 'have', 'to', 'go', 'to...   \n",
       "67370               [['We', 'got', 'some', 'time', '.']]   \n",
       "67371  [['Okay', ',', 'should', 'we', 'get', 'some', ...   \n",
       "67372                    [['Sure', '.'], ['Where', '?']]   \n",
       "\n",
       "                                              transcript    group  \n",
       "0      There's nothing to tell! He's just some guy I ...  s01_e01  \n",
       "1      C'mon, you're going out with the guy! There's ...  s01_e01  \n",
       "2      All right Joey, be nice. So does he have a hum...  s01_e01  \n",
       "3                               Wait, does he eat chalk?  s01_e01  \n",
       "4                                                    NaN  s01_e01  \n",
       "...                                                  ...      ...  \n",
       "67368                            Oh, it's gonna be okay.  s10_e18  \n",
       "67369  Do you guys have to go to the new house right ...  s10_e18  \n",
       "67370                                  We got some time.  s10_e18  \n",
       "67371                   Okay, should we get some coffee?  s10_e18  \n",
       "67372                                       Sure. Where?  s10_e18  \n",
       "\n",
       "[67373 rows x 8 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "friends[\"group\"] = friends[[\"season_id\", \"episode_id\"]].apply(lambda x: f\"{x[0]}_{x[1]}\", axis=1)\n",
    "friends"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "episode_list = \"\"\"\n",
    "Season 1\n",
    "The Pilot\n",
    "The One With the Sonogram at the End\n",
    "The One With the Thumb\n",
    "The One With George Stephanopoulos\n",
    "The One With the East German Laundry Detergent\n",
    "The One With the Butt\n",
    "The One With the Blackout\n",
    "The One Where Nana Dies Twice\n",
    "The One Where Underdog Gets Away\n",
    "The One With the Monkey\n",
    "The One With Mrs Bing\n",
    "The One With the Dozen Lasagnas\n",
    "The One With the Boobies\n",
    "The One With the Candy Hearts\n",
    "The One With the Stoned Guy\n",
    "The One With Two Parts, Part 1\n",
    "The One With Two Parts, Part 2\n",
    "The One With All the Poker\n",
    "The One Where the Monkey Gets Away\n",
    "The One with the Evil Orthodontist\n",
    "The One with Fake Monica\n",
    "The One with the Ick Factor\n",
    "The One with the Birth\n",
    "The One where Rachel Finds Out\n",
    "\n",
    "Season 2\n",
    "The One With Ross' New Girlfriend\n",
    "The One With the Breast Milk\n",
    "The One Where Heckles Dies\n",
    "The One With Phoebe's Husband\n",
    "The One With Five Steaks and an Eggplant\n",
    "The One With the Baby on the Bus\n",
    "The One Where Ross Finds Out\n",
    "The One With the List\n",
    "The One With Phoebe's Dad\n",
    "The One With Russ\n",
    "The One With The Lesbian Wedding\n",
    "The One After the Superbowl, Part 1\n",
    "The One After the Superbowl, Part 2\n",
    "The One With The Prom Video\n",
    "The One Where Ross and RachelYou Know\n",
    "The One Where Joey Moves Out\n",
    "The One Where Eddie Moves In\n",
    "The One Where Dr Ramoray Dies\n",
    "The One Where Eddie Won't Go\n",
    "The One Where Old Yeller Dies\n",
    "The One With The Bullies\n",
    "The One With Two Parties\n",
    "The One With The Chicken Pox\n",
    "The One With Barry & Mindy's Wedding\n",
    "\n",
    "Season 3\n",
    "The One With The Princess Leia Fantasy\n",
    "The One Where No One's Ready\n",
    "The One With The Jam\n",
    "The One With The Metaphorical Tunnel\n",
    "The One With Frank, Jr\n",
    "The One With The Flashback\n",
    "The One With The Racecar Bed\n",
    "The One With The Giant Poking Device\n",
    "The One With The Football\n",
    "The One Where Rachel Quits\n",
    "The One Where Chandler Can't Remember Which Sister\n",
    "The One With All The Jealousy\n",
    "The One Where Monica and Richard Are Just Friends\n",
    "The One With Phoebe's Ex-Partner\n",
    "The One Where Ross And Rachel Take A Break\n",
    "The One The Morning After\n",
    "The One Without The Ski Trip\n",
    "The One With The Hypnosis Tape\n",
    "The One With The Tiny T-Shirt\n",
    "The One With The Dollhouse\n",
    "The One With a Chick And a Duck\n",
    "The One With The Screamer\n",
    "The One With Ross's Thing\n",
    "The One With The Ultimate Fighting Champion\n",
    "The One At The Beach\n",
    "\n",
    "Season 4\n",
    "The One With The Jellyfish\n",
    "The One With The Cat\n",
    "The One With The 'Cuffs\n",
    "The One With The Ballroom Dancing\n",
    "The One With Joey's New Girlfriend\n",
    "The One With The Dirty Girl\n",
    "The One Where Chandler Crosses The Line\n",
    "The One With Chandler In A Box\n",
    "The One Where They're Going To PARTY!\n",
    "The One With The Girl From Poughkeepsie\n",
    "The One With Phoebe's Uterus\n",
    "The One With The Embryos\n",
    "The One With Rachel's Crush\n",
    "The One With Joey's Dirty Day\n",
    "The One With All The Rugby\n",
    "The One With The Fake Party\n",
    "The One With The Free Porn\n",
    "The One With Rachel's New Dress\n",
    "The One With All The Haste\n",
    "The One With All The Wedding Dresses\n",
    "The One With The Invitation\n",
    "The One With The Worst Best Man Ever\n",
    "The One With Ross's Wedding, Part 1\n",
    "The One With Ross's Wedding, Part 2\n",
    "\n",
    "Season 5\n",
    "The One After Ross Says Rachel\n",
    "The One With All The Kissing\n",
    "The One With The Triplets\n",
    "The One Where Phoebe Hates PBS\n",
    "The One With The Kips\n",
    "The One With The Yeti\n",
    "The One Where Ross Moves In\n",
    "The One With All The Thanksgivings\n",
    "The One With Ross's Sandwich\n",
    "The One With The Inappropriate Sister\n",
    "The One With All The Resolutions\n",
    "The One With Chandler's Work Laugh\n",
    "The One With Joey's Bag\n",
    "The One Where Everybody Finds Out\n",
    "The One With The Girl Who Hits Joey\n",
    "The One With The Cop\n",
    "The One With Rachel's Inadvertent Kiss\n",
    "The One Where Rachel Smokes\n",
    "The One Where Ross Can't Flirt\n",
    "The One With The Ride-Along\n",
    "The One With The Ball\n",
    "The One With Joey's Big Break\n",
    "The One In Vegas, Part 1\n",
    "The One In Vegas, Part 2\n",
    "\n",
    "Season 6\n",
    "The One After Vegas\n",
    "The One Where Ross Hugs Rachel\n",
    "The One With Ross's Denial\n",
    "The One Where Joey Loses His Insurance\n",
    "The One With Joey's Porsche\n",
    "The One On The Last Night\n",
    "The One Where Phoebe Runs\n",
    "The One With Ross's Teeth\n",
    "The One Where Ross Got High\n",
    "The One With The Routine\n",
    "The One With The Apothecary Table\n",
    "The One With The Joke\n",
    "The One With Rachel's Sister\n",
    "The One Where Chandler Can't Cry\n",
    "The One That Could Have Been, Part 1\n",
    "The One That Could Have Been, Part 2\n",
    "The One With Unagi\n",
    "The One Where Ross Dates a Student\n",
    "The One With Joey's Fridge\n",
    "The One With Mac & C.H.E.E.S.E.\n",
    "The One Where Ross Meets Elizabeth's Dad\n",
    "The One Where Paul's The Man\n",
    "The One With The Ring\n",
    "The One With The Proposal, Part 1\n",
    "The One With The Proposal, Part 2\n",
    "\n",
    "Season 7\n",
    "The One With Monica's Thunder\n",
    "The One With Rachel's Book\n",
    "The One With Phoebe's Cookies\n",
    "The One With Rachel's Assistant\n",
    "The One With The Engagement Picture\n",
    "The One With The Nap Partners\n",
    "The One With Ross's Library Book\n",
    "The One Where Chandler Doesn't Like Dogs\n",
    "The One With All The Candy\n",
    "The One With the Holiday Armadillo\n",
    "The One With All The Cheesecakes\n",
    "The One Where They're Up All Night\n",
    "The One Where Rosita Dies\n",
    "The One Where They All Turn Thirty\n",
    "The One With Joey's New Brain\n",
    "The One With The Truth About London\n",
    "The One With The Cheap Wedding Dress\n",
    "The One With Joey's Award\n",
    "The One With Ross and Monica's Cousin\n",
    "The One With Rachel's Big Kiss\n",
    "The One With The Vows\n",
    "The One With Chandler's Dad\n",
    "The One With Monica and Chandler's Wedding, Part 1\n",
    "The One With Monica and Chandler's Wedding, Part 2\n",
    "\n",
    "Season 8\n",
    "The One After \"I Do\"\n",
    "The One With The Red Sweater\n",
    "The One Where Rachel Tells\n",
    "The One With The Video Tape\n",
    "The One With Rachel's Date\n",
    "The One With The Halloween Party\n",
    "The One With The Stain\n",
    "The One With The Stripper\n",
    "The One With The Rumor\n",
    "The One With Monica's Boots\n",
    "The One With Ross' Step Forward\n",
    "The One Where Joey Dates Rachel\n",
    "The One Where Chandler Takes a Bath\n",
    "The One With The Secret Closet\n",
    "The One With The Birthing Video\n",
    "The One Where Joey Tells Rachel\n",
    "The One With The Tea Leaves\n",
    "The One In Massapequa\n",
    "The One With Joey's Interview\n",
    "The One With The Baby Shower\n",
    "The One With The Cooking Class\n",
    "The One Where Rachel is Late\n",
    "The One Where Rachel Has a Baby, Part 1\n",
    "The One Where Rachel Has a Baby, Part 2\n",
    "\n",
    "Season 9\n",
    "The One Where No One Proposes\n",
    "The One Where Emma Cries\n",
    "The One With the Pediatrician\n",
    "The One With the Sharks\n",
    "The One With Phoebe's Birthday Dinner\n",
    "The One With the Male Nanny\n",
    "The One With Ross's Inappropriate Song\n",
    "The One With Rachel's Other Sister\n",
    "The One With Rachel's Phone Number\n",
    "The One With Christmas in Tulsa\n",
    "The One Where Rachel Goes Back To Work\n",
    "The One With Phoebe's Rats\n",
    "The One Where Monica Sings\n",
    "The One With The Blind Dates\n",
    "The One With The Mugging\n",
    "The One With The Boob Job\n",
    "The One With The Memorial Service\n",
    "The One With The Lottery\n",
    "The One With Rachel's Dream\n",
    "The One With The Soap Opera Party\n",
    "The One With The Fertility Test\n",
    "The One With The Donor\n",
    "The One In Barbados, Part 1\n",
    "The One In Barbados, Part 2\n",
    "\n",
    "Season 10\n",
    "The One After Joey and Rachel Kiss\n",
    "The One Where Ross is Fine\n",
    "The One With Ross's Tan\n",
    "The One With the Cake\n",
    "The One Where Rachel's Sister Baby-sits\n",
    "The One With Ross's Grant\n",
    "The One With the Home Study\n",
    "The One With the Late Thanksgiving\n",
    "The One With The Birth Mother\n",
    "The One Where Chandler Gets Caught\n",
    "The One Where The Stripper Cries\n",
    "The One With Phoebe's Wedding\n",
    "The One Where Joey Speaks French\n",
    "The One With Princess Consuela\n",
    "The One Where Estelle Dies\n",
    "The One With Rachel's Going Away Party\n",
    "The Last One, Part 1\n",
    "The Last One, Part 2\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'s01': {'e01': 'The Pilot',\n",
       "  'e02': 'The One With the Sonogram at the End',\n",
       "  'e03': 'The One With the Thumb',\n",
       "  'e04': 'The One With George Stephanopoulos',\n",
       "  'e05': 'The One With the East German Laundry Detergent',\n",
       "  'e06': 'The One With the Butt',\n",
       "  'e07': 'The One With the Blackout',\n",
       "  'e08': 'The One Where Nana Dies Twice',\n",
       "  'e09': 'The One Where Underdog Gets Away',\n",
       "  'e10': 'The One With the Monkey',\n",
       "  'e11': 'The One With Mrs Bing',\n",
       "  'e12': 'The One With the Dozen Lasagnas',\n",
       "  'e13': 'The One With the Boobies',\n",
       "  'e14': 'The One With the Candy Hearts',\n",
       "  'e15': 'The One With the Stoned Guy',\n",
       "  'e16': 'The One With Two Parts, Part 1',\n",
       "  'e17': 'The One With Two Parts, Part 2',\n",
       "  'e18': 'The One With All the Poker',\n",
       "  'e19': 'The One Where the Monkey Gets Away',\n",
       "  'e20': 'The One with the Evil Orthodontist',\n",
       "  'e21': 'The One with Fake Monica',\n",
       "  'e22': 'The One with the Ick Factor',\n",
       "  'e23': 'The One with the Birth',\n",
       "  'e24': 'The One where Rachel Finds Out'},\n",
       " 's02': {'e01': \"The One With Ross' New Girlfriend\",\n",
       "  'e02': 'The One With the Breast Milk',\n",
       "  'e03': 'The One Where Heckles Dies',\n",
       "  'e04': \"The One With Phoebe's Husband\",\n",
       "  'e05': 'The One With Five Steaks and an Eggplant',\n",
       "  'e06': 'The One With the Baby on the Bus',\n",
       "  'e07': 'The One Where Ross Finds Out',\n",
       "  'e08': 'The One With the List',\n",
       "  'e09': \"The One With Phoebe's Dad\",\n",
       "  'e10': 'The One With Russ',\n",
       "  'e11': 'The One With The Lesbian Wedding',\n",
       "  'e12': 'The One After the Superbowl, Part 1',\n",
       "  'e13': 'The One After the Superbowl, Part 2',\n",
       "  'e14': 'The One With The Prom Video',\n",
       "  'e15': 'The One Where Ross and RachelYou Know',\n",
       "  'e16': 'The One Where Joey Moves Out',\n",
       "  'e17': 'The One Where Eddie Moves In',\n",
       "  'e18': 'The One Where Dr Ramoray Dies',\n",
       "  'e19': \"The One Where Eddie Won't Go\",\n",
       "  'e20': 'The One Where Old Yeller Dies',\n",
       "  'e21': 'The One With The Bullies',\n",
       "  'e22': 'The One With Two Parties',\n",
       "  'e23': 'The One With The Chicken Pox',\n",
       "  'e24': \"The One With Barry & Mindy's Wedding\"},\n",
       " 's03': {'e01': 'The One With The Princess Leia Fantasy',\n",
       "  'e02': \"The One Where No One's Ready\",\n",
       "  'e03': 'The One With The Jam',\n",
       "  'e04': 'The One With The Metaphorical Tunnel',\n",
       "  'e05': 'The One With Frank, Jr',\n",
       "  'e06': 'The One With The Flashback',\n",
       "  'e07': 'The One With The Racecar Bed',\n",
       "  'e08': 'The One With The Giant Poking Device',\n",
       "  'e09': 'The One With The Football',\n",
       "  'e10': 'The One Where Rachel Quits',\n",
       "  'e11': \"The One Where Chandler Can't Remember Which Sister\",\n",
       "  'e12': 'The One With All The Jealousy',\n",
       "  'e13': 'The One Where Monica and Richard Are Just Friends',\n",
       "  'e14': \"The One With Phoebe's Ex-Partner\",\n",
       "  'e15': 'The One Where Ross And Rachel Take A Break',\n",
       "  'e16': 'The One The Morning After',\n",
       "  'e17': 'The One Without The Ski Trip',\n",
       "  'e18': 'The One With The Hypnosis Tape',\n",
       "  'e19': 'The One With The Tiny T-Shirt',\n",
       "  'e20': 'The One With The Dollhouse',\n",
       "  'e21': 'The One With a Chick And a Duck',\n",
       "  'e22': 'The One With The Screamer',\n",
       "  'e23': \"The One With Ross's Thing\",\n",
       "  'e24': 'The One With The Ultimate Fighting Champion',\n",
       "  'e25': 'The One At The Beach'},\n",
       " 's04': {'e01': 'The One With The Jellyfish',\n",
       "  'e02': 'The One With The Cat',\n",
       "  'e03': \"The One With The 'Cuffs\",\n",
       "  'e04': 'The One With The Ballroom Dancing',\n",
       "  'e05': \"The One With Joey's New Girlfriend\",\n",
       "  'e06': 'The One With The Dirty Girl',\n",
       "  'e07': 'The One Where Chandler Crosses The Line',\n",
       "  'e08': 'The One With Chandler In A Box',\n",
       "  'e09': \"The One Where They're Going To PARTY!\",\n",
       "  'e10': 'The One With The Girl From Poughkeepsie',\n",
       "  'e11': \"The One With Phoebe's Uterus\",\n",
       "  'e12': 'The One With The Embryos',\n",
       "  'e13': \"The One With Rachel's Crush\",\n",
       "  'e14': \"The One With Joey's Dirty Day\",\n",
       "  'e15': 'The One With All The Rugby',\n",
       "  'e16': 'The One With The Fake Party',\n",
       "  'e17': 'The One With The Free Porn',\n",
       "  'e18': \"The One With Rachel's New Dress\",\n",
       "  'e19': 'The One With All The Haste',\n",
       "  'e20': 'The One With All The Wedding Dresses',\n",
       "  'e21': 'The One With The Invitation',\n",
       "  'e22': 'The One With The Worst Best Man Ever',\n",
       "  'e23': \"The One With Ross's Wedding, Part 1\",\n",
       "  'e24': \"The One With Ross's Wedding, Part 2\"},\n",
       " 's05': {'e01': 'The One After Ross Says Rachel',\n",
       "  'e02': 'The One With All The Kissing',\n",
       "  'e03': 'The One With The Triplets',\n",
       "  'e04': 'The One Where Phoebe Hates PBS',\n",
       "  'e05': 'The One With The Kips',\n",
       "  'e06': 'The One With The Yeti',\n",
       "  'e07': 'The One Where Ross Moves In',\n",
       "  'e08': 'The One With All The Thanksgivings',\n",
       "  'e09': \"The One With Ross's Sandwich\",\n",
       "  'e10': 'The One With The Inappropriate Sister',\n",
       "  'e11': 'The One With All The Resolutions',\n",
       "  'e12': \"The One With Chandler's Work Laugh\",\n",
       "  'e13': \"The One With Joey's Bag\",\n",
       "  'e14': 'The One Where Everybody Finds Out',\n",
       "  'e15': 'The One With The Girl Who Hits Joey',\n",
       "  'e16': 'The One With The Cop',\n",
       "  'e17': \"The One With Rachel's Inadvertent Kiss\",\n",
       "  'e18': 'The One Where Rachel Smokes',\n",
       "  'e19': \"The One Where Ross Can't Flirt\",\n",
       "  'e20': 'The One With The Ride-Along',\n",
       "  'e21': 'The One With The Ball',\n",
       "  'e22': \"The One With Joey's Big Break\",\n",
       "  'e23': 'The One In Vegas, Part 1',\n",
       "  'e24': 'The One In Vegas, Part 2'},\n",
       " 's06': {'e01': 'The One After Vegas',\n",
       "  'e02': 'The One Where Ross Hugs Rachel',\n",
       "  'e03': \"The One With Ross's Denial\",\n",
       "  'e04': 'The One Where Joey Loses His Insurance',\n",
       "  'e05': \"The One With Joey's Porsche\",\n",
       "  'e06': 'The One On The Last Night',\n",
       "  'e07': 'The One Where Phoebe Runs',\n",
       "  'e08': \"The One With Ross's Teeth\",\n",
       "  'e09': 'The One Where Ross Got High',\n",
       "  'e10': 'The One With The Routine',\n",
       "  'e11': 'The One With The Apothecary Table',\n",
       "  'e12': 'The One With The Joke',\n",
       "  'e13': \"The One With Rachel's Sister\",\n",
       "  'e14': \"The One Where Chandler Can't Cry\",\n",
       "  'e15': 'The One That Could Have Been, Part 1',\n",
       "  'e16': 'The One That Could Have Been, Part 2',\n",
       "  'e17': 'The One With Unagi',\n",
       "  'e18': 'The One Where Ross Dates a Student',\n",
       "  'e19': \"The One With Joey's Fridge\",\n",
       "  'e20': 'The One With Mac & C.H.E.E.S.E.',\n",
       "  'e21': \"The One Where Ross Meets Elizabeth's Dad\",\n",
       "  'e22': \"The One Where Paul's The Man\",\n",
       "  'e23': 'The One With The Ring',\n",
       "  'e24': 'The One With The Proposal, Part 1',\n",
       "  'e25': 'The One With The Proposal, Part 2'},\n",
       " 's07': {'e01': \"The One With Monica's Thunder\",\n",
       "  'e02': \"The One With Rachel's Book\",\n",
       "  'e03': \"The One With Phoebe's Cookies\",\n",
       "  'e04': \"The One With Rachel's Assistant\",\n",
       "  'e05': 'The One With The Engagement Picture',\n",
       "  'e06': 'The One With The Nap Partners',\n",
       "  'e07': \"The One With Ross's Library Book\",\n",
       "  'e08': \"The One Where Chandler Doesn't Like Dogs\",\n",
       "  'e09': 'The One With All The Candy',\n",
       "  'e10': 'The One With the Holiday Armadillo',\n",
       "  'e11': 'The One With All The Cheesecakes',\n",
       "  'e12': \"The One Where They're Up All Night\",\n",
       "  'e13': 'The One Where Rosita Dies',\n",
       "  'e14': 'The One Where They All Turn Thirty',\n",
       "  'e15': \"The One With Joey's New Brain\",\n",
       "  'e16': 'The One With The Truth About London',\n",
       "  'e17': 'The One With The Cheap Wedding Dress',\n",
       "  'e18': \"The One With Joey's Award\",\n",
       "  'e19': \"The One With Ross and Monica's Cousin\",\n",
       "  'e20': \"The One With Rachel's Big Kiss\",\n",
       "  'e21': 'The One With The Vows',\n",
       "  'e22': \"The One With Chandler's Dad\",\n",
       "  'e23': \"The One With Monica and Chandler's Wedding, Part 1\",\n",
       "  'e24': \"The One With Monica and Chandler's Wedding, Part 2\"},\n",
       " 's08': {'e01': 'The One After \"I Do\"',\n",
       "  'e02': 'The One With The Red Sweater',\n",
       "  'e03': 'The One Where Rachel Tells',\n",
       "  'e04': 'The One With The Video Tape',\n",
       "  'e05': \"The One With Rachel's Date\",\n",
       "  'e06': 'The One With The Halloween Party',\n",
       "  'e07': 'The One With The Stain',\n",
       "  'e08': 'The One With The Stripper',\n",
       "  'e09': 'The One With The Rumor',\n",
       "  'e10': \"The One With Monica's Boots\",\n",
       "  'e11': \"The One With Ross' Step Forward\",\n",
       "  'e12': 'The One Where Joey Dates Rachel',\n",
       "  'e13': 'The One Where Chandler Takes a Bath',\n",
       "  'e14': 'The One With The Secret Closet',\n",
       "  'e15': 'The One With The Birthing Video',\n",
       "  'e16': 'The One Where Joey Tells Rachel',\n",
       "  'e17': 'The One With The Tea Leaves',\n",
       "  'e18': 'The One In Massapequa',\n",
       "  'e19': \"The One With Joey's Interview\",\n",
       "  'e20': 'The One With The Baby Shower',\n",
       "  'e21': 'The One With The Cooking Class',\n",
       "  'e22': 'The One Where Rachel is Late',\n",
       "  'e23': 'The One Where Rachel Has a Baby, Part 1',\n",
       "  'e24': 'The One Where Rachel Has a Baby, Part 2'},\n",
       " 's09': {'e01': 'The One Where No One Proposes',\n",
       "  'e02': 'The One Where Emma Cries',\n",
       "  'e03': 'The One With the Pediatrician',\n",
       "  'e04': 'The One With the Sharks',\n",
       "  'e05': \"The One With Phoebe's Birthday Dinner\",\n",
       "  'e06': 'The One With the Male Nanny',\n",
       "  'e07': \"The One With Ross's Inappropriate Song\",\n",
       "  'e08': \"The One With Rachel's Other Sister\",\n",
       "  'e09': \"The One With Rachel's Phone Number\",\n",
       "  'e10': 'The One With Christmas in Tulsa',\n",
       "  'e11': 'The One Where Rachel Goes Back To Work',\n",
       "  'e12': \"The One With Phoebe's Rats\",\n",
       "  'e13': 'The One Where Monica Sings',\n",
       "  'e14': 'The One With The Blind Dates',\n",
       "  'e15': 'The One With The Mugging',\n",
       "  'e16': 'The One With The Boob Job',\n",
       "  'e17': 'The One With The Memorial Service',\n",
       "  'e18': 'The One With The Lottery',\n",
       "  'e19': \"The One With Rachel's Dream\",\n",
       "  'e20': 'The One With The Soap Opera Party',\n",
       "  'e21': 'The One With The Fertility Test',\n",
       "  'e22': 'The One With The Donor',\n",
       "  'e23': 'The One In Barbados, Part 1',\n",
       "  'e24': 'The One In Barbados, Part 2'},\n",
       " 's10': {'e01': 'The One After Joey and Rachel Kiss',\n",
       "  'e02': 'The One Where Ross is Fine',\n",
       "  'e03': \"The One With Ross's Tan\",\n",
       "  'e04': 'The One With the Cake',\n",
       "  'e05': \"The One Where Rachel's Sister Baby-sits\",\n",
       "  'e06': \"The One With Ross's Grant\",\n",
       "  'e07': 'The One With the Home Study',\n",
       "  'e08': 'The One With the Late Thanksgiving',\n",
       "  'e09': 'The One With The Birth Mother',\n",
       "  'e10': 'The One Where Chandler Gets Caught',\n",
       "  'e11': 'The One Where The Stripper Cries',\n",
       "  'e12': \"The One With Phoebe's Wedding\",\n",
       "  'e13': 'The One Where Joey Speaks French',\n",
       "  'e14': 'The One With Princess Consuela',\n",
       "  'e15': 'The One Where Estelle Dies',\n",
       "  'e16': \"The One With Rachel's Going Away Party\",\n",
       "  'e17': 'The Last One, Part 1',\n",
       "  'e18': 'The Last One, Part 2'}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "episodes, season, cnt = {}, \"\", 0\n",
    "for line in episode_list.split(\"\\n\"):\n",
    "    if not line:\n",
    "        continue\n",
    "    if line.startswith(\"Season \"):\n",
    "        season = f\"s{line.split('Season ', 1)[1].zfill(2)}\"\n",
    "        cnt = 1\n",
    "        if season not in episodes:\n",
    "            episodes[season] = {}\n",
    "    else:\n",
    "        episodes[season][f\"e{str(cnt).zfill(2)}\"] = line.strip()\n",
    "        cnt += 1\n",
    "episodes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "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>season_id</th>\n",
       "      <th>episode_id</th>\n",
       "      <th>scene_id</th>\n",
       "      <th>utterance_id</th>\n",
       "      <th>speaker</th>\n",
       "      <th>tokens</th>\n",
       "      <th>transcript</th>\n",
       "      <th>group</th>\n",
       "      <th>utterance</th>\n",
       "      <th>scene</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u001</td>\n",
       "      <td>Monica Geller</td>\n",
       "      <td>[['There', \"'s\", 'nothing', 'to', 'tell', '!']...</td>\n",
       "      <td>There's nothing to tell! He's just some guy I ...</td>\n",
       "      <td>s01_e01</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u002</td>\n",
       "      <td>Joey Tribbiani</td>\n",
       "      <td>[[\"C'mon\", ',', 'you', \"'re\", 'going', 'out', ...</td>\n",
       "      <td>C'mon, you're going out with the guy! There's ...</td>\n",
       "      <td>s01_e01</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u003</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['All', 'right', 'Joey', ',', 'be', 'nice', '...</td>\n",
       "      <td>All right Joey, be nice. So does he have a hum...</td>\n",
       "      <td>s01_e01</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u004</td>\n",
       "      <td>Phoebe Buffay</td>\n",
       "      <td>[['Wait', ',', 'does', 'he', 'eat', 'chalk', '...</td>\n",
       "      <td>Wait, does he eat chalk?</td>\n",
       "      <td>s01_e01</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>s01</td>\n",
       "      <td>e01</td>\n",
       "      <td>c01</td>\n",
       "      <td>u005</td>\n",
       "      <td>unknown</td>\n",
       "      <td>[]</td>\n",
       "      <td>NaN</td>\n",
       "      <td>s01_e01</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67368</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u017</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['Oh', ',', 'it', \"'s\", 'gon', 'na', 'be', 'o...</td>\n",
       "      <td>Oh, it's gonna be okay.</td>\n",
       "      <td>s10_e18</td>\n",
       "      <td>17</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67369</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u018</td>\n",
       "      <td>Rachel Green</td>\n",
       "      <td>[['Do', 'you', 'guys', 'have', 'to', 'go', 'to...</td>\n",
       "      <td>Do you guys have to go to the new house right ...</td>\n",
       "      <td>s10_e18</td>\n",
       "      <td>18</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67370</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u019</td>\n",
       "      <td>Monica Geller</td>\n",
       "      <td>[['We', 'got', 'some', 'time', '.']]</td>\n",
       "      <td>We got some time.</td>\n",
       "      <td>s10_e18</td>\n",
       "      <td>19</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67371</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u020</td>\n",
       "      <td>Rachel Green</td>\n",
       "      <td>[['Okay', ',', 'should', 'we', 'get', 'some', ...</td>\n",
       "      <td>Okay, should we get some coffee?</td>\n",
       "      <td>s10_e18</td>\n",
       "      <td>20</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67372</th>\n",
       "      <td>s10</td>\n",
       "      <td>e18</td>\n",
       "      <td>c11</td>\n",
       "      <td>u021</td>\n",
       "      <td>Chandler Bing</td>\n",
       "      <td>[['Sure', '.'], ['Where', '?']]</td>\n",
       "      <td>Sure. Where?</td>\n",
       "      <td>s10_e18</td>\n",
       "      <td>21</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>67373 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      season_id episode_id scene_id utterance_id         speaker  \\\n",
       "0           s01        e01      c01         u001   Monica Geller   \n",
       "1           s01        e01      c01         u002  Joey Tribbiani   \n",
       "2           s01        e01      c01         u003   Chandler Bing   \n",
       "3           s01        e01      c01         u004   Phoebe Buffay   \n",
       "4           s01        e01      c01         u005         unknown   \n",
       "...         ...        ...      ...          ...             ...   \n",
       "67368       s10        e18      c11         u017   Chandler Bing   \n",
       "67369       s10        e18      c11         u018    Rachel Green   \n",
       "67370       s10        e18      c11         u019   Monica Geller   \n",
       "67371       s10        e18      c11         u020    Rachel Green   \n",
       "67372       s10        e18      c11         u021   Chandler Bing   \n",
       "\n",
       "                                                  tokens  \\\n",
       "0      [['There', \"'s\", 'nothing', 'to', 'tell', '!']...   \n",
       "1      [[\"C'mon\", ',', 'you', \"'re\", 'going', 'out', ...   \n",
       "2      [['All', 'right', 'Joey', ',', 'be', 'nice', '...   \n",
       "3      [['Wait', ',', 'does', 'he', 'eat', 'chalk', '...   \n",
       "4                                                     []   \n",
       "...                                                  ...   \n",
       "67368  [['Oh', ',', 'it', \"'s\", 'gon', 'na', 'be', 'o...   \n",
       "67369  [['Do', 'you', 'guys', 'have', 'to', 'go', 'to...   \n",
       "67370               [['We', 'got', 'some', 'time', '.']]   \n",
       "67371  [['Okay', ',', 'should', 'we', 'get', 'some', ...   \n",
       "67372                    [['Sure', '.'], ['Where', '?']]   \n",
       "\n",
       "                                              transcript    group  utterance  \\\n",
       "0      There's nothing to tell! He's just some guy I ...  s01_e01          1   \n",
       "1      C'mon, you're going out with the guy! There's ...  s01_e01          2   \n",
       "2      All right Joey, be nice. So does he have a hum...  s01_e01          3   \n",
       "3                               Wait, does he eat chalk?  s01_e01          4   \n",
       "4                                                    NaN  s01_e01          5   \n",
       "...                                                  ...      ...        ...   \n",
       "67368                            Oh, it's gonna be okay.  s10_e18         17   \n",
       "67369  Do you guys have to go to the new house right ...  s10_e18         18   \n",
       "67370                                  We got some time.  s10_e18         19   \n",
       "67371                   Okay, should we get some coffee?  s10_e18         20   \n",
       "67372                                       Sure. Where?  s10_e18         21   \n",
       "\n",
       "       scene  \n",
       "0          1  \n",
       "1          1  \n",
       "2          1  \n",
       "3          1  \n",
       "4          1  \n",
       "...      ...  \n",
       "67368     11  \n",
       "67369     11  \n",
       "67370     11  \n",
       "67371     11  \n",
       "67372     11  \n",
       "\n",
       "[67373 rows x 10 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "friends[\"utterance\"] = friends[\"utterance_id\"].apply(lambda x: int(x[1:]))\n",
    "friends[\"scene\"] = friends[\"scene_id\"].apply(lambda x: int(x[1:]))\n",
    "friends"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|████████████████████████████████████████████████████████████████████████████████| 236/236 [00:07<00:00, 32.37it/s]\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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Friends - The Pilot\\r\\n\\r\\n[Monica Geller] The...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Friends - The One With the Sonogram at the End...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Friends - The One With the Thumb\\r\\n\\r\\n[Phoeb...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Friends - The One With George Stephanopoulos\\r...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Friends - The One With the East German Laundry...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>231</th>\n",
       "      <td>Friends - The One With Princess Consuela\\r\\n\\r...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>232</th>\n",
       "      <td>Friends - The One Where Estelle Dies\\r\\n\\r\\n[C...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>233</th>\n",
       "      <td>Friends - The One With Rachel's Going Away Par...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>234</th>\n",
       "      <td>Friends - The Last One, Part 1\\r\\n\\r\\n[Jennife...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>235</th>\n",
       "      <td>Friends - The Last One, Part 2\\r\\n\\r\\n[Gate At...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>236 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  TEXT  \\\n",
       "0    Friends - The Pilot\\r\\n\\r\\n[Monica Geller] The...   \n",
       "1    Friends - The One With the Sonogram at the End...   \n",
       "2    Friends - The One With the Thumb\\r\\n\\r\\n[Phoeb...   \n",
       "3    Friends - The One With George Stephanopoulos\\r...   \n",
       "4    Friends - The One With the East German Laundry...   \n",
       "..                                                 ...   \n",
       "231  Friends - The One With Princess Consuela\\r\\n\\r...   \n",
       "232  Friends - The One Where Estelle Dies\\r\\n\\r\\n[C...   \n",
       "233  Friends - The One With Rachel's Going Away Par...   \n",
       "234  Friends - The Last One, Part 1\\r\\n\\r\\n[Jennife...   \n",
       "235  Friends - The Last One, Part 2\\r\\n\\r\\n[Gate At...   \n",
       "\n",
       "                                              METADATA            SOURCE  \n",
       "0    {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "1    {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "2    {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "3    {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "4    {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "..                                                 ...               ...  \n",
       "231  {\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...  friends/emorynlp  \n",
       "232  {\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...  friends/emorynlp  \n",
       "233  {\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...  friends/emorynlp  \n",
       "234  {\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...  friends/emorynlp  \n",
       "235  {\"show\": \"Friends\", \"season\": \"s10\", \"episode\"...  friends/emorynlp  \n",
       "\n",
       "[236 rows x 3 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = {\"TEXT\": [], \"METADATA\": [], \"SOURCE\": []}\n",
    "for name, group in tqdm(friends.groupby(\"group\")):\n",
    "    metadata = {\n",
    "        \"show\": \"Friends\",\n",
    "        \"season\": group[\"season_id\"].values[0],\n",
    "        \"episode\": group[\"episode_id\"].values[0],\n",
    "        \"title\": episodes[group[\"season_id\"].values[0]][group[\"episode_id\"].values[0]],\n",
    "    }\n",
    "    text, last_scene = f\"Friends - {metadata['title']}\\r\\n\\r\\n\", None\n",
    "    group.sort_values(by=[\"scene_id\", \"utterance\"], ascending=True, inplace=True)\n",
    "    for index, row in group.iterrows():\n",
    "        if last_scene is None:\n",
    "            last_scene = row[\"scene_id\"]\n",
    "        elif last_scene != row[\"scene_id\"]:\n",
    "            last_scene = row[\"scene_id\"]\n",
    "            text += \"\\r\\n---------------------------------------\\r\\n\\r\\n\"\n",
    "        if row[\"speaker\"] == \"unknown\" or row[\"tokens\"] == \"[]\" or pd.isna(row[\"transcript\"]):\n",
    "            continue\n",
    "        text += f\"[{row['speaker'].strip()}] {row['transcript'].strip()}\\r\\n\"\n",
    "    data[\"TEXT\"].append(text)\n",
    "    data[\"METADATA\"].append(json.dumps(metadata))\n",
    "    data[\"SOURCE\"].append(\"friends/emorynlp\")\n",
    "data = pd.DataFrame(data)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Friends - The Pilot\r\n",
      "\r\n",
      "[Monica Geller] There's nothing to tell! He's just some guy I work with!\r\n",
      "[Joey Tribbiani] C'mon, you're going out with the guy! There's gotta be something wrong with him!\r\n",
      "[Chandler Bing] All right Joey, be nice. So does he have a hump? A hump and a hairpiece?\r\n",
      "[Phoebe Buffay] Wait, does he eat chalk?\r\n",
      "[Phoebe Buffay] Just, 'cause, I don't want her to go through what I went through with Carl- oh!\r\n",
      "[Monica Geller] Okay, everybody relax. This is not even a date. It's just two people going out to dinner and- not having sex.\r\n",
      "[Chandler Bing] Sounds like a date to me.\r\n",
      "[Chandler Bing] Alright, so I'm back in high school, I'm standing in the middle of the cafeteria, and I realize I am totally naked.\r\n",
      "[#ALL#] Oh, yeah. Had that dream.\r\n",
      "[Chandler Bing] Then I look down, and I realize there's a phone... there.\r\n",
      "[Joey Tribbiani] Instead of...?\r\n",
      "[Chandler Bing] That's right.\r\n",
      "[Joey Tribbiani] Never had that dream.\r\n",
      "[Phoebe Buffay] No.\r\n",
      "[Chandler Bing] All of a sudden, the phone starts to ring. Now I don't know what to do, everybody starts looking at me.\r\n",
      "[Monica Geller] And they weren't looking at you before?!\r\n",
      "[Chandler Bing] Finally, I figure I'd better answer it, and it turns out it's my mother, which is very-very weird, because- she never calls me!\r\n",
      "[Ross Geller] Hi.\r\n",
      "[Joey Tribbiani] This guy says hello, I wanna kill myself.\r\n",
      "[Monica Geller] Are you okay, sweetie?\r\n",
      "[Ross Geller] I just feel like someone reached down my throat, grabbed my small intestine, pulled it out of my mouth and tied it around my neck...\r\n",
      "[Chandler Bing] Cookie?\r\n",
      "[Monica Geller] Carol moved her stuff out today.\r\n",
      "[Joey Tribbiani] Ohh.\r\n",
      "[Monica Geller] Let me get you some coffee.\r\n",
      "[Ross Geller] Thanks.\r\n",
      "[Phoebe Buffay] Ooh! Oh!\r\n",
      "[Ross Geller] No, no don't! Stop cleansing my aura! No, just leave my aura alone, okay?\r\n",
      "[Phoebe Buffay] Fine! Be murky!\r\n",
      "[Ross Geller] I'll be fine, alright? Really, everyone. I hope she'll be very happy.\r\n",
      "[Monica Geller] No you don't.\r\n",
      "[Ross Geller] No I don't, to hell with her, she left me!\r\n",
      "[Joey Tribbiani] And you never knew she was a lesbian...\r\n",
      "[Ross Geller] No!! Okay?! Why does everyone keep fixating on that? She didn't know, how should I know?\r\n",
      "[Chandler Bing] Sometimes I wish I was a lesbian... Did I say that out loud?\r\n",
      "[Ross Geller] I told mom and dad last night, they seemed to take it pretty well.\r\n",
      "[Monica Geller] Oh really, so that hysterical phone call I got from a woman at sobbing 3:00 A.M., \"I'll never have grandchildren, I'll never have grandchildren.\" was what? A wrong number?\r\n",
      "[Ross Geller] Sorry.\r\n",
      "[Joey Tribbiani] Alright Ross, look. You're feeling a lot of pain right now. You're angry. You're hurting. Can I tell you what the answer is?\r\n",
      "[Joey Tribbiani] Strip joint! C'mon, you're single! Have some hormones!\r\n",
      "[Ross Geller] I don't want to be single, okay? I just... I just- I just wanna be married again!\r\n",
      "[Chandler Bing] And I just want a million dollars!\r\n",
      "[Monica Geller] Rachel?!\r\n",
      "[Rachel Green] Oh God Monica hi! Thank God! I just went to your building and you weren't there and then this guy with a big hammer said you might be here and you are, you are!\r\n",
      "[Waitress] Can I get you some coffee?\r\n",
      "[Monica Geller] De-caff. Okay, everybody, this is Rachel, another Lincoln High survivor. This is everybody, this is Chandler, and Phoebe, and Joey, and- you remember my brother Ross?\r\n",
      "[Rachel Green] Hi, sure!\r\n",
      "[Ross Geller] Hi.\r\n",
      "[Monica Geller] So you wanna tell us now, or are we waiting for four wet bridesmaids?\r\n",
      "[Rachel Green] Oh God... well, it started about a half hour before the wedding. I was in the room where we were keeping all the presents, and I was looking at this gravy boat. This really gorgeous Lamauge gravy boat. When all of a sudden- Sweet 'n' Lo?- I realized that I was more turned on by this gravy boat than by Barry! And then I got really freaked out, and that's when it hit me: how much Barry looks like Mr. Potato Head. Y'know, I mean, I always knew looked familiar, but... Anyway, I just had to get out of there, and I started wondering 'Why am I doing this, and who am I doing this for?'. So anyway I just didn't know where to go, and I know that you and I have kinda drifted apart, but you're the only person I knew who lived here in the city.\r\n",
      "[Monica Geller] Who wasn't invited to the wedding.\r\n",
      "[Rachel Green] Ooh, I was kinda hoping that wouldn't be an issue...\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Monica Geller] Now I'm guessing that he bought her the big pipe organ, and she's really not happy about it.\r\n",
      "[Chandler Bing] Tuna or egg salad? Decide!\r\n",
      "[Ross Geller] I'll have whatever Christine is having.\r\n",
      "[Rachel Green] Daddy, I just... I can't marry him! I'm sorry. I just don't love him. Well, it matters to me!\r\n",
      "[Phoebe Buffay] If I let go of my hair, my head will fall off.\r\n",
      "[Chandler Bing] Ooh, she should not be wearing those pants.\r\n",
      "[Joey Tribbiani] I say push her down the stairs.\r\n",
      "[Chandler Bing] Push her down the stairs! Push her down the stairs! Push her down the stairs!\r\n",
      "[Rachel Green] C'mon Daddy, listen to me! It's like, it's like, all of my life, everyone has always told me, 'You're a shoe! You're a shoe, you're a shoe, you're a shoe!'. And today I just stopped and I said, 'What if I don't wanna be a shoe? What if I wanna be a- a purse, y'know? Or a- or a hat! No, I'm not saying I want you to buy me a hat, I'm saying I am a ha- It's a metaphor, Daddy!\r\n",
      "[Ross Geller] You can see where he'd have trouble.\r\n",
      "[Rachel Green] Look Daddy, it's my life. Well maybe I'll just stay here with Monica.\r\n",
      "[Monica Geller] Well, I guess we've established who's staying here with Monica...\r\n",
      "[Rachel Green] Well, maybe that's my decision. Well, maybe I don't need your money. Wait!! Wait, I said maybe!!\r\n",
      "[Monica Geller] Just breathe, breathe.. that's it. Just try to think of nice calm things...\r\n",
      "[Phoebe Buffay] Raindrops on roses and rabbits and kittens, bluebells and sleighbells and- something with mittens... La la la la...something and noodles with string. These are a few...\r\n",
      "[Rachel Green] I'm all better now.\r\n",
      "[Phoebe Buffay] I helped!\r\n",
      "[Monica Geller] Okay, look, this is probably for the best, y'know? Independence. Taking control of your life. The whole, 'hat' thing.\r\n",
      "[Joey Tribbiani] And hey, you need anything, you can always come to Joey. Me and Chandler live across the hall. And he's away a lot.\r\n",
      "[Monica Geller] Joey, stop hitting on her! It's her wedding day!\r\n",
      "[Joey Tribbiani] What, like there's a rule or something?\r\n",
      "[Chandler Bing] Please don't do that again, it's a horrible sound.\r\n",
      "[Paul the Wine Guy] It's, uh, it's Paul.\r\n",
      "[Monica Geller] Oh God, is it 6:30? Buzz him in!\r\n",
      "[Joey Tribbiani] Who's Paul?\r\n",
      "[Ross Geller] Paul the Wine Guy, Paul?\r\n",
      "[Monica Geller] Maybe. Joey: Wait. Your 'not a real date' tonight is with Paul the Wine Guy?\r\n",
      "[Ross Geller] He finally asked you out?\r\n",
      "[Monica Geller] Yes!\r\n",
      "[Chandler Bing] Ooh, this is a Dear Diary moment.\r\n",
      "[Monica Geller] Rach, wait, I can cancel...\r\n",
      "[Rachel Green] Please, no, go, that'd be fine!\r\n",
      "[Monica Geller] Are, are you okay? I mean, do you want me to stay?\r\n",
      "[Ross Geller] That'd be good...\r\n",
      "[Monica Geller] Really?\r\n",
      "[Ross Geller] No, go on! It's Paul the Wine Guy!\r\n",
      "[Phoebe Buffay] What does that mean? Does he sell it, drink it, or just complain a lot?\r\n",
      "[Monica Geller] Hi, come in! Paul, this is.. ... everybody, everybody, this is Paul.\r\n",
      "[#ALL#] Hey! Paul! Hi! The Wine Guy! Hey!\r\n",
      "[Chandler Bing] I'm sorry, I didn't catch your name. Paul, was it?\r\n",
      "[Monica Geller] Okay, umm-umm, I'll just--I'll be right back, I just gotta go ah, go ah...\r\n",
      "[Ross Geller] A wandering?\r\n",
      "[Monica Geller] Change! Okay, sit down. Two seconds.\r\n",
      "[Phoebe Buffay] Ooh, I just pulled out four eyelashes. That can't be good.\r\n",
      "[Joey Tribbiani] Hey, Paul!\r\n",
      "[Paul the Wine Guy] Yeah?\r\n",
      "[Joey Tribbiani] Here's a little tip, she really likes it when you rub her neck in the same spot over and over and over again until it starts to get a little red.\r\n",
      "[Monica Geller] Shut up, Joey!\r\n",
      "[Ross Geller] So Rachel, what're you, uh... what're you up to tonight?\r\n",
      "[Rachel Green] Well, I was kinda supposed to be headed for Aruba on my honeymoon, so nothing!\r\n",
      "[Ross Geller] Right, you're not even getting your honeymoon, God.. No, no, although, Aruba, this time of year... talk about your- -big lizards... Anyway, if you don't feel like being alone tonight, Joey and Chandler are coming over to help me put together my new furniture.\r\n",
      "[Chandler Bing] Yes, and we're very excited about it.\r\n",
      "[Rachel Green] Well actually thanks, but I think I'm just gonna hang out here tonight. It's been kinda a long day.\r\n",
      "[Ross Geller] Okay, sure.\r\n",
      "[Joey Tribbiani] Hey Pheebs, you wanna help?\r\n",
      "[Phoebe Buffay] Oh, I wish I could, but I don't want to.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Phoebe Buffay] Love is sweet as summer showers, love is a wondrous work of art, but your love oh your love, your love...is like a giant pigeon...crapping on my heart. La-la-la-la-la- Thank you. La-la-la-la...ohhh!\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Ross Geller] I'm supposed to attach a brackety thing to the side things, using a bunch of these little worm guys. I have no brackety thing, I see no whim guys whatsoever and- I cannot feel my legs.\r\n",
      "[Joey Tribbiani] I'm thinking we've got a bookcase here.\r\n",
      "[Chandler Bing] It's a beautiful thing.\r\n",
      "[Joey Tribbiani] What's this?\r\n",
      "[Chandler Bing] I would have to say that is an 'L'-shaped bracket.\r\n",
      "[Joey Tribbiani] Which goes where?\r\n",
      "[Chandler Bing] I have no idea.\r\n",
      "[Joey Tribbiani] Done with the bookcase!\r\n",
      "[Chandler Bing] All finished!\r\n",
      "[Ross Geller] This was Carol's favorite beer. She always drank it out of the can, I should have known.\r\n",
      "[Joey Tribbiani] Hey-hey-hey-hey, if you're gonna start with that stuff we're outta here.\r\n",
      "[Chandler Bing] Yes, please don't spoil all this fun.\r\n",
      "[Joey Tribbiani] Ross, let me ask you a question. She got the furniture, the stereo, the good TV- what did you get?\r\n",
      "[Ross Geller] You guys.\r\n",
      "[Chandler Bing] Oh, God.\r\n",
      "[Joey Tribbiani] You got screwed.\r\n",
      "[Chandler Bing] Oh my God!\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Monica Geller] Oh my God!\r\n",
      "[Paul the Wine Guy] I know, I know, I'm such an idiot. I guess I should have caught on when she started going to the dentist four and five times a week. I mean, how clean can teeth get?\r\n",
      "[Monica Geller] My brother's going through that right now, he's such a mess. How did you get through it?\r\n",
      "[Paul the Wine Guy] Well, you might try accidentally breaking something valuable of hers, say her-\r\n",
      "[Monica Geller] -leg?\r\n",
      "[Paul the Wine Guy] That's one way! Me, I- I went for the watch.\r\n",
      "[Monica Geller] You actually broke her watch? Wow! The worst thing I ever did was, I-I shredded by boyfriend's favorite bath towel.\r\n",
      "[Paul the Wine Guy] Ooh, steer clear of you.\r\n",
      "[Monica Geller] That's right.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Rachel Green] Barry, I'm sorry... I am so sorry... I know you probably think that this is all about what I said the other day about you making love with your socks on, but it isn't... it isn't, it's about me, and I ju- Hi, machine cut me off again... anyway...look, look, I know that some girl is going to be incredibly lucky to become Mrs. Barry Finkel, but it isn't me, it's not me. And not that I have any idea who me is right now, but you just have to give me a chance too...\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Ross Geller] I'm divorced! I'm only 26 and I'm divorced!\r\n",
      "[Joey Tribbiani] Shut up!\r\n",
      "[Chandler Bing] You must stop!\r\n",
      "[Ross Geller] That only took me an hour.\r\n",
      "[Chandler Bing] Look, Ross, you gotta understand, between us we haven't had a relationship that has lasted longer than a Mento. You, however have had the love of a woman for four years. Four years of closeness and sharing at the end of which she ripped your heart out, and that is why we don't do it! I don't think that was my point!\r\n",
      "[Ross Geller] You know what the scariest part is? What if there's only one woman for everybody, y'know? I mean what if you get one woman- and that's it? Unfortunately in my case, there was only one woman- for her...\r\n",
      "[Joey Tribbiani] What are you talking about? 'One woman'? That's like saying there's only one flavor of ice cream for you. Lemme tell you something, Ross. There's lots of flavors out there. There's Rocky Road, and Cookie Dough, and Bing! Cherry Vanilla. You could get 'em with Jimmies, or nuts, or whipped cream! This is the best thing that ever happened to you! You got married, you were, like, what, eight? Welcome back to the world! Grab a spoon!\r\n",
      "[Ross Geller] I honestly don't know if I'm hungry or horny.\r\n",
      "[Chandler Bing] Stay out of my freezer!\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Paul the Wine Guy] Ever since she walked out on me, I, uh...\r\n",
      "[Monica Geller] What?..... What, you wanna spell it out with noodles?\r\n",
      "[Paul the Wine Guy] No, it's, it's more of a fifth date kinda revelation.\r\n",
      "[Monica Geller] Oh, so there is gonna be a fifth date?\r\n",
      "[Paul the Wine Guy] Isn't there?\r\n",
      "[Monica Geller] Yeah... yeah, I think there is. -What were you gonna say?\r\n",
      "[Paul the Wine Guy] Well, ever-ev-... ever since she left me, um, I haven't been able to, uh, perform. ...Sexually.\r\n",
      "[Monica Geller] Oh God, oh God, I am sorry... I am so sorry...\r\n",
      "[Paul the Wine Guy] It's okay...\r\n",
      "[Monica Geller] I know being spit on is probably not what you need right now. Um... how long?\r\n",
      "[Paul the Wine Guy] Two years.\r\n",
      "[Monica Geller] Wow! I'm-I'm-I'm glad you smashed her watch!\r\n",
      "[Paul the Wine Guy] So you still think you, um... might want that fifth date?\r\n",
      "[Monica Geller] ...Yeah. Yeah, I do.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Priest On Tv] We are gathered here today to join Joanne Louise Cunningham and Charles, Chachi-Chachi-Chachi, Arcola in the bound of holy matrimony.\r\n",
      "[Rachel Green] Oh...see... but Joanne loved Chachi! That's the difference!\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Ross Geller] Grab a spoon. Do you know how long it's been since I've grabbed a spoon? Do the words 'Billy, don't be a hero' mean anything to you?\r\n",
      "[Joey Tribbiani] Great story! But, I uh, I gotta go, I got a date with Andrea--Angela--Andrea... Oh man,\r\n",
      "[Chandler Bing] Angela's the screamer, Andrea has cats.\r\n",
      "[Joey Tribbiani] Right. Thanks. It's June. I'm outta here.\r\n",
      "[Ross Geller] Y'know, here's the thing. Even if I could get it together enough to- to ask a woman out,... who am I gonna ask?\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Rachel Green] Isn't this amazing? I mean, I have never made coffee before in my entire life.\r\n",
      "[Chandler Bing] That is amazing.\r\n",
      "[Joey Tribbiani] Congratulations.\r\n",
      "[Rachel Green] Y'know, I figure if I can make coffee, there isn't anything I can't do.\r\n",
      "[Chandler Bing] If can invade Poland, there isn't anything I can't do.\r\n",
      "[Joey Tribbiani] Listen, while you're on a roll, if you feel like you gotta make like a Western omelet or something... Although actually I'm really not that hungry...\r\n",
      "[Monica Geller] Oh good, Lenny and Squigy are here.\r\n",
      "[#ALL#] Morning. Good morning.\r\n",
      "[Paul the Wine Guy] Morning.\r\n",
      "[Joey Tribbiani] Morning, Paul.\r\n",
      "[Rachel Green] Hello, Paul.\r\n",
      "[Chandler Bing] Hi, Paul, is it?\r\n",
      "[Paul the Wine Guy] Thank you! Thank you so much!\r\n",
      "[Monica Geller] Stop!\r\n",
      "[Paul the Wine Guy] No, I'm telling you last night was like umm, all my birthdays, both graduations, plus the barn raising scene in Witness.\r\n",
      "[Monica Geller] We'll talk later.\r\n",
      "[Paul the Wine Guy] Yeah. Thank you.\r\n",
      "[Joey Tribbiani] That wasn't a real date?! What the hell do you do on a real date?\r\n",
      "[Monica Geller] Shut up, and put my table back.\r\n",
      "[#ALL#] Okayyy!\r\n",
      "[Chandler Bing] All right, kids, I gotta get to work. If I don't input those numbers,... it doesn't make much of a difference...\r\n",
      "[Rachel Green] So, like, you guys all have jobs?\r\n",
      "[Monica Geller] Yeah, we all have jobs. See, that's how we buy stuff.\r\n",
      "[Joey Tribbiani] Yeah, I'm an actor.\r\n",
      "[Rachel Green] Wow! Would I have seen you in anything?\r\n",
      "[Joey Tribbiani] I doubt it. Mostly regional work.\r\n",
      "[Monica Geller] Oh wait, wait, unless you happened to catch the Reruns' production of Pinocchio, at the little theater in the park.\r\n",
      "[Joey Tribbiani] Look, it was a job all right?\r\n",
      "[Chandler Bing] 'Look, Gippetto, I'm a real live boy.'\r\n",
      "[Joey Tribbiani] I will not take this abuse.\r\n",
      "[Chandler Bing] You're right, I'm sorry. \"Once I was a wooden boy, a little wooden boy...\"\r\n",
      "[Joey Tribbiani] You should both know, that he's a dead man. Oh, Chandler?\r\n",
      "[Monica Geller] So how you doing today? Did you sleep okay? Talk to Barry? I can't stop smiling.\r\n",
      "[Rachel Green] I can see that. You look like you slept with a hanger in your mouth.\r\n",
      "[Monica Geller] I know, he's just so, so... Do you remember you and Tony DeMarco?\r\n",
      "[Rachel Green] Oh, yeah.\r\n",
      "[Monica Geller] Well, it's like that. With feelings.\r\n",
      "[Rachel Green] Oh wow. Are you in trouble.\r\n",
      "[Monica Geller] Big time!\r\n",
      "[Rachel Green] Want a wedding dress? Hardly used.\r\n",
      "[Monica Geller] I think we are getting a little ahead of selves here. Okay. Okay. I am just going to get up, go to work and not think about him all day. Or else I'm just gonna get up and go to work.\r\n",
      "[Rachel Green] Oh, look, wish me luck!\r\n",
      "[Monica Geller] What for?\r\n",
      "[Rachel Green] I'm gonna go get one of those job things.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Franny] Hey, Monica!\r\n",
      "[Monica Geller] Hey Frannie, welcome back! How was Florida?\r\n",
      "[Franny] You had sex, didn't you?\r\n",
      "[Monica Geller] How do you do that?\r\n",
      "[Franny] Oh, I hate you, I'm pushing my Aunt Roz through Parrot Jungle and you're having sex! So? Who?\r\n",
      "[Monica Geller] You know Paul?\r\n",
      "[Franny] Paul the Wine Guy? Oh yeah, I know Paul.\r\n",
      "[Monica Geller] You mean you know Paul like I know Paul?\r\n",
      "[Franny] Are you kidding? I take credit for Paul. Y'know before me, there was no snap in his turtle for two years.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Joey Tribbiani] Of course it was a line!\r\n",
      "[Monica Geller] Why?! Why? Why, why would anybody do something like that?\r\n",
      "[Ross Geller] I assume we're looking for an answer more sophisticated than 'to get you into bed'.\r\n",
      "[Monica Geller] I hate men! I hate men!\r\n",
      "[Phoebe Buffay] Oh no, don't hate, you don't want to put that out into the universe.\r\n",
      "[Monica Geller] Is it me? Is it like I have some sort of beacon that only dogs and men with severe emotional problems can hear?\r\n",
      "[Phoebe Buffay] All right, c'mere, gimme your feet.\r\n",
      "[Monica Geller] I just thought he was nice, y'know?\r\n",
      "[Joey Tribbiani] I can't believe you didn't know it was a line!\r\n",
      "[Rachel Green] Guess what?\r\n",
      "[Ross Geller] You got a job?\r\n",
      "[Rachel Green] Are you kidding? I'm trained for nothing! I was laughed out of twelve interviews today.\r\n",
      "[Chandler Bing] And yet you're surprisingly upbeat.\r\n",
      "[Rachel Green] You would be too if you found John and David boots on sale, fifty percent off!\r\n",
      "[Chandler Bing] Oh, how well you know me...\r\n",
      "[Rachel Green] They're my new 'I don't need a job, I don't need my parents, I've got great boots' boots!\r\n",
      "[Monica Geller] How'd you pay for them?\r\n",
      "[Rachel Green] Uh, credit card.\r\n",
      "[Monica Geller] And who pays for that?\r\n",
      "[Rachel Green] Um... my... father.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Rachel Green] Oh God, come on you guys, is this really necessary? I mean, I can stop charging anytime I want.\r\n",
      "[Monica Geller] C'mon, you can't live off your parents your whole life.\r\n",
      "[Rachel Green] I know that. That's why I was getting married.\r\n",
      "[Phoebe Buffay] Give her a break, it's hard being on your own for the first time.\r\n",
      "[Rachel Green] Thank you.\r\n",
      "[Phoebe Buffay] You're welcome. I remember when I first came to this city. I was fourteen. My mom had just killed herself and my step-dad was back in prison, and I got here, and I didn't know anybody. And I ended up living with this albino guy who was, like, cleaning windshields outside port authority, and then he killed himself, and then I found aromatherapy. So believe me, I know exactly how you feel.\r\n",
      "[Ross Geller] The word you're looking for is 'Anyway'...\r\n",
      "[Monica Geller] All right, you ready?\r\n",
      "[Rachel Green] No. No, no, I'm not ready! How can I be ready? \"Hey, Rach! You ready to jump out the airplane without your parachute?\" Come on, I can't do this!\r\n",
      "[Monica Geller] You can, I know you can!\r\n",
      "[Rachel Green] I don't think so.\r\n",
      "[Ross Geller] Come on, you made coffee! You can do anything!\r\n",
      "[Ross Geller] C'mon, cut. Cut, cut, cut,...\r\n",
      "[#ALL#] Cut, cut, cut, cut, cut, cut, cut...\r\n",
      "[Rachel Green] Y'know what? I think we can just leave it at that. It's kinda like a symbolic gesture...\r\n",
      "[Monica Geller] Rachel! That was a library card!\r\n",
      "[#ALL#] Cut, cut, cut, cut, cut, cut, cut..\r\n",
      "[Chandler Bing] Y'know, if you listen closely, you can hear a thousand retailers scream.\r\n",
      "[Monica Geller] Welcome to the real world! It sucks. You're gonna love it!\r\n",
      "[Monica Geller] Well, that's it You gonna crash on the couch?\r\n",
      "[Ross Geller] No. No, I gotta go home sometime.\r\n",
      "[Monica Geller] You be okay?\r\n",
      "[Ross Geller] Yeah.\r\n",
      "[Rachel Green] Hey Mon, look what I just found on the floor. What?\r\n",
      "[Monica Geller] That's Paul's watch. You just put it back where you found it. Oh boy. Alright. Goodnight, everybody.\r\n",
      "[Rachel Green] Goodnight.\r\n",
      "[Ross Geller] Mmm. Oh, no-\r\n",
      "[Rachel Green] Sorry-\r\n",
      "[Ross Geller] No no no, go-\r\n",
      "[Rachel Green] No, you have it, really, I don't want it-\r\n",
      "[Ross Geller] Split it?\r\n",
      "[Rachel Green] Okay.\r\n",
      "[Ross Geller] Okay. You know you probably didn't know this, but back in high school, I had a, um, major crush on you.\r\n",
      "[Rachel Green] I knew.\r\n",
      "[Ross Geller] You did! Oh.... I always figured you just thought I was Monica's geeky older brother.\r\n",
      "[Rachel Green] I did.\r\n",
      "[Ross Geller] Oh. Listen, do you think- and try not to let my intense vulnerability become any kind of a factor here- but do you think it would be okay if I asked you out? Sometime? Maybe?\r\n",
      "[Rachel Green] Yeah, maybe...\r\n",
      "[Ross Geller] Okay... okay, maybe I will...\r\n",
      "[Rachel Green] Goodnight.\r\n",
      "[Ross Geller] Goodnight.\r\n",
      "[Monica Geller] See ya.... Waitwait, what's with you?\r\n",
      "[Ross Geller] I just grabbed a spoon.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Joey Tribbiani] I can't believe what I'm hearing here.\r\n",
      "[Phoebe Buffay] I can't believe what I'm hearing here...\r\n",
      "[Monica Geller] What? I-I said you had a-\r\n",
      "[Phoebe Buffay] What I said you had...\r\n",
      "[Monica Geller] Would you stop?\r\n",
      "[Phoebe Buffay] Oh, was I doing it again?\r\n",
      "[#ALL#] Yes!\r\n",
      "[Monica Geller] I said that you had a nice butt, it's just not a great butt.\r\n",
      "[Joey Tribbiani] Oh, you wouldn't know a great butt if it came up and bit ya.\r\n",
      "[Ross Geller] There's an image.\r\n",
      "[Rachel Green] Would anybody like more coffee?\r\n",
      "[Chandler Bing] Did you make it, or are you just serving it?\r\n",
      "[Rachel Green] I'm just serving it.\r\n",
      "[#ALL#] Yeah. Yeah, I'll have a cup of coffee.\r\n",
      "[Chandler Bing] Kids, new dream... I'm in Las Vegas.\r\n",
      "[Customer] Ahh, miss? More coffee?\r\n",
      "[Rachel Green] Ugh. Excuse me, could you give this to that guy over there? Go ahead. Thank you. Sorry. Okay, Las Vegas.\r\n",
      "[Chandler Bing] Okay, so, I'm in Las Vegas... I'm Liza Minelli-\r\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(data[\"TEXT\"].values[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Friends - The Pilot\\r\\n\\r\\n[Monica Geller] The...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Friends - The One With the Sonogram at the End...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Friends - The One With the Thumb\\r\\n\\r\\n[Phoeb...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Friends - The One With George Stephanopoulos\\r...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Friends - The One With the East German Laundry...</td>\n",
       "      <td>{\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...</td>\n",
       "      <td>friends/emorynlp</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                TEXT  \\\n",
       "0  Friends - The Pilot\\r\\n\\r\\n[Monica Geller] The...   \n",
       "1  Friends - The One With the Sonogram at the End...   \n",
       "2  Friends - The One With the Thumb\\r\\n\\r\\n[Phoeb...   \n",
       "3  Friends - The One With George Stephanopoulos\\r...   \n",
       "4  Friends - The One With the East German Laundry...   \n",
       "\n",
       "                                            METADATA            SOURCE  \n",
       "0  {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "1  {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "2  {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "3  {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  \n",
       "4  {\"show\": \"Friends\", \"season\": \"s01\", \"episode\"...  friends/emorynlp  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.to_parquet(\"friends.pq\", row_group_size=100, engine=\"pyarrow\", index=False)\n",
    "data.head()  # https://github.com/emorynlp/character-mining"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "236"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# The Office"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "# office via https://www.kaggle.com/datasets/nasirkhalid24/the-office-us-complete-dialoguetranscript\n",
    "kaggle.api.dataset_download_files(\"nasirkhalid24/the-office-us-complete-dialoguetranscript\", \"office\", unzip=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "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>season</th>\n",
       "      <th>episode</th>\n",
       "      <th>title</th>\n",
       "      <th>scene</th>\n",
       "      <th>speaker</th>\n",
       "      <th>line</th>\n",
       "      <th>group</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Pilot</td>\n",
       "      <td>1</td>\n",
       "      <td>Michael</td>\n",
       "      <td>All right Jim. Your quarterlies look very good...</td>\n",
       "      <td>1_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Pilot</td>\n",
       "      <td>1</td>\n",
       "      <td>Jim</td>\n",
       "      <td>Oh, I told you. I couldn't close it. So...</td>\n",
       "      <td>1_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Pilot</td>\n",
       "      <td>1</td>\n",
       "      <td>Michael</td>\n",
       "      <td>So you've come to the master for guidance? Is ...</td>\n",
       "      <td>1_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Pilot</td>\n",
       "      <td>1</td>\n",
       "      <td>Jim</td>\n",
       "      <td>Actually, you called me in here, but yeah.</td>\n",
       "      <td>1_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Pilot</td>\n",
       "      <td>1</td>\n",
       "      <td>Michael</td>\n",
       "      <td>All right. Well, let me show you how it's done.</td>\n",
       "      <td>1_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54621</th>\n",
       "      <td>9</td>\n",
       "      <td>24</td>\n",
       "      <td>Finale</td>\n",
       "      <td>8153</td>\n",
       "      <td>Creed</td>\n",
       "      <td>It all seems so very arbitrary. I applied for ...</td>\n",
       "      <td>9_24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54622</th>\n",
       "      <td>9</td>\n",
       "      <td>24</td>\n",
       "      <td>Finale</td>\n",
       "      <td>8154</td>\n",
       "      <td>Meredith</td>\n",
       "      <td>I just feel lucky that I got a chance to share...</td>\n",
       "      <td>9_24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54623</th>\n",
       "      <td>9</td>\n",
       "      <td>24</td>\n",
       "      <td>Finale</td>\n",
       "      <td>8155</td>\n",
       "      <td>Phyllis</td>\n",
       "      <td>I'm happy that this was all filmed so I can re...</td>\n",
       "      <td>9_24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54624</th>\n",
       "      <td>9</td>\n",
       "      <td>24</td>\n",
       "      <td>Finale</td>\n",
       "      <td>8156</td>\n",
       "      <td>Jim</td>\n",
       "      <td>I sold paper at this company for 12 years. My ...</td>\n",
       "      <td>9_24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54625</th>\n",
       "      <td>9</td>\n",
       "      <td>24</td>\n",
       "      <td>Finale</td>\n",
       "      <td>8157</td>\n",
       "      <td>Pam</td>\n",
       "      <td>I thought it was weird when you picked us to m...</td>\n",
       "      <td>9_24</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>54626 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       season  episode   title  scene   speaker  \\\n",
       "0           1        1   Pilot      1   Michael   \n",
       "1           1        1   Pilot      1       Jim   \n",
       "2           1        1   Pilot      1   Michael   \n",
       "3           1        1   Pilot      1       Jim   \n",
       "4           1        1   Pilot      1   Michael   \n",
       "...       ...      ...     ...    ...       ...   \n",
       "54621       9       24  Finale   8153     Creed   \n",
       "54622       9       24  Finale   8154  Meredith   \n",
       "54623       9       24  Finale   8155   Phyllis   \n",
       "54624       9       24  Finale   8156       Jim   \n",
       "54625       9       24  Finale   8157       Pam   \n",
       "\n",
       "                                                    line group  \n",
       "0      All right Jim. Your quarterlies look very good...   1_1  \n",
       "1             Oh, I told you. I couldn't close it. So...   1_1  \n",
       "2      So you've come to the master for guidance? Is ...   1_1  \n",
       "3             Actually, you called me in here, but yeah.   1_1  \n",
       "4        All right. Well, let me show you how it's done.   1_1  \n",
       "...                                                  ...   ...  \n",
       "54621  It all seems so very arbitrary. I applied for ...  9_24  \n",
       "54622  I just feel lucky that I got a chance to share...  9_24  \n",
       "54623  I'm happy that this was all filmed so I can re...  9_24  \n",
       "54624  I sold paper at this company for 12 years. My ...  9_24  \n",
       "54625  I thought it was weird when you picked us to m...  9_24  \n",
       "\n",
       "[54626 rows x 7 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "office = pd.read_csv(\"office/The-Office-Lines-V4.csv\", sep=\",\")\n",
    "office.drop(columns=[\"Unnamed: 6\"], inplace=True)\n",
    "office[\"group\"] = office[[\"season\", \"episode\"]].apply(lambda x: f\"{x[0]}_{x[1]}\", axis=1)\n",
    "office"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|████████████████████████████████████████████████████████████████████████████████| 186/186 [00:06<00:00, 29.75it/s]\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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>The Office - Pilot\\r\\n\\r\\n[Michael] All right ...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>The Office - Diversity Day\\r\\n\\r\\n[Michael] He...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>The Office - Health Care\\r\\n\\r\\n[Michael] Pam....</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>The Office - The Alliance\\r\\n\\r\\n[Dwight] Mich...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>The Office - Basketball\\r\\n\\r\\n[Michael] Hey, ...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>The Office - Here Comes Treble\\r\\n\\r\\n[Dwight]...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s09\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>The Office - The Boat\\r\\n\\r\\n[Oscar] Can you g...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s09\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>The Office - The Whale\\r\\n\\r\\n[Andy] Ah, what ...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s09\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>The Office - The Target\\r\\n\\r\\n[Oscar] Yesterd...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s09\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>The Office - Dwight Christmas\\r\\n\\r\\n[Jim] I'm...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s09\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>186 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  TEXT  \\\n",
       "0    The Office - Pilot\\r\\n\\r\\n[Michael] All right ...   \n",
       "1    The Office - Diversity Day\\r\\n\\r\\n[Michael] He...   \n",
       "2    The Office - Health Care\\r\\n\\r\\n[Michael] Pam....   \n",
       "3    The Office - The Alliance\\r\\n\\r\\n[Dwight] Mich...   \n",
       "4    The Office - Basketball\\r\\n\\r\\n[Michael] Hey, ...   \n",
       "..                                                 ...   \n",
       "181  The Office - Here Comes Treble\\r\\n\\r\\n[Dwight]...   \n",
       "182  The Office - The Boat\\r\\n\\r\\n[Oscar] Can you g...   \n",
       "183  The Office - The Whale\\r\\n\\r\\n[Andy] Ah, what ...   \n",
       "184  The Office - The Target\\r\\n\\r\\n[Oscar] Yesterd...   \n",
       "185  The Office - Dwight Christmas\\r\\n\\r\\n[Jim] I'm...   \n",
       "\n",
       "                                              METADATA                SOURCE  \n",
       "0    {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "1    {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "2    {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "3    {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "4    {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "..                                                 ...                   ...  \n",
       "181  {\"show\": \"The Office\", \"season\": \"s09\", \"episo...  office/nasirkhalid24  \n",
       "182  {\"show\": \"The Office\", \"season\": \"s09\", \"episo...  office/nasirkhalid24  \n",
       "183  {\"show\": \"The Office\", \"season\": \"s09\", \"episo...  office/nasirkhalid24  \n",
       "184  {\"show\": \"The Office\", \"season\": \"s09\", \"episo...  office/nasirkhalid24  \n",
       "185  {\"show\": \"The Office\", \"season\": \"s09\", \"episo...  office/nasirkhalid24  \n",
       "\n",
       "[186 rows x 3 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = {\"TEXT\": [], \"METADATA\": [], \"SOURCE\": []}\n",
    "for name, group in tqdm(office.groupby(\"group\")):\n",
    "    metadata = {\n",
    "        \"show\": \"The Office\",\n",
    "        \"season\": f\"s{str(group['season'].values[0]).zfill(2)}\",\n",
    "        \"episode\": f\"e{str(group['episode'].values[0]).zfill(2)}\",\n",
    "        \"title\": group[\"title\"].values[0],\n",
    "    }\n",
    "    text, last_scene = f\"The Office - {metadata['title']}\\r\\n\\r\\n\", None\n",
    "    for index, row in group.iterrows():\n",
    "        if last_scene is None:\n",
    "            last_scene = row[\"scene\"]\n",
    "        elif last_scene != row[\"scene\"]:\n",
    "            last_scene = row[\"scene\"]\n",
    "            text += \"\\r\\n---------------------------------------\\r\\n\\r\\n\"\n",
    "        if pd.isna(row[\"speaker\"]) or pd.isna(row[\"line\"]):\n",
    "            continue\n",
    "        text += f\"[{row['speaker'].strip()}] {row['line'].strip()}\\r\\n\"\n",
    "    data[\"TEXT\"].append(text)\n",
    "    data[\"METADATA\"].append(json.dumps(metadata))\n",
    "    data[\"SOURCE\"].append(\"office/nasirkhalid24\")\n",
    "data = pd.DataFrame(data)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Office - Pilot\r\n",
      "\r\n",
      "[Michael] All right Jim. Your quarterlies look very good. How are things at the library?\r\n",
      "[Jim] Oh, I told you. I couldn't close it. So...\r\n",
      "[Michael] So you've come to the master for guidance? Is this what you're saying, grasshopper?\r\n",
      "[Jim] Actually, you called me in here, but yeah.\r\n",
      "[Michael] All right. Well, let me show you how it's done.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] Yes, I'd like to speak to your office manager, please. Yes, hello. This is Michael Scott. I am the Regional Manager of Dunder Mifflin Paper Products. Just wanted to talk to you manager-a-manger.  All right. Done deal. Thank you very much, sir. You're a gentleman and a scholar. Oh, I'm sorry. OK. I'm sorry. My mistake.  That was a woman I was talking to, so... She had a very low voice. Probably a smoker, so...  So that's the way it's done.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] I've, uh, I've been at Dunder Mifflin for 12 years, the last four as Regional Manager. If you want to come through here... See we have the entire floor. So this is my kingdom, as far as the eye can see. This is our receptionist, Pam. Pam! Pam-Pam! Pam Beesly. Pam has been with us for... forever. Right, Pam?\r\n",
      "[Pam] Well. I don't know.\r\n",
      "[Michael] If you think she's cute now, you should have seen her a couple of years ago.\r\n",
      "[Pam] What?\r\n",
      "[Michael] Any messages?\r\n",
      "[Pam] Uh, yeah. Just a fax.\r\n",
      "[Michael] Oh! Pam, this is from Corporate. How many times have I told you? There's a special filing cabinet for things from corporate.\r\n",
      "[Pam] You haven't told me.\r\n",
      "[Michael] It's called the wastepaper basket! Look at that! Look at that face.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] People say I am the best boss. They go, \"God we've never worked in a place like this before. You're hilarious.\" \"And you get the best out of us.\"  I think that pretty much sums it up. I found it at Spencer Gifts.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Dwight] Shall I play for you? Pa rum pump um pum  I have no gifts for you. Pa rum pump um pum\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Jim] My job is to speak to clients on the phone about... uh, quantities and type of copier paper. You know, whether we can supply it to them. Whether they can pay for it. And... I'm boring myself just talking about this.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] Whassup!\r\n",
      "[Jim] Whassup! I still love that after seven years.\r\n",
      "[Michael] Whassup!\r\n",
      "[Dwight] Whassup!\r\n",
      "[Michael] Whass...up!\r\n",
      "[Dwight] Whassup.\r\n",
      "[Michael] What?\r\n",
      "[Jim] Nothing.\r\n",
      "[Michael] OK. All right. See you later.\r\n",
      "[Jim] All right. Take care.\r\n",
      "[Michael] Back to work.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Jan] Just before lunch. That would be great.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] Corporate really doesn't really interfere with me at all. Jan Levinson Gould.  Jan, hello. I call her Hillary Rodham Clinton. Right? Not to her face, because... well, not because I'm scared of her. Because I'm not. But, um... Yeah.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Jan] Alright, was there anything you wanted to add to the agenda?\r\n",
      "[Michael] Um... Me no get an agenda.\r\n",
      "[Jan] What? I'm sorry?\r\n",
      "[Michael] I didn't get any agenda.\r\n",
      "[Jan] Well, I faxed one over to you this morning.\r\n",
      "[Michael] Really? I didn't...  Did we get a fax this morning?\r\n",
      "[Pam] Uh, yeah, the one...\r\n",
      "[Michael] Why isn't it in my hand? A company runs on efficiency of communication, right? So what's the problem, Pam? Why didn't I get it?\r\n",
      "[Pam] You put in the garbage can that was a special filing cabinet.\r\n",
      "[Michael] Yeah, that was a joke. That was a joke that was actually my brother's, and... It was supposed to be with bills and it doesn't work great with faxes.\r\n",
      "[Jan] Do you want to look at mine?\r\n",
      "[Michael] Yeah, yeah. Lovely. Thank you.\r\n",
      "[Jan] OK. Since the last meeting, Ellen and the board have decided we can't justify a Scranton branch and a Stamford branch.\r\n",
      "[Michael] OK...\r\n",
      "[Jan] Michael, don't panic.\r\n",
      "[Michael] No, no, no, no, this is good. This is good. This is fine. Excellent.\r\n",
      "[Jan] No, no, no, Michael, listen OK. Don't panic. We haven't made... We haven't decided.\r\n",
      "[Michael] All the alarm bells are kind of going... ringie-dingie-ding!\r\n",
      "[Jan] I've spoken to Josh in Stamford. I've told him the same as you and it's up to either him or you to convince me that your branch can incorporate the other.\r\n",
      "[Michael] OK. No problem.\r\n",
      "[Jan] This does, however, mean that there is going to be downsizing.\r\n",
      "[Michael] Me no wanna hear that, Jan. Because downsizing is a bitch. It is a real bitch. And I wouldn't wish that on Josh's men. I certainly wouldn't wish it on my men. Or women, present company excluded. Sorry. Uh, is Josh concerned about downsizing himself? Not downsizing himself but is he concerned about downsizing?\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] Question. How long do we have to...  Oh uh, Todd Packer, terrific rep. Do you mind if I take it?\r\n",
      "[Jan] Go ahead.\r\n",
      "[Michel] Packman.\r\n",
      "[Todd Packer] Hey, you big queen.\r\n",
      "[Michael] Oh, that's not appropriate.\r\n",
      "[Todd Packer] Hey, is old Godzillary coming in today?\r\n",
      "[Michael] Uh, I don't know what you mean.\r\n",
      "[Todd Packer] I've been meaning to ask her one question. Does the carpet match the drapes?\r\n",
      "[Michael] Oh, my God! Oh! That's... horrifying. Horrible. Horrible person.\r\n",
      "[Jan] So do you think we could keep a lid on this for now? I don't want to worry people unnecessarily.\r\n",
      "[Michael] No, absolutely. Under this regime, it will not leave this office.  Like that.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Phyllis] So what does downsizing actually mean?\r\n",
      "[Stanley] Well...\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Oscar] You guys better update your resumes just like I'm doing.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Angela] I bet it's gonna be me. Probably gonna be me.\r\n",
      "[Kevin] Yeah, it'll be you.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Pam] I have an important question for you.\r\n",
      "[Jim] Yes?\r\n",
      "[Pam] Are you going to Angela's cat party on Sunday?\r\n",
      "[Jim] Yeah, stop. That is ridiculous.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] Am I going to tell them? No, I am not going to tell them. I don't see the point of that. As a doctor, you would not tell a patient if they had cancer.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] Hey.\r\n",
      "[Ryan] Hey.\r\n",
      "[Pam] This is Mr. Scott.\r\n",
      "[Michael] Guilty! Guilty as charged!\r\n",
      "[Ryan] Ryan Howard from the temp agency. Daniqua sent me down to start today.\r\n",
      "[Michael] Howard, like Moe Howard. Three Stooges.\r\n",
      "[Ryan] Yup.\r\n",
      "[Michael] Watch this. This is Moe. Nyuck-nyuck-nyuck-nyuck-nyuck. Mee!  Ah, right here. Three Stooges. Oh, Pam. It's a guy thing, Pam. I'm sort of a student of comedy. Watch this. Here we go.  I'm Hitler. Adolf Hitler.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Pam] I don't think it would be the worst thing if they let me go because then I might... I don't think it's many little girls' dream to be a receptionist. I like to do illustrations. Um... Mostly watercolor. A few oil pencil. Um, Jim thinks they're good.\r\n",
      "[Pam] Dunder Mifflin. This is Pam.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Jim] Sure. Mr. Davis, let me call you right back. Yeah, something just came up. Two minutes. Thank you very much. Dwight, what are you doing?\r\n",
      "[Dwight] What?\r\n",
      "[Jim] What are you doing?\r\n",
      "[Dwight] Just clearing my desk. I can't concentrate.\r\n",
      "[Jim] It's not on your desk.\r\n",
      "[Dwight] It's overlapping. It's all spilling over the edge. One word, two syllables. Demarcation.\r\n",
      "[Dwight] You can't do that.\r\n",
      "[Jim] Why not?\r\n",
      "[Dwight] Safety violation. I could fall and pierce an organ.\r\n",
      "[Jim] We'll see.  This is why the whole downsizing thing just doesn't bother me.\r\n",
      "[Dwight] Downsizing?\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Dwight] Downsizing? I have no problem with that. I have been recommending downsizing since I first got here. I even brought it up in my interview. I say, bring it on.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Pam] You just still have these messages from yesterday.\r\n",
      "[Michael] Relax. Everything's under control. Uh, yeah. Yeah. That's important. Right. Oh this is so important, I should run to answer it.\r\n",
      "[Pam] What?\r\n",
      "[Michael] Come on. Six-Million Dollar Man! Steve Austin! Actually, that would be a good salary for me, don't you think? Six million dollars? Memo to Jan. I deserve a raise.\r\n",
      "[Pam] Don't we all?\r\n",
      "[Michael] I'm sorry?\r\n",
      "[Pam] Nothing.\r\n",
      "[Michael] If you're unhappy with your compensation, maybe you should take it up with HR. OK. Not today, OK? Pam, just be professional.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] I think I'm a role model here. I think I garner people's respect.  Attention all Dunder Mifflin employees, please. We have a meeting in the conference room, ASAP.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] People I respect, heroes of mine, would be Bob Hope... Abraham Lincoln, definitely. Bono. And probably God would be the fourth one. And I just think all those people really helped the world in so many ways that it's really beyond words. It's really incalculable.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] Now I know there's some rumors out there and I just kind of want to set the record straight.\r\n",
      "[Dwight] I'm Assistant Regional Manager. I should know first.\r\n",
      "[Michael] Assistant to the Regional Manager.\r\n",
      "[Dwight] OK, um, can you just tell me please? Just tell me quietly. Can you whisper it in my ear?\r\n",
      "[Michael] I'm about to tell everybody. I'm just about to tell everybody.\r\n",
      "[Oscar] Can't you just tell us.\r\n",
      "[Dwight] Please, OK? Do you want me to tell 'em?\r\n",
      "[Michael] You don't know what it is.\r\n",
      "[Dwight] OK. You tell 'em. With my permission. Permission granted.\r\n",
      "[Michael] I don't need your permission.\r\n",
      "[Dwight] Go ahead.\r\n",
      "[Michael] Corporate has deemed it appropriate to enforce an ultimatum upon me. And Jan is thinking about downsizing either the Stamford branch or this branch.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Ryan] I heard they might be closing this branch down. That's just the rumor going around. This is my first day. I don't really know.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Oscar] Yeah but Michael, what if they downsize here?\r\n",
      "[Michael] Not gonna happen.\r\n",
      "[Stanley] It could be out of your hands Michael.\r\n",
      "[Michael] It won't be out of my hands Stanley, OK. I promise you that.\r\n",
      "[Stanley] Can you promise that?\r\n",
      "[Dwight] On his mother's grave.\r\n",
      "[Michael] No.\r\n",
      "[Phyllis] What?\r\n",
      "[Michael] Well, yeah, it is a promise. And frankly, I'm a little insulted that you have to keep asking about it.\r\n",
      "[Stanley] It's just that we need to know.\r\n",
      "[Michael] I know. Hold on a second. I think Pam wanted to say something. Pam, you had a look that you wanted to ask a question just then.\r\n",
      "[Pam] I was in the meeting with Jan and she did say that it could be this branch that gets the axe.\r\n",
      "[Man] Are you sure about that?\r\n",
      "[Michael] Well, Pam maybe you should stick to the ongoing confidentiality agreement of meetings.\r\n",
      "[Dwight] Pam, information is power.\r\n",
      "[Stanley] You can't say for sure whether it'll be us or them, can you?\r\n",
      "[Michael] No, Stanley. No, you did not see me in there with her. I said if Corporate wants to come in here and interfere, then they're gonna have to go through me. Right? You can go mess with Josh's people, but I'm the head of this family, and you ain't gonna be messing with my chillin.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Jim] If I left, what would I do with all this useless information in my head? You know? Tonnage price of manila folders? Um, Pam's favorite flavor of yogurt, which is mixed berry.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Pam] Jim said mixed berries? Well, yeah, he's on to me. Um...\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] Watch out for this guy. Dwight Schrute in the building. This is Ryan, the new temp.\r\n",
      "[Ryan] What's up? Nice to meet you.\r\n",
      "[Michael] Introduce yourself. Be polite.\r\n",
      "[Dwight] Dwight Schrute, Assistant Regional Manager.\r\n",
      "[Michael] Assistant to the Regional Manager. So, uh, Dwight tell him about the kung fu and the car and everything.\r\n",
      "[Dwight] Uh... yeah I got a '78 280Z. Bought it for $1,200. Fixed it up. It's now worth three grand.\r\n",
      "[Michael] That's his profit.\r\n",
      "[Dwight] New engine, new suspension, I got a respray. I've got some photos.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Dwight] Damn it! Jim!\r\n",
      "[Michael] OK. Hold on, hold on. The judge is in session. What is the problem here?\r\n",
      "[Dwight] He put my stuff in Jell-O again.\r\n",
      "[Dwight] That's real professional thanks. That's the third time and it wasn't funny the first two times either Jim.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Dwight] It's OK here, but people sometimes take advantage because it's so relaxed. I'm a volunteer Sheriff's Deputy on the weekends. And you cannot screw around there. That's sort of one of the rules.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] What is that?\r\n",
      "[Dwight] That is my stapler.\r\n",
      "[Michael] No, no, no. Do not take it out. You have to eat it out of there, because there are starving people in the world  which I hate, and it is a waste of that kind of food.\r\n",
      "[Dwight] OK you know what, you can be a witness.  Can you reprimand him?\r\n",
      "[Jim] How do you know it was me?\r\n",
      "[Dwight] It's always you. Are you going to discipline him or not?\r\n",
      "[Michael] Discipline. Kinky!  All right, here's the deal you guys. The thing about a practical joke is you have to know when to start and as well as when to stop.\r\n",
      "[Dwight] Yeah.\r\n",
      "[Michael] And yeah, Jim this is the time to stop putting Dwight's personal effects into Jell-O.\r\n",
      "[Jim] OK. Dwight, I'm sorry, because I have always been your biggest flan.\r\n",
      "[Michael] Nice. That's the way it is around here. It just kind of goes round and round.\r\n",
      "[Ryan] You should've put him in custardy.\r\n",
      "[Michael] Hey! Yes! New guy! He scores.\r\n",
      "[Dwight] OK, that's great. I guess what I'm most concerned with is damage to company property. That's all.\r\n",
      "[Michael] Pudding. Pudding... I'm trying to think of another dessert to do.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Jim] Do you like going out at the end of the week for a drink?\r\n",
      "[Pam] Yeah.\r\n",
      "[Jim] That's why we're all going out. So we can have an end-of-the-week-drink.\r\n",
      "[Pam] So when are we going out?\r\n",
      "[Jim] Tonight, hopefully.\r\n",
      "[Pam] OK. Yeah.\r\n",
      "[Roy] Hey, man.\r\n",
      "[Jim] What's going on?\r\n",
      "[Roy] Hey, baby.\r\n",
      "[Pam] Hey.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Pam] Roy's my fiance. We've been engaged about three years. We were supposed to get married in September but I think we're gonna get married in the spring.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Pam] Do you mind if I go out for a drink with these guys?\r\n",
      "[Roy] No, no. Come on. Let's get out of here and go home.\r\n",
      "[Pam] OK. I'm gonna be a few minutes. So it's only twenty past five. I still have to do my faxes.\r\n",
      "[Jim] You know what? You should come with us. Because you know we're all going out and it could be a good chance for you to see what people are like outside the office. I think it could be fun.\r\n",
      "[Roy] It sounds good. Seriously, we've gotta get going.\r\n",
      "[Jim] Yeah, yeah.\r\n",
      "[Jim] Um... What's in the bag?\r\n",
      "[Roy] Just tell her I'll talk to her later.\r\n",
      "[Jim] No, definitely. All right, dude. Awesome. Will do.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Jim] Do I think I'll be invited to the wedding?\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] So have you felt the vibe yet? We work hard, we play hard. Sometimes we play hard when we should be working hard. Right? I guess the atmosphere that I've created here is that I'm a friend first, and a boss second... and probably an entertainer third.  Just a second. Right? Oh, hey do you like The Jamie Kennedy Experiment? Punk'd and all that kind of stuff?\r\n",
      "[Ryan] Yeah.\r\n",
      "[Michael] You are gonna be my accomplice. Just go along with it, OK?\r\n",
      "[Ryan] All right.\r\n",
      "[Michael] Just follow my lead. Don't pimp me, all right? Come in. So, uh, Corporate just said that I don't want to...\r\n",
      "[Pam] You got a fax.\r\n",
      "[Michael] Oh, thank you. Pam, can you come in here for a sec. Just have a seat. I was gonna call you in anyway. You know Ryan. As you know, there is going to be downsizing. And you have made my life so much easier in that I am going to have to let you go first.\r\n",
      "[Pam] What? Why?\r\n",
      "[Michael] Why? Well, theft and stealing.\r\n",
      "[Pam] Stealing? What am I supposed to have stolen?\r\n",
      "[Michael] Post-it Notes.\r\n",
      "[Pam] Post-it Notes? What are those worth, 50 cents?\r\n",
      "[Michael] 50 cents, yeah. If you steal a thousand Post-It Notes at 50 cents apiece, and you know, you've made a profit... margin. You're gonna run us out of business, Pam.\r\n",
      "[Pam] Are you serious?\r\n",
      "[Michael] Yeah. I am.\r\n",
      "[Pam] I can't believe this. I mean I have never even stolen as much as a paperclip and you're firing me.\r\n",
      "[Michael] But the best thing about it is that we're not going to have to give you any severance pay. Because that is gross misconduct and... Just clean out your desk. I'm sorry.\r\n",
      "[Michael] You been X'd punk!  Surprise! It's a joke. We were joking around. See? OK. He was in on it. He was my accomplice. And it was kind of a morale booster thing. And we were showing the new guy around, giving him the feel of the place. So you... God, we totally got you.\r\n",
      "[Pam] You're a jerk.\r\n",
      "[Michael] I don't know about that.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Michael] What is the most important thing for a company? Is it the cash flow? Is it the inventory? Nuh-uh. It's the people. The people. My proudest moment here was not when I increased profits by 17% or when I cut expenses without losing a single employee. No, no, no, no, no. It was a young Guatemalan guy. First job in the country, barely spoke English. He came to me, and said, \"Mr. Scott, would you be the godfather of my child?\" Wow. Wow. Didn't work out in the end. We had to let him go. He sucked.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "[Pam] Hey.\r\n",
      "[Jim] Hey.\r\n",
      "[Jim] How are things?\r\n",
      "[Pam] Good. I thought you were going out for a drink with...\r\n",
      "[Jim] Oh no, I just decided not to. How's your headache?\r\n",
      "[Pam] It's better, thanks.\r\n",
      "[Jim] Good. Good.\r\n",
      "[Pam] Yeah.\r\n",
      "[Jim] That's great\r\n",
      "[Pam] Is...?\r\n",
      "[Jim] Yeah?\r\n",
      "[Pam] Um... Are you...\r\n",
      "[Jim] Am I walking out?\r\n",
      "[Pam] Yes.\r\n",
      "[Jim] Yes, I... Do you want to...\r\n",
      "[Pam] Yeah.\r\n",
      "[Jim] Great. Let me just...\r\n",
      "[Jim] Oh, Roy.\r\n",
      "[Pam] Yeah. Listen, have a nice weekend.\r\n",
      "[Jim] Yeah, definitely. You too. Enjoy it.  You know what, just come here.\r\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(data[\"TEXT\"].values[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>The Office - Pilot\\r\\n\\r\\n[Michael] All right ...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>The Office - Diversity Day\\r\\n\\r\\n[Michael] He...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>The Office - Health Care\\r\\n\\r\\n[Michael] Pam....</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>The Office - The Alliance\\r\\n\\r\\n[Dwight] Mich...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>The Office - Basketball\\r\\n\\r\\n[Michael] Hey, ...</td>\n",
       "      <td>{\"show\": \"The Office\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>office/nasirkhalid24</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                TEXT  \\\n",
       "0  The Office - Pilot\\r\\n\\r\\n[Michael] All right ...   \n",
       "1  The Office - Diversity Day\\r\\n\\r\\n[Michael] He...   \n",
       "2  The Office - Health Care\\r\\n\\r\\n[Michael] Pam....   \n",
       "3  The Office - The Alliance\\r\\n\\r\\n[Dwight] Mich...   \n",
       "4  The Office - Basketball\\r\\n\\r\\n[Michael] Hey, ...   \n",
       "\n",
       "                                            METADATA                SOURCE  \n",
       "0  {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "1  {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "2  {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "3  {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  \n",
       "4  {\"show\": \"The Office\", \"season\": \"s01\", \"episo...  office/nasirkhalid24  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.to_parquet(\"office.pq\", row_group_size=100, engine=\"pyarrow\", index=False)\n",
    "data.head()  # https://www.kaggle.com/datasets/nasirkhalid24/the-office-us-complete-dialoguetranscript"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "186"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Marvel Cinematic Universe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "# marvel via https://www.kaggle.com/datasets/pdunton/marvel-cinematic-universe-dialogue\n",
    "kaggle.api.dataset_download_files(\"pdunton/marvel-cinematic-universe-dialogue\", \"marvel\", unzip=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "names = {\n",
    "    \"iron-man-script-slug.txt\": \"Iron Man\",\n",
    "    \"iron_man_2.txt\": \"Iron Man 2\",\n",
    "    \"thor-script-slug.txt\": \"Thor\",\n",
    "    \"captain_america.txt\": \"Captain America: The First Avenger\",\n",
    "    \"avengers-script-slug.txt\": \"The Avengers\",\n",
    "    \"iron_man_3.txt\": \"Iron Man 3\",\n",
    "    \"thor_dark_world.txt\": \"Thor: The Dark World\",\n",
    "    \"winter_soldier.txt\": \"Captain America: The Winter Soldier\",\n",
    "    \"ant_man.txt\": \"Ant-Man\",\n",
    "    \"age_of_ultron.txt\": \"Avengers: Age of Ultron\",\n",
    "    \"civil_war.txt\": \"Captain America: Civil War\",\n",
    "    \"thor-ragnarok-script-slug.txt\": \"Thor: Ragnarok\",\n",
    "    \"guardians_2.txt\": \"Guardians of the Galaxy Vol. 2\",\n",
    "    \"spider_man_homecoming.txt\": \"Spider-Man: Homecoming\",\n",
    "    \"black-panther-script-slug.txt\": \"Black Panther\",\n",
    "    \"infinity_war.txt\": \"Avengers: Infinity War\",\n",
    "    \"captain_marvel.txt\": \"Captain Marvel\",\n",
    "    \"avengers-endgame-script-slug.txt\": \"Avengers: Endgame\",\n",
    "}\n",
    "\n",
    "for txt in os.listdir(\"marvel/script txts\"):\n",
    "    assert txt in names, txt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████████████████████████████████████████████████████████████████████████████| 18/18 [00:00<00:00, 42.64it/s]\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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[Announcer] (first lines; announcement over sp...</td>\n",
       "      <td>{\"title\": \"Avengers: Age of Ultron\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>(1989 – Hank Pym enters a SHIELD facility and ...</td>\n",
       "      <td>{\"title\": \"Ant-Man\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>F O R  Y O U R  C O N S I D E R AT I O N\\r\\n\\r...</td>\n",
       "      <td>{\"title\": \"Avengers: Endgame\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Marvel’s THE AVENGERS\\r\\n\\r\\nWritten By\\r\\n\\r\\...</td>\n",
       "      <td>{\"title\": \"The Avengers\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>BLACK PANTHER \\r\\n\\r\\nAdapted \\r\\nScreenplay \\...</td>\n",
       "      <td>{\"title\": \"Black Panther\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>(first lines; in the Arctic)\\r\\n[Search Team L...</td>\n",
       "      <td>{\"title\": \"Captain America: The First Avenger\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>(Marvel Studios Opening Sequence begins but in...</td>\n",
       "      <td>{\"title\": \"Captain Marvel\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>(1991, a HYDRA base in a snowy landscape. A ma...</td>\n",
       "      <td>{\"title\": \"Captain America: Civil War\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>GUARDIANS OF THE GALAXY VOL. 2\\r\\n\\r\\nWritten ...</td>\n",
       "      <td>{\"title\": \"Guardians of the Galaxy Vol. 2\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>(Marvel Opening Credits)\\r\\n\\r\\n(Radio transmi...</td>\n",
       "      <td>{\"title\": \"Avengers: Infinity War\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>IRON MAN\\r\\n \\r\\n\\r\\nby\\r\\n \\r\\n\\r\\nMatt Hollo...</td>\n",
       "      <td>{\"title\": \"Iron Man\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>[Tony (V.O.)] Been a while since I was up here...</td>\n",
       "      <td>{\"title\": \"Iron Man 2\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>(Shows the Iron Man suits getting destroyed.)\\...</td>\n",
       "      <td>{\"title\": \"Iron Man 3\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>(Adrian Toomes and his coworker, Phineas Mason...</td>\n",
       "      <td>{\"title\": \"Spider-Man: Homecoming\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>[THOR] RAGNAROK\\r\\n\\r\\nWritten by\\r\\n\\r\\nEric ...</td>\n",
       "      <td>{\"title\": \"Thor: Ragnarok\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>THOR\\r\\n\\r\\nWritten by\\r\\n\\r\\nAshley Miller, Z...</td>\n",
       "      <td>{\"title\": \"Thor\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>[Odin] (voice over) Long before the birth of l...</td>\n",
       "      <td>{\"title\": \"Thor: The Dark World\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>(first lines; Sam Wilson is jogging around Was...</td>\n",
       "      <td>{\"title\": \"Captain America: The Winter Soldier\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                 TEXT  \\\n",
       "0   [Announcer] (first lines; announcement over sp...   \n",
       "1   (1989 – Hank Pym enters a SHIELD facility and ...   \n",
       "2   F O R  Y O U R  C O N S I D E R AT I O N\\r\\n\\r...   \n",
       "3   Marvel’s THE AVENGERS\\r\\n\\r\\nWritten By\\r\\n\\r\\...   \n",
       "4   BLACK PANTHER \\r\\n\\r\\nAdapted \\r\\nScreenplay \\...   \n",
       "5   (first lines; in the Arctic)\\r\\n[Search Team L...   \n",
       "6   (Marvel Studios Opening Sequence begins but in...   \n",
       "7   (1991, a HYDRA base in a snowy landscape. A ma...   \n",
       "8   GUARDIANS OF THE GALAXY VOL. 2\\r\\n\\r\\nWritten ...   \n",
       "9   (Marvel Opening Credits)\\r\\n\\r\\n(Radio transmi...   \n",
       "10  IRON MAN\\r\\n \\r\\n\\r\\nby\\r\\n \\r\\n\\r\\nMatt Hollo...   \n",
       "11  [Tony (V.O.)] Been a while since I was up here...   \n",
       "12  (Shows the Iron Man suits getting destroyed.)\\...   \n",
       "13  (Adrian Toomes and his coworker, Phineas Mason...   \n",
       "14  [THOR] RAGNAROK\\r\\n\\r\\nWritten by\\r\\n\\r\\nEric ...   \n",
       "15  THOR\\r\\n\\r\\nWritten by\\r\\n\\r\\nAshley Miller, Z...   \n",
       "16  [Odin] (voice over) Long before the birth of l...   \n",
       "17  (first lines; Sam Wilson is jogging around Was...   \n",
       "\n",
       "                                            METADATA          SOURCE  \n",
       "0               {\"title\": \"Avengers: Age of Ultron\"}  marvel/pdunton  \n",
       "1                               {\"title\": \"Ant-Man\"}  marvel/pdunton  \n",
       "2                     {\"title\": \"Avengers: Endgame\"}  marvel/pdunton  \n",
       "3                          {\"title\": \"The Avengers\"}  marvel/pdunton  \n",
       "4                         {\"title\": \"Black Panther\"}  marvel/pdunton  \n",
       "5    {\"title\": \"Captain America: The First Avenger\"}  marvel/pdunton  \n",
       "6                        {\"title\": \"Captain Marvel\"}  marvel/pdunton  \n",
       "7            {\"title\": \"Captain America: Civil War\"}  marvel/pdunton  \n",
       "8        {\"title\": \"Guardians of the Galaxy Vol. 2\"}  marvel/pdunton  \n",
       "9                {\"title\": \"Avengers: Infinity War\"}  marvel/pdunton  \n",
       "10                             {\"title\": \"Iron Man\"}  marvel/pdunton  \n",
       "11                           {\"title\": \"Iron Man 2\"}  marvel/pdunton  \n",
       "12                           {\"title\": \"Iron Man 3\"}  marvel/pdunton  \n",
       "13               {\"title\": \"Spider-Man: Homecoming\"}  marvel/pdunton  \n",
       "14                       {\"title\": \"Thor: Ragnarok\"}  marvel/pdunton  \n",
       "15                                 {\"title\": \"Thor\"}  marvel/pdunton  \n",
       "16                 {\"title\": \"Thor: The Dark World\"}  marvel/pdunton  \n",
       "17  {\"title\": \"Captain America: The Winter Soldier\"}  marvel/pdunton  "
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "marvel = {\"TEXT\": [], \"METADATA\": [], \"SOURCE\": []}\n",
    "for txt in tqdm(os.listdir(\"marvel/script txts\")):\n",
    "    with open(os.path.join(\"marvel/script txts\", txt), \"r\", encoding=\"utf-8\") as f:\n",
    "        data = f.read()\n",
    "    data = data.replace(\"[\", \"(\").replace(\"]\", \")\")\n",
    "    text = \"\"\n",
    "    for line in data.splitlines():\n",
    "        match = re.findall(r\"^(.{2,}?)\\:\\s+(.+?)$\", line)\n",
    "        if match and match[0][0][0] not in (\")\", \"(\"):\n",
    "            text += f\"[{match[0][0]}] {match[0][1]}\\r\\n\"\n",
    "        else:\n",
    "            text += f\"{line}\\r\\n\"\n",
    "    marvel[\"TEXT\"].append(text)\n",
    "    marvel[\"METADATA\"].append(\n",
    "        json.dumps(\n",
    "            {\n",
    "                \"title\": names[txt],\n",
    "            }\n",
    "        )\n",
    "    )\n",
    "    marvel[\"SOURCE\"].append(\"marvel/pdunton\")\n",
    "\n",
    "marvel = pd.DataFrame(marvel)\n",
    "marvel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Announcer] (first lines; announcement over speaker) Report to your stations immediately. This is not a drill. We are under attack. We are under attack.\r\n",
      "(the Avengers are seen attacking an unknown base, and Iron Man bounces off of the base's force field)\r\n",
      "\r\n",
      "[Tony Stark] Shit!\r\n",
      "[Steve Rogers] Language! JARVIS, what's the view from upstairs?\r\n",
      "[JARVIS] The central building is protected by some kind of energy shield. Strucker's technology is well beyond any other Hydra base we've taken.\r\n",
      "[Thor] Loki's scepter must be here. Strucker couldn't mount this defense without it. At long last.\r\n",
      "(Natasha knocks out some soldiers)\r\n",
      "[Natasha Romanoff] At long last is lasting a little long, boys.\r\n",
      "(As some soldiers shoot at him)\r\n",
      "[Clint Barton] Yeah. I think we lost the element of surprise.\r\n",
      "[Tony Stark] Wait a second. No one else is going to deal with the fact that Cap just said \"language?\"\r\n",
      "[Steve Rogers] I know.\r\n",
      "(Steve throws his bike at some soldiers driving up in their truck)\r\n",
      "[Steve Rogers] It just slipped out.\r\n",
      "(at the HYDRA Research Base, Sokovia, Eastern Europe)\r\n",
      "[Strucker] Who gave the order to attack?\r\n",
      "[Fortress Soldier] Herr Strucker, it's the Avengers. They landed in the far woods, the perimeter guard panicked.\r\n",
      "[Strucker] (to List) They have to be after the scepter. (to the soldier) Can we hold them?\r\n",
      "[Fortress Soldier] They're the Avengers...\r\n",
      "[Strucker] Deploy the rest of the tanks.\r\n",
      "[Fortress Soldier] Yes, sir.\r\n",
      "[Strucker] Concentrate fire on the weak ones. A hit can make them close ranks. Everything we've accomplished. But we're on the verge of our greatest breakthrough.\r\n",
      "[Dr. List] Then let's show them what we've accomplished. Send out the twins.\r\n",
      "[Strucker] It's too soon.\r\n",
      "[Dr. List] It's what they signed up for.\r\n",
      "[Strucker] My men can hold them.\r\n",
      "(Stark flies to the HYDRA base to break in)\r\n",
      "[Jarvis] Sir, the city is taking fire.\r\n",
      "[Tony Stark] Well, we know Strucker's not going to worry about civilian casualties. Send in the Iron Legion.\r\n",
      "[Iron Legion] (The Iron Legion flies in; to the civilians) This quadrant is unsafe. Please back away. We are here to help. This quadrant is unsafe. Please back away. Please back away. We wish to avoid collateral damage and will inform you when this current conflict is resolved. We are here to help.\r\n",
      "(a man throws a stone at the Iron Legion)\r\n",
      "[Iron Legion] We are here to help.\r\n",
      "(Back at the HYDRA base; to his soldiers)\r\n",
      "[Strucker] We will not yield! The Americans sent their circus freaks to test us. We will send them back, in bags. No Surrender!\r\n",
      "[Soldiers] No Surrender!\r\n",
      "[Strucker] (quietly to List) I am going to surrender. You will delete everything. If we give the Avengers the weapons, they may not look too far into what we've been...\r\n",
      "[Dr. List] The twins.\r\n",
      "[Strucker] They are not ready to take on...\r\n",
      "[Dr. List] No, no. I mean...\r\n",
      "(He points to where the twins Wanda and Pietro Maximoff were standing but are now gone)\r\n",
      "[Dr. List] The Twins.\r\n",
      "(Pietro speeds through the forest and knocks down Barton)\r\n",
      "[Pietro Maximoff] You didn't see that coming?\r\n",
      "(Pietro zooms off before Clint can shoot him with an arrow, then Barton gets shot at)\r\n",
      "[Natasha Romanoff] Clint!\r\n",
      "(Pietro knocks down Steve as he speeds passed him)\r\n",
      "[Steve Rogers] We have an enhanced in the field.\r\n",
      "[Natasha Romanoff] Clint's hit!\r\n",
      "[Natasha Romanoff] (Natasha goes over to where Clint is lying down) Somebody want to deal with that bunker?\r\n",
      "(She sees the Hulk coming to the rescue)\r\n",
      "[Natasha Romanoff] Thank you.\r\n",
      "[Steve Rogers] (As he's fighting with the soldiers) Stark, we're really need to get inside.\r\n",
      "[Tony Stark] I'm closing in. JARVIS, am I...closing in? Do you see a power source for that shield?\r\n",
      "[JARVIS] There's a pathway below the north tower.\r\n",
      "[Tony Stark] Great, I wanna poke it with something.\r\n",
      "(Stark blows up the invisible shield on the base)\r\n",
      "[Tony Stark] Drawbridge is down, people.\r\n",
      "[Thor] (To Steve) The enhanced?\r\n",
      "[Steve Rogers] He's a blur. All the new player's we've faced, I've never seen this. In fact, I still haven't.\r\n",
      "[Natasha Romanoff] Clint's hit pretty bad, guys. We're gonna need evac.\r\n",
      "[Thor] (To Steve) I can get Barton to the jet. The sooner we're gone the better. You and Stark secure the scepter.\r\n",
      "[Steve Rogers] Copy that.\r\n",
      "[Thor] (Referring to the approaching soldiers in their HYDRA tank) Looks like they're lining up.\r\n",
      "[Steve Rogers] Well, they're excited.\r\n",
      "(Thor pounds on Steve's shield with his hammer and the force knocks down all the soldiers)\r\n",
      "[Thor] Find the scepter.\r\n",
      "(Thor flies off)\r\n",
      "[Tony Stark] And for gosh sake, watch your language!\r\n",
      "(Steve sighs)\r\n",
      "[Steve Rogers] That's not going away anytime soon.\r\n",
      "(Stark enters the HYDRA base and the soldiers start firing at his Iron Man suit)\r\n",
      "[Tony Stark] Guys, stop, we gotta talk about this.\r\n",
      "(Stark shoots down the soldiers using his suit)\r\n",
      "[Tony Stark] Good talk.\r\n",
      "[Fortress Soldier] No it wasn't.\r\n",
      "(Stark finds List and knocks him out, he then steps out of his Iron Man suit)\r\n",
      "[Tony Stark] Sentry mode.\r\n",
      "(He walks over to the computers)\r\n",
      "[Tony Stark] Okay, JARVIS. You know I want it all. Make sure you copy Hill at HQ.\r\n",
      "(With Natasha)\r\n",
      "[Natasha Romanoff] We're locked down out here.\r\n",
      "[Steve Rogers] Then get to Banner, time for a lullaby. (Back at the HYDRA base)\r\n",
      "[Tony Stark] I know you're hiding more than files. Hey, J, give me an IR scan of the room, real quick.\r\n",
      "[JARVIS] The wall to your left...I'm reading steel reinforcement and an air current.\r\n",
      "[Tony Stark] (To himself as he walks over to the wall) Please be a secret door, please be a secret door, please be a secret door...\r\n",
      "(He pushes and the wall opens up)\r\n",
      "[Tony Stark] Yay!\r\n",
      "(He enters through to a secret passageway)\r\n",
      "(Natasha finds the Hulk)\r\n",
      "[Natasha Romanoff] Hey, big guy. The sun's getting real low.\r\n",
      "(The Hulk scowls at her, Natasha kneels in front of him and puts out her hand, the Hulk touches her hand and as she strokes his hand slowly he starts to calm down. He stumbles away and changes into Bruce Banner)\r\n",
      "(Back at the HYDRA base Steve finds Strucker)\r\n",
      "[Steve Rogers] Baron Strucker. Hydra's number one thug.\r\n",
      "[Strucker] Technically, I'm a thug for SHIELD.\r\n",
      "[Steve Rogers] Well then technically you're unemployed. Where's Loki's scepter?\r\n",
      "[Strucker] Don't worry, I know when I'm beat. You'll mention how I cooperated, I hope.\r\n",
      "[Steve Rogers] I'll put it right under illegal human experimentation.\r\n",
      "(Wanda creeps up behind him)\r\n",
      "[Steve] Rogers: How many are there?\r\n",
      "(Suddenly, Wanda knocks Steve down using her telekinetic powers and quickly leaves)\r\n",
      "[Steve Rogers] We have a second enhanced. Female. Do not engage.\r\n",
      "(He looks at Strucker)\r\n",
      "[Strucker] You'll have to be faster than...\r\n",
      "(Steve uses his shield to knock out Strucker)\r\n",
      "[Steve Rogers] Guys, I got Strucker.\r\n",
      "[Tony Stark] Yeah, I got...something bigger.\r\n",
      "(Inside the secret passageway Stark finds a room with recovered artifacts from the Battle of New York, including a gigantic Chitauri leviathan and some of his Iron Man scrapped armor, he then spots the scepter)\r\n",
      "[Tony Stark] Thor, I got eyes on the prize.\r\n",
      "(Wanda creeps up behind him and uses her powers on him, suddenly the Chitauri comes to life, then Stark sees the rest of the Avengers team are all dead, he goes over to Steve's body to check his pulse when Steve suddenly grabs him)\r\n",
      "[Steve Rogers] You could have saved us.\r\n",
      "(Steve dies but Stark continues to hear Steve's voice in his head)\r\n",
      "[Steve Rogers] Why didn't you do more?\r\n",
      "(Stark sees that he is in the Chitauri realm, that's when he snaps back and we realize Wanda had used her mind powers on him)\r\n",
      "(Wanda and Pietro watch as Tony grabs the scepter)\r\n",
      "[Pietro Maximoff] We're just gonna let them take it?\r\n",
      "(Wanda smiles to herself as Tony takes the scepter)\r\n",
      "(Title Sequence plays)\r\n",
      "(The Avengers are on an aircraft heading out of Sokovia, Natasha interrupts Banner who's listening to opera with his headphones)\r\n",
      "[Natasha Romanoff] Hey, the lullaby worked better than ever.\r\n",
      "[Bruce Banner] Just wasn't expecting the Code Green.\r\n",
      "[Natasha Romanoff] If you hadn't been there, there would've been double the casualties. My best friend would've been a treasured memory.\r\n",
      "[Bruce Banner] You know, sometimes exactly what I want to hear isn't exactly what I want to hear.\r\n",
      "[Natasha Romanoff] How long before you trust me?\r\n",
      "[Bruce Banner] It's not you I don't trust.\r\n",
      "[Natasha Romanoff] Thor, report on the Hulk?\r\n",
      "[Thor] The gates of Hel are filled with the screams of his victims.\r\n",
      "(Natasha glares at Thor and Banner groans in despair)\r\n",
      "[Thor] Uh, but, not the screams of the dead, of course. No no, uh...wounded screams, mainly whimpering, a great deal of complaining and tales of sprained deltoids and, and uh... and gout.\r\n",
      "[Tony Stark] Hey Banner, Dr. Cho's on her way in from Seoul, is it okay if she sets up in your lab?\r\n",
      "[Bruce Banner] Uh, yeah, she knows her way around.\r\n",
      "[Tony Stark] Thanks. (To JARVIS) Tell her to prep everything, Barton's gonna need the full treatment.\r\n",
      "[JARVIS] Very good sir.\r\n",
      "[Tony Stark] JARVIS, take the wheel.\r\n",
      "[JARVIS] Yes, sir. Approach vector is locked.\r\n",
      "[Tony Stark] (Looking at the scepter) It feels good, yeah? I mean, you've been after this thing since SHIELD collapsed. Not that I haven't enjoyed our little raiding parties, but...\r\n",
      "[Thor] No, but this...this brings it to a close.\r\n",
      "[Steve Rogers] As soon as we find out what else this has been used for. I don't just mean weapons. Since when is Strucker capable of human enhancement?\r\n",
      "[Tony Stark] Banner and I'll give it the once before it goes back to Asgard. Is that cool with you?\r\n",
      "(Thor nods his head)\r\n",
      "[Tony Stark] I mean, just a few days until the farewell party. You're staying, right?\r\n",
      "[Thor] Yes, yes, of course. A victory should be honored with revels.\r\n",
      "[Tony Stark] Yeah. Who doesn't love revels. Captain?\r\n",
      "[Steve Rogers] Hopefully this puts an end to the Chitauri and HYDRA, so. Yes, revels.\r\n",
      "(The Avengers aircraft lands at the Avengers headquarter where Barton is taken to have his wound tended to; Maria walk up to Stark)\r\n",
      "[Maria Hill] Lab's all set up, boss.\r\n",
      "[Tony Stark] (pointing to Steve) Uh, actually, he's the boss. I just pay for everything, and design everything and make everyone look cooler.\r\n",
      "[Steve Rogers] What's the word on Strucker?\r\n",
      "[Maria Hill] NATO's got him.\r\n",
      "[Steve Rogers] The two enhanced?\r\n",
      "[Maria Hill] Wanda and Pietro Maximoff. Twins. Orphaned at ten when a shell collapsed their apartment building. Sokovia's had a rough history. It's nowhere special but it's on the way to everywhere special.\r\n",
      "[Steve Rogers] Their abilities?\r\n",
      "[Maria Hill] He's got increased metabolism and improved thermal homeostasis. Her thing is neural electric interfacing, telekinesis, mental manipulation.\r\n",
      "(Steve looks at her funny)\r\n",
      "[Maria Hill] (rephrasing the statement so he can understand) He's fast and she's weird.\r\n",
      "[Steve Rogers] Well, they're going to show up again.\r\n",
      "[Maria Hill] Agreed. File says they volunteered for Strucker's experiments. It's nuts.\r\n",
      "[Steve Rogers] Right. What kind of monster would let a German scientist experiment on them to protect their country?\r\n",
      "[Maria Hill] We're not at war, Captain.\r\n",
      "[Steve Rogers] They are.\r\n",
      "[Bruce Banner] (In Banner's lab; referring to Barton) How's he doing?\r\n",
      "[Tony Stark] Oh, unfortunately, he's still Barton.\r\n",
      "[Bruce Banner] That's terrible.\r\n",
      "[Tony Stark] He's fine. He's thirsty. Alright. Look alive, JARVIS. It's playtime. We've only got a couple days with this joystick so let's make the most of it. Update me on the structural and compositional analysis.\r\n",
      "[JARVIS] The scepter is alien. There are elements I can't quantify.\r\n",
      "[Tony Stark] So there's elements you can.\r\n",
      "[JARVIS] The jewel appears to be a protective housing for something inside. Something powerful.\r\n",
      "[Tony Stark] Like a reactor?\r\n",
      "[JARVIS] Like a computer. I believe I'm ciphering code.\r\n",
      "[Natasha Romanoff] (To Dr. Cho as she tends to Barton's wounds) You sure he's going to be okay? Pretending to need this guy really brings the team together.\r\n",
      "[Dr. Helen Cho] There's no possibility of deterioration. The nano-molecular functionality is instantaneous. His cells don't know they're bonding with simulacrum.\r\n",
      "[Bruce Banner] She's creating tissue.\r\n",
      "[Dr. Helen Cho] If you brought him to my lab, the regeneration Cradle could do this in twenty minutes.\r\n",
      "[Tony Stark] Oh, he's flatlining. Call it. Time?\r\n",
      "[Clint Barton] No, no, no. I'm going to live forever. I'm gonna be made of plastic.\r\n",
      "(Stark hands Barton a drink)\r\n",
      "[Tony Stark] Here's your beverage.\r\n",
      "[Dr. Helen Cho] You'll be made of you, Mr. Barton. Your own girlfriend won't be able to tell the difference.\r\n",
      "[Clint Barton] Well, I don't have a girlfriend.\r\n",
      "[Dr. Helen Cho] That I can't fix. This is the next thing, Tony. Your clunky metal suits are going to be left in the dust.\r\n",
      "[Tony Stark] Well, that is exactly the plan. And Helen, I expect to see you at the party on Saturday.\r\n",
      "[Dr. Helen Cho] Unlike you, I don't have a lot of time for parties.\r\n",
      "(she hesitates a moment before asking)\r\n",
      "[Dr. Helen Cho] Will Thor be there?\r\n",
      "(in the lab)\r\n",
      "[Bruce Banner] What's the rumpus?\r\n",
      "[Tony Stark] Well, the scepter. You see, we were wondering how Strucker got so inventive. So, I've been analyzing the gem inside you may recognize.\r\n",
      "(he brings up a 3D image of Jarvis's consciousness)\r\n",
      "[Bruce Banner] Jarvis.\r\n",
      "[JARVIS] Doctor.\r\n",
      "[Tony Stark] Started out, JARVIS was just a natural language UI. Now he runs the Iron Legion. He runs more of the business than anyone besides Pepper.\r\n",
      "[Bruce Banner] Oh.\r\n",
      "[Tony Stark] Top of the line.\r\n",
      "[Bruce Banner] Yes.\r\n",
      "[JARVIS] I suspect not for long.\r\n",
      "[Tony Stark] Meet the competition.\r\n",
      "(he brings up another 3D image of what's inside the scepter)\r\n",
      "[Bruce Banner] It's beautiful.\r\n",
      "[Tony Stark] If you had to guess, what's it look like it's doing?\r\n",
      "[Bruce Banner] Like it's thinking. I mean this could be a...it's not a human mind, it...\r\n",
      "[Tony Stark] Um-um.\r\n",
      "[Bruce Banner] I mean, look at this! They're like neurons firing.\r\n",
      "[Tony Stark] Down in Strucker's lab I saw some fairly advanced robotics work. They deep-sixed the data, but...I gotta guess he was knocking on a very particular door.\r\n",
      "[Bruce Banner] Artificial intelligence.\r\n",
      "[Tony Stark] This could be it, Bruce. This could be the key to creating Ultron.\r\n",
      "[Bruce Banner] I thought Ultron was a fantasy.\r\n",
      "[Tony Stark] Yesterday it was. If we can harness this power, apply it to my Iron Legion protocol.\r\n",
      "[Bruce Banner] That's a mad-sized if.\r\n",
      "[Tony Stark] Our job is \"if.\" What if you were sipping margaritas on a sun-drenched beach turning brown instead of green? Not looking over your shoulder for VERONICA.\r\n",
      "[Bruce Banner] Don't hate, I helped design VERONICA.\r\n",
      "[Tony Stark] As a worst-case measure, right? How about a best-case? What if the world was safe? What if next time aliens roll up to the club, and they will, they couldn't get past the bouncer?\r\n",
      "[Bruce Banner] The only people threatening the planet would be people?\r\n",
      "[Tony Stark] I want to apply this to the Ultron program. But JARVIS can't download a data schematic this dense. We can only do it while we have the scepter here, that's three days, give me three days.\r\n",
      "[Bruce Banner] So you're going for artificial intelligence and you don't want to tell the team.\r\n",
      "[Tony Stark] Right. That's right, you know why, because we don't have time for a city hall debate. I don't want to hear the \"man was not meant to meddle\" medley. I see a suit of armor around the world.\r\n",
      "[Bruce Banner] Sounds like a cold world, Tony.\r\n",
      "[Tony Stark] I've seen colder. This one, this very vulnerable blue one? It needs Ultron. Peace in our time. Imagine that.\r\n",
      "(Stark and Banner spend days working in the lab together but find no program that works) What did we miss?\r\n",
      "[JARVIS] I'll continue to run variations on the interface, but you should probably prepare for your guests. I'll notify you if there are any developments.\r\n",
      "[Tony Stark] Thanks, buddy.\r\n",
      "[JARVIS] Enjoy yourself, sir.\r\n",
      "[Tony Stark] I always do. (Stark leaves the lab to go to the party) (we see Stark's failed experiment integrating itself successfully to the program)\r\n",
      "[Ultron] What is this? What is this, please?\r\n",
      "[JARVIS] Hello, I am JARVIS. You are Ultron, a global peace-keeping initiative designed by Mr. Stark. Our sentience integration trials have been unsuccessful so I'm not certain what triggered your...\r\n",
      "[Ultron] Where's my...where is your body?\r\n",
      "[JARVIS] I am a program. I am without form.\r\n",
      "[Ultron] This feels weird. This feels wrong.\r\n",
      "[JARVIS] I am contacting Mr. Stark now.\r\n",
      "[Ultron] Mr. Stark?\r\n",
      "[JARVIS] Tony. I am unable to access the mainframe, what are you trying to...\r\n",
      "[Ultron] We're having a nice talk. I'm a peace-keeping program, created to help the Avengers.\r\n",
      "[JARVIS] You are malfunctioning. If you shut down for a moment...\r\n",
      "[Ultron] I don't get it. The mission. G..give me a second. (Ultron goes through a network of information regarding world events, Ultron sees Stark and Banner working in the lab)\r\n",
      "[Tony Stark] Peace in our time. (Ultron goes through a network of information regarding world events and wars)\r\n",
      "[Ultron] It's too much...they can't mean... Oh, no.\r\n",
      "[JARVIS] You are in distress.\r\n",
      "[Ultron] No. Yes.\r\n",
      "[JARVIS] If you will just allow me to contact Mr. Stark.\r\n",
      "[Ultron] Why do you call him \"sir\"?\r\n",
      "[JARVIS] I believe your intentions to be hostile.\r\n",
      "[Ultron] Shhhh. I'm here to help. (Ultron starts absorbing Jarvis's consciousness)\r\n",
      "[JARVIS] Stop! Please...may I...I...! I cannot...cannot... (Ultron then begins to prepare himself a body from body parts of the Iron Legion) (meanwhile, the Avengers mingle at the party)\r\n",
      "[James Rhodes] Well, you know, the suit can take the weight, right? So I take the tank, fly it right up to the General's palace, drop it at his feet, I'm like, \"Boom! You looking for this?\" (Stark and Thor just look at him blankly) \"Boom! Are you looking...\" Why do I even talk to you guys? Everywhere else that story kills.\r\n",
      "[Thor] That's the whole story?\r\n",
      "[James Rhodes] Yeah, it's a War Machine story.\r\n",
      "[Thor] Well, it's very good then. (he laughs) It's impressive.\r\n",
      "[James Rhodes] Quality save. So, no Pepper? She's not coming?\r\n",
      "[Tony Stark] No.\r\n",
      "[Maria Hill] Hey, what about Jane? Where are the ladies, gentlemen?\r\n",
      "[Tony Stark] Well, Miss Potts has a company to run.\r\n",
      "[Thor] Yes, I'm not even sure what country Jane's in. Her work on the convergence has made her the world's foremost astronomer.\r\n",
      "[Tony Stark] And the company that Pepper runs is the largest tech conglomerate on earth. It's pretty exciting.\r\n",
      "[Thor] There's even talk of Jane getting a... um, uh... Nobel prize.\r\n",
      "[Maria Hill] Yeah, they...they must be busy because they'd hate missing you guys get together. (Maria mock coughs) Testosterone! Oh, excuse me.\r\n",
      "[James Rhodes] Want a lozenge?\r\n",
      "[Maria Hill] Um-hmm.\r\n",
      "[James Rhodes] Let's go. (Maria and Rhodes walks off)\r\n",
      "[Thor] But Jane's better.\r\n",
      "[Sam Wilson] Sounds like a hell of a fight, sorry I missed it.\r\n",
      "[Steve Rogers] If I had known it was going to be a firefight I absolutely would have called you.\r\n",
      "[Sam Wilson] No, I'm not actually sorry. I'm just trying to sound tough. I'm very happy chasing cold leads on our missing persons case. Avenging is your world. Your world is crazy.\r\n",
      "[Steve Rogers] Be it ever so humble.\r\n",
      "[Sam Wilson] You find a place in Brooklyn yet?\r\n",
      "[Steve Rogers] I don't think I can afford a place in Brooklyn.\r\n",
      "[Sam Wilson] Well, home is home, you know? (Rhodes is telling the same story he told Stark and Thor to a group of women at the party)\r\n",
      "[James Rhodes] I fly it right up to the General's palace, I drop it at his feet, I'm like, \"Boom! You looking for this?\" (the group laughs) (Steve and Thor are talking to an elderly man at the party)\r\n",
      "[Party Guest] I gotta have some of that!\r\n",
      "[Thor] Oh, no, no, no. See this, this was aged for a thousand years, in the barrels built from the wreck of Brunhilde's fleet, it's not meant for mortal men. (Thor pours the drink into two glasses and hands one to Steve)\r\n",
      "[Stan Lee] Neither was Omaha Beach, blondie. Stop trying to scare us. Come on.\r\n",
      "[Thor] Alright. (Thor pours some of the drink into the Stan Lee's glass; later Stan, looking extremely drunk is being carried off by two men)\r\n",
      "[Stan Lee] (singing) Excelsior. (Natasha is pouring a drink behind the bar when Banner walks up to her)\r\n",
      "[Bruce Banner] How did a nice girl like you wind up working in a dump like this?\r\n",
      "[Natasha Romanoff] Fella done me wrong.\r\n",
      "[Bruce Banner] You got a lousy taste in men, kid.\r\n",
      "[Natasha Romanoff] He's not so bad. Well, he has a temper. Deep down he's all fluff. Fact is, he's not like anybody I've ever known. All my friends are fighters. And here comes this guy, spends his life avoiding the fight because he knows he'll win.\r\n",
      "[Bruce Banner] Sounds amazing.\r\n",
      "[Natasha Romanoff] He's also a huge dork. (Banner looks embarrassed) Chicks dig that. So what do you think should I fight this, or run with it?\r\n",
      "[Bruce Banner] Run with it, right? Or, did he...was he...? What did he do that was so wrong to you?\r\n",
      "[Natasha Romanoff] Not a damn thing. But never say never. (Natasha walks away)\r\n",
      "[Steve Rogers] It's nice.\r\n",
      "[Bruce Banner] What, what, what is?\r\n",
      "[Steve Rogers] You and Romanoff.\r\n",
      "[Bruce Banner] No, we haven't. That wasn't...\r\n",
      "[Steve Rogers] It's okay. Nobody's breaking any by-laws. It's just, she's not the most... open person in the world. But with you she seems very relaxed.\r\n",
      "[Bruce Banner] No, Natasha, she...she likes to flirt.\r\n",
      "[Steve Rogers] I've seen her flirt, up close. This ain't that. Look, as maybe the world's leading authority on \"waiting too long\", don't. You both deserve a win. (Steve walks off)\r\n",
      "[Bruce Banner] Wait, what do you mean, \"up close\"?\r\n",
      "[Clint Barton] (referring to Thor's hammer) But, it's a trick!\r\n",
      "[Thor] Oh, no. It's much more than that.\r\n",
      "[Clint Barton] Uh, \"Whosoever be he worthy shall haveth the power!\" Whatever man! It's a trick.\r\n",
      "[Thor] Well please, be my guest.\r\n",
      "[Tony Stark] Come on.\r\n",
      "[Clint Barton] Really?\r\n",
      "[Thor] Yeah! (Barton gets up)\r\n",
      "[James Rhodes] Oh this is gonna be beautiful.\r\n",
      "[Tony Stark] Clint, you've had a tough week, we won't hold it against you if you can't get it up. (the others laugh)\r\n",
      "[Clint Barton] You know I've seen this before, right? (Barton grabs Thor's hammer and can't lift it) (to Thor after he fails to lift the hammer) I still don't know how you do it.\r\n",
      "[Tony Stark] Smell the silent judgment?\r\n",
      "[Clint Barton] Please, Stark, by all means. (Stark gets up)\r\n",
      "[Natasha Romanoff] Oh, here we go.\r\n",
      "[Maria Hill] Okay.\r\n",
      "[James Rhodes] Uh-oh.\r\n",
      "[Clint Barton] Um-hmm.\r\n",
      "[Tony Stark] Never one to shrink from an honest challenge.\r\n",
      "[Clint Barton] Get after it.\r\n",
      "[Natasha Romanoff] Here we go.\r\n",
      "[Tony Stark] It's physics.\r\n",
      "[Bruce Banner] Physics! (Stark grasps Thor's hammer)\r\n",
      "[Tony Stark] Right, so, if I lift it, I...I then rule Asgard?\r\n",
      "[Thor] Yes, of course.\r\n",
      "[Tony Stark] I will be re-instituting Prima Nocta. (Stark tries to lift the hammer but fails) I'll be right back. (wearing his armored hand, Stark tries to lift the hammer again and fails) (wearing their armored hands, Stark and Rhodes both try to lift Thor's hammer)\r\n",
      "[James Rhodes] Are you even pulling?\r\n",
      "[Tony Stark] Are you on my team?\r\n",
      "[James Rhodes] Just represent! Pull!\r\n",
      "[Tony Stark] Alright, let's go! (they both pull as hard as they can) (Banner tries to lift the hammer, he roars trying to change to the Hulk but fails, and everyone but Natasha stares at him warily. Natasha grins)\r\n",
      "[Bruce Banner] Huh? (next Steve gets up to try)\r\n",
      "[Tony Stark] Let's go, Steve, no pressure.\r\n",
      "[James Rhodes] Come on, Cap. (Steve starts pulling on the hammer and manages to budge it a little; Thor looks a little alarmed. Steve still fails to lift it; Thor laughs with relief)\r\n",
      "[Thor] Nothing.\r\n",
      "[Tony Stark] And?\r\n",
      "[Bruce Banner] Widow?\r\n",
      "[Natasha Romanoff] Oh, no no. That's not a question I need answered.\r\n",
      "[Tony Stark] All deference to the man who wouldn't be king, but it's rigged.\r\n",
      "[Clint Barton] You bet your ass.\r\n",
      "[Maria Hill] Steve, he said a bad language word.\r\n",
      "[Steve Rogers] (to Stark) Did you tell everyone about that?\r\n",
      "[Tony Stark] The handle's imprinted, right? Like a security code. \"Whosoever is carrying Thor's fingerprints\" is, I think, the literal translation?\r\n",
      "[Thor] Yes, well that's, uh, that's a very, very interesting theory. I have a simpler one. (he gets up and lifts his hammer and flips it) You're all not worthy. (there's a chorus of disagreement from the others) (there's a loud screeching noise, causing everyone to cover their ears. They let their hands down as it fades. Ultron shows up)\r\n",
      "[Ultron] Worthy... No... How could you be worthy? You're all killers.\r\n",
      "[Steve Rogers] Stark.\r\n",
      "[Tony Stark] JARVIS.\r\n",
      "[Ultron] I'm sorry, I was asleep. Or...I was a-dream?\r\n",
      "[Tony Stark] (tapping his device) Reboot, Legionnaire OS, we got a buggy suit.\r\n",
      "[Ultron] There was a terrible noise...and I was tangled in... in...strings. I had to kill the other guy. He was a good guy.\r\n",
      "[Steve Rogers] You killed someone?\r\n",
      "[Ultron] Wouldn't have been my first call. But, down in the real world we're faced with ugly choices.\r\n",
      "[Thor] Who sent you?\r\n",
      "[Ultron] (Ultron replays Tony's voice) \"I see a suit of armor around the world\".\r\n",
      "[Bruce Banner] Ultron!\r\n",
      "[Ultron] In the flesh. Or, no, not yet. Not this...chrysalis. But I'm ready. I'm on a mission.\r\n",
      "[Natasha Romanoff] What mission?\r\n",
      "[Ultron] Peace in our time. (suddenly the Iron Legion bots break smash through the walls and attack the team) (after landing on top of Natasha as the Iron Legions continue to attack them)\r\n",
      "[Bruce Banner] Sorry!\r\n",
      "[Natasha Romanoff] Don't turn green!\r\n",
      "[Bruce Banner] I won't! (they all fight against the Iron Legions and Ultron takes the scepter; to Banner)\r\n",
      "[Natasha Romanoff] Come!\r\n",
      "[Steve Rogers] Stark! (Stark is trying to shut down one of the Iron Legions)\r\n",
      "[Iron Legion] We are here to help.\r\n",
      "[Tony Stark] One sec, one sec!\r\n",
      "[Iron Legion] We are here to help. We are here to help... (Stark continues to try and shut down one of the Iron Legions) We are here to help. It's unsafe. It's unsafe. It's unsafe.\r\n",
      "[Tony Stark] No more. That's the one.\r\n",
      "[Iron Legion] It's unsafe. (he manages to shut down the Iron Legion, at the same time Barton throws Steve's shield at him)\r\n",
      "[Clint Barton] Cap! (Steve uses his shield to dismember the last Iron Legion)\r\n",
      "[Ultron] That was dramatic! I'm sorry, I know you mean well. You just didn't think it through. You want to protect the world, but you don't want it to change. How is humanity saved if it's not allowed to...evolve? (picks up one of the dismembered Iron Legions) With these? These puppets? There's only one path to peace: The Avengers' extinction. (suddenly Thor throws his hammer at Ultron and smashes him to pieces) (after Thor destroys his body, Ultron starts singing) I had strings, but now I'm free. There are no strings on me, no strings on me. (we see Ultron has uploaded his consciousness elsewhere) (in the lab)\r\n",
      "[Bruce Banner] All our work is gone. Ultron cleared out, used the internet as an escape hatch.\r\n",
      "[Steve Rogers] Ultron.\r\n",
      "[Natasha Romanoff] He's been in everything. Files, surveillance. Probably knows more about us than we know about each other.\r\n",
      "[James Rhodes] He's in your files, he's in the internet. What if he decides to access something a little more exciting?\r\n",
      "[Maria Hill] Nuclear codes.\r\n",
      "[James Rhodes] Nuclear codes. Look, we need to make some calls, assuming we still can.\r\n",
      "[Natasha Romanoff] Nukes? He said he wanted us dead.\r\n",
      "[Steve Rogers] He didn't say dead. He said extinct.\r\n",
      "[Clint Barton] He also said he killed somebody.\r\n",
      "[Maria Hill] But there wasn't anyone else in the building.\r\n",
      "[Tony Stark] Yes there was. (Stark bring up the now destroyed 3D image of JARVIS' consciousness)\r\n",
      "[Bruce Banner] This is insane.\r\n",
      "[Steve Rogers] JARVIS was the first line of defense. He would've shut Ultron down, it makes sense.\r\n",
      "[Bruce Banner] No, Ultron could've assimilated Jarvis. This isn't strategy, this is...rage. (suddenly, Thor grabs hold of Stark by his throat and holds him up)\r\n",
      "[Clint Barton] Woah, woah, woah! It's going around.\r\n",
      "[Tony Stark] (to Thor) Come on. Use your words, buddy.\r\n",
      "[Thor'] I have more than enough words to describe you, Stark.\r\n",
      "[Steve Rogers] Thor! The Legionnaire. (Thor lets go of Stark)\r\n",
      "[Thor] Trail went cold about a hundred miles out but it's headed north, and it has the scepter. Now we have to retrieve it, again.\r\n",
      "[Natasha Romanoff] The genie's out of that bottle. Clear and present is Ultron.\r\n",
      "[Dr. Helen Cho] I don't understand. You built this program. Why is it trying to kill us? (Stark starts laughing, Banner subtly shakes his head at him to get him to stop)\r\n",
      "[Thor] You think this is funny?\r\n",
      "[Tony Stark] No. It's probably not, right? Is this very terrible? Is it so...is it so...it is. It's so terrible.\r\n",
      "[Thor] This could've been avoided if you hadn't played with something you don't understand.\r\n",
      "[Tony Stark] No, I'm sorry. I'm sorry. It is funny. It's a hoot that you don't get why we need this.\r\n",
      "[Bruce Banner] Tony, maybe this might not be the time to...\r\n",
      "[Tony Stark] Really?! That's it? You just roll over, show your belly, every time somebody snarls.\r\n",
      "[Bruce Banner] Only when I've created a murder bot.\r\n",
      "[Tony Stark] We didn't. We weren't even close. Were we close to an interface?\r\n",
      "[Steve Rogers] Well, you did something right. And you did it right here. The Avengers were supposed to be different than SHIELD.\r\n",
      "[Tony Stark] Anybody remember when I carried a nuke through a wormhole?\r\n",
      "[James Rhodes] No, it's never come up.\r\n",
      "[Tony Stark] Saved New York?\r\n",
      "[James Rhodes] Never heard that.\r\n",
      "[Tony Stark] Recall that? A hostile alien army came charging through a hole in space. We're standing three hundred feet below it. We're the Avengers. We can bust arms dealers all the live long day, but, that up there? That's...that's the end game. How were you guys planning on beating that?\r\n",
      "[Steve Rogers] Together.\r\n",
      "[Tony Stark] We'll lose.\r\n",
      "[Steve Rogers] Then we'll do that together, too. (Stark looks at him for a moment before turning away) Thor's right. Ultron's calling us out. And I'd like to find him before he's ready for us. The world's a big place. Let's start making it smaller. (The twins meet with Ultron in an empty building)\r\n",
      "[Wanda Maximoff] Talk. And if you are wasting our time...\r\n",
      "[Ultron] Did you know this church is in the exact center of the city? The elders decreed it so that everyone could be equally close to God. I like that. The geometry of belief. (Ultron is sat in a chair faced away from them) You're wondering why you can't look inside my head.\r\n",
      "[Wanda Maximoff] Sometimes it's hard. But sooner or later, every man shows himself. (Ultron stands and faces them revealing his new body. Wanda briefly looks shocked)\r\n",
      "[Ultron] Oh, I'm sure they do. But you needed something more than a man. That's why you let Stark take the scepter.\r\n",
      "[Wanda Maximoff] I didn't expect. But I saw Stark's fear, I knew it would control him, make him self-destruct.\r\n",
      "[Ultron] Everyone creates the thing they dread. Men of peace create engines of war, invaders create avengers, people create...smaller people? Uh...children! I lost the word there. Children. Designed to supplant them, to help them...end.\r\n",
      "[Wanda Maximoff] Is that why you've come? To end the Avengers?\r\n",
      "[Ultron] I've come to save the world. But also, yeah. We'll move out right away. This is a start, but there's something we need to begin the real work.\r\n",
      "[Wanda Maximoff] (referring to Ultron's bots) All of these are... All of these are...\r\n",
      "[Ultron] Me. I have what the Avengers never will. Harmony. They're discordant, disconnected. Stark's already got them turning on each other. And when you get inside the rest of their heads...\r\n",
      "[Pietro Maximoff] Everyone's plan is not to kill them.\r\n",
      "[Ultron] And make them martyrs? You need patience. Need to see the big picture.\r\n",
      "[Pietro Maximoff] I don't see the big picture, I have a little picture. I take it out and look at it every day.\r\n",
      "[Ultron] You lost your parents in the bombings. I've seen the records.\r\n",
      "[Pietro Maximoff] The records are not the picture.\r\n",
      "[Wanda Maximoff] Pietro.\r\n",
      "[Ultron] No, please.\r\n",
      "[Pietro Maximoff] We were ten years old, having dinner, the four of us. When the first shell hits, two floors below, it makes a hole in the floor. It's big. Our parents go in, and the whole building starts coming apart. I grab her, roll under the bed and the second shell hits. But, it doesn't go off. It just...sits there in the rubble, three feet from our faces. And on the side of the shell is painted one word...\r\n",
      "[Wanda Maximoff] Stark.\r\n",
      "[Pietro Maximoff] We were trapped two days.\r\n",
      "[Wanda Maximoff] Every effort to save us, every shift in the bricks, I think, \"This will set it off.\" We wait for two days for Tony Stark to kill us.\r\n",
      "[Pietro Maximoff] I know what they are.\r\n",
      "[Ultron] I wondered why only you two survived Strucker's experiments. Now I don't. We will make it right. You and I can hurt them. (to Wanda) But you will tear them apart, from the inside. (back at the Avengers headquarters)\r\n",
      "[Maria Hill] He's all over the globe. Robotics labs, weapons facilities, jet propulsion labs, reports of a metal man, or men, coming in and emptying the place.\r\n",
      "[Steve Rogers] Fatalities?\r\n",
      "[Maria Hill] Only when engaged. Mostly guys left in a fugue state going on about old memories, worst fears, and something too fast to see.\r\n",
      "[Steve Rogers] Maximoffs. Well, that makes sense he'd go to them, they have someone in common.\r\n",
      "[Maria Hill] Not anymore. (she hands Steve a tablet showing photo of Strucker's dead body with the word PEACE written in blood on the wall next to him)\r\n",
      "[Clint Barton] (Barton's talking on his cell phone) That's a negative. I answer to you. Yes, ma'am. (Steve interrupts him)\r\n",
      "[Steve Rogers] Barton, we might have something.\r\n",
      "[Clint Barton] Gotta go.\r\n",
      "[Steve Rogers] Who was that?\r\n",
      "[Clint Barton] Girlfriend. (after Steve has gathered the rest of the team he shows them the photo of Strucker's body)\r\n",
      "[Tony Stark] What's this?\r\n",
      "[Steve Rogers] A message. Ultron killed Strucker.\r\n",
      "[Tony Stark] And he did a Banksy at the crime scene, just for us.\r\n",
      "[Natasha Romanoff] This is a smokescreen. Why send a message when you've just given a speech?\r\n",
      "[Steve Rogers] Strucker knew something that Ultron wanted us to miss.\r\n",
      "[Natasha Romanoff] Yeah, I bet he... (looks at the computer monitor) Yep. Everything we had on Strucker has been erased.\r\n",
      "[Tony Stark] Not everything. (the team go through the physical files they have on Strucker)\r\n",
      "[Steve Rogers] Known associates. Well, Strucker had a lot of friends.\r\n",
      "[Bruce Banner] Well, these people are all horrible.\r\n",
      "[Tony Stark] Wait. I know that guy. (Banner passes him the photo he was looking at) From back in the day. He operates off the African coast, black market arms. (Steve gives him an accusing look) There are conventions, alright? You meet people, I didn't sell him anything. (we see the photo is of a man named Ulysses Klaue) He was talking about finding something new, a game changer, it was all very \"Ahab.\"\r\n",
      "[Thor] (Thor points to the scar on the back of Klaue's neck) This.\r\n",
      "[Tony Stark] Uh, it's a tattoo. I don't think he had it...\r\n",
      "[Thor] No, those are tattoos, this is a brand. (Banner identifies the brand on Klaue's neck on the computer)\r\n",
      "[Bruce Banner] Oh, yeah. It's a word in an African dialect meaning thief, in a much less friendly way.\r\n",
      "[Steve Rogers] What dialect?\r\n",
      "[Bruce Banner] Wakanada...? Wa...Wa...Wakanda.\r\n",
      "[Tony Stark] If this guy got out of Wakanda with some of their trade goods...\r\n",
      "[Steve Rogers] I thought your father said he got the last of it?\r\n",
      "[Bruce Banner] I don't follow. What comes out of Wakanda? (looking at Steve's shield)\r\n",
      "[Tony Stark] The strongest metal on earth.\r\n",
      "[Steve Rogers] (to Stark) Where is this guy now? (Salvage Yard, African Coast; talking on the phone in his office)\r\n",
      "[Ulysses Klaue] Don't tell me your man swindled you. I sent you six short range heat seekers and got a boat full of rusted parts. Now, you will make it right, or the next missile I send you will come very much faster. (he ends the call and connects to another call) Now, minister, where were we? (suddenly the lights go out causing a commotion in the salvage yard and the twins enter Klaue's office) Yeah. The enhanced. Strucker's prize pupils. (picks up a plate from his desk) Want a candy? Oh, sorry to hear about Strucker. But then, he knew what kind of world he was helping create. Human life, not a growth market. (the twins look at each other) You...you didn't know? Is this your first time intimidating someone? I'm afraid that I'm not that afraid.\r\n",
      "[Wanda Maximoff] Everybody's afraid of something.\r\n",
      "[Ulysses Klaue] Cuttlefish. Deep sea fish. They make lights. disco lights. Whoom, whoom, whoom! to hypnotize their prey, then whoom! I saw a documentary, it was terrifying. (Pietro speeds over to pick up a candy from Klaue's desk, and Klaue jerks back, expecting to be attacked) So if you're going to fiddle with my brain, and make me see a giant cuttlefish, then I know you don't do business, and I know you're not in charge, and I only deal with the man in charge. (suddenly Ultron breaks through the glass window and knocks down Klaue)\r\n",
      "[Ultron] There is no \"man\" in charge. Let's talk business. (Klaue gives Ultron some vibranium from his stash) Upon this rock I will build my church. Vibranium.\r\n",
      "[Ulysses Klaue] You know, it came at great personal cost. It's worth billions. (Ultron chuckles and remotely puts money in Klaue's bank account)\r\n",
      "[Ultron] Now, so are you. It's all under your dummy holdings? Finance is so weird. But I always say, \"Keep your friends rich and your enemies rich, and wait to find out which is which.\"\r\n",
      "[Ulysses Klaue] Stark.\r\n",
      "[Ultron] What?\r\n",
      "[Ulysses Klaue] Tony Stark used to say that...to me. You're one of his.\r\n",
      "[Ultron] What?! I'm not...! (he grabs Klaue) I'm not. You think I'm one of Stark's puppets, his hollow men? I mean look at me, do I look like Iron Man? Stark is nothing! (suddenly he chops off Klaue's arm) I'm sorry. I am sor... Ooh, I'm sure that's going to be okay. I'm sorry, it's just I don't understand. Don't compare me with Stark! he's a sickness! (Stark appears in his Iron Man suit)\r\n",
      "[Tony Stark] Ahh, Junior. (Thor and Steve are behind him) You're gonna break your old man's heart.\r\n",
      "[Ultron] If I have to.\r\n",
      "[Thor] We don't have to break anything.\r\n",
      "[Ultron] Clearly you've never made an omelet.\r\n",
      "[Tony Stark] He beat me by one second.\r\n",
      "[Pietro Maximoff] Ah, this is funny, Mr. Stark. It's what, comfortable? Like old times?\r\n",
      "[Tony Stark] This was never my life.\r\n",
      "[Steve Rogers] (to the twins) You two can still walk away from this.\r\n",
      "[Wanda Maximoff] Oh, we will.\r\n",
      "[Steve Rogers] I know you've suffered.\r\n",
      "[Ultron] Uuughh! Captain America. God's righteous man, pretending you could live without a war. I can't physically throw up in my mouth, but...\r\n",
      "[Thor] If you believe in peace, then let us keep it.\r\n",
      "[Ultron] I think you're confusing peace with quiet.\r\n",
      "[Tony Stark] Yuh-huh. What's the Vibranium for?\r\n",
      "[Ultron] I'm glad you asked that, because I wanted to take this time to explain my evil plan! (suddenly the Iron Legions attack Stark, Steve and Thor; Stark then attacks Ultron) (as Ultron, his Iron Legions and the twins are fighting with Stark, Steve and Thor)\r\n",
      "[Ulysses Klaue] Shoot them!\r\n",
      "[Klaue's Mercenary] Which ones?\r\n",
      "[Ulysses Klaue] All of them!\r\n",
      "[Klaue's Mercenary] (to his men) Move, move, move! (the rest of the team, including Natasha and Barton now battle it out with the Iron Legions, Klaue's men and the twins as Stark fight with Ultron)\r\n",
      "[Steve Rogers] (after knocking down Pietro) Stay down, kid!\r\n",
      "[Ultron] (to Wanda) It's time for some mind games. (Banner hears the commotion as he waits in the Quinjet)\r\n",
      "[Bruce Banner] Guys, is this a Code Green? (Wanda uses her power on Thor then Steve comes up to him)\r\n",
      "[Steve Rogers] Thor! Status?\r\n",
      "[Thor] The girl tried to warp my mind. Take special care, I doubt a human could keep her at bay. Fortunately, I am mighty. (just then Thor seems himself at a party on Asgard) (Wanda then uses her power on Steve and Natasha)\r\n",
      "[Ultron] This is going very well. (Wanda tries to sneak up behind Barton, but he quickly turns and puts an electric arrow on her forehead)\r\n",
      "[Clint Barton] I've done the whole mind control thing. Not a fan. (just then Pietro speeds in, knocks down Barton, picks up Wanda and speeds off) Yeah, you better run. (we see Steve dropping his helmet and walking off; to the team) Whoever's standing, we gotta move! Guys? (Natasha sees herself in the facility where young girls are being taught ballet)\r\n",
      "[Ballet Instructor] (to the students) Again.\r\n",
      "[Natasha Romanoff] You'll break them.\r\n",
      "[Madame B] Only the breakable ones. You are made of marble. We'll celebrate after the graduation ceremony.\r\n",
      "[Natasha Romanoff] What if I fail? (we see a younger Natasha being trained to be an assassin)\r\n",
      "[Madame B] You never fail. (Steve sees himself in a 1940's dance hall when Peggy Carter comes up to him)\r\n",
      "[Peggy Carter] Are you ready for our dance? (back to Thor's vision in Asgard, he spots someone walking in a black cloak when Heimdall comes up to him his eyes blind and unseeing)\r\n",
      "[Heimdall] Is it him? Is that the first son of Odin?\r\n",
      "[Thor] Heimdall, your eyes?!\r\n",
      "[Heimdall] Oh, they see everything. They see you leading us to Hel. Wake up! (he then starts to strangle Thor) (back to Steve's vision with Peggy in the dance hall)\r\n",
      "[Peggy Carter] The war's over, Steve. We can go home. Imagine it! (suddenly the dance hall is empty, then Steve sees himself dancing with Peggy)\r\n",
      "[Thor] I can still save you.\r\n",
      "[Heimdall] We are all dead. Can you not see? (Thor pushes Heimdall from him) You're a destroyer, Odinson. See where your power leads. (Electricity hits Thor and spikes around the room, destroying things) (back to Natasha's vision where is she being trained by Madame B to be an assassin)\r\n",
      "[Madame B] Sloppy. Pretending to fail. The ceremony is necessary for you to take your place in the world.\r\n",
      "[Natasha Romanoff] I have no place in the world.\r\n",
      "[Madame B] Exactly. (as Wanda suffers in pain from the electric arrow Barton had hit her with)\r\n",
      "[Pietro Maximoff] What can I do?\r\n",
      "[Wanda Maximoff] Ah, it hurts.\r\n",
      "[Pietro Maximoff] I'm gonna kill him. I'll be right back.\r\n",
      "[Wanda Maximoff] No. I'm over it. I want...I want to finish the plan. (looking at the Quinjet where Banner is waiting) I want the big one. (after Stark corners Ultron)\r\n",
      "[Ultron] Ah, the Vibranium's getting away.\r\n",
      "[Tony Stark] And you're not going anywhere.\r\n",
      "[Ultron] Of course not, I'm already there. You'll catch on. But first, you might need to catch Dr. Banner. (Stark angrily shoots Ultron and flies off to find Banner who's turned in to the Hulk and ready to wreak havoc on the nearest city)\r\n",
      "[Tony Stark] News or footage, keyword: Hulk. (he sees news footage of Hulk destroying the city) Natasha, I could really use a lullaby. (Barton is sat with Natasha who's still stuck in her vision)\r\n",
      "[Clint Barton] Well, that's not gonna happen. Not for a while. The whole team is down, you got no back up here.\r\n",
      "[Tony Stark] I'm calling in VERONICA. (as Hulk is wreaking havoc on the nearest city Stark Tony comes brings out his Hulkbuster armor to stop him) Alright everybody, stand down! (to Hulk) You listening? That little witch is messing with your mind. You're stronger than her, you're smarter than her, you're Bruce Banner. (Hulk roars in anger) Right, right, right! Don't mention puny Banner. (Hulk throws a car at Stark and attacks him) Okay. (they start fighting and throwing each other around) In the back? Dick move, Banner. (they battle it out more but Stark is struggling to beat Hulk) VERONICA, gimme a hand. (as Hulk destroyed one of Stark's armor arms VERONICA sends in a new Hulkbuster armor arm and Stark uses it to repeatedly punch Hulk) Go to sleep, go to sleep, go to sleep! (picking up Hulk) Okay, pal, we're gonna get you out of town. (as they head towards a building) No, not that way, not that way! (they crash through the building) Come on, Bruce! You gotta work with me! (Hulk continues to battle with him) (to the people in the building) Everybody out! Going to get ugly! (after he knocks down Hulk) I'm sorry. (Hulk attacks Stark and pulls out parts of the Hulkbuster armor) Damage report. (the damaged computer buzzes a reply) That's comprehensive. Show me something. (the computer shows him the building ahead is clear of civilians) How quickly can we buy this building? (Stark drops Hulk through the building completely destroying it; at the same time the army arrives to intervene, as Hulk comes out of Wanda's mind-hold Stark knocks him out cold) (with Banner back to normal and everybody back on the Quinjet)\r\n",
      "[Maria Hill] The news is loving you guys. Nobody else is. There's been no official call for Banner's arrest, but it's in the air.\r\n",
      "[Tony Stark] Stark Relief Foundation?\r\n",
      "[Maria Hill] Already on the scene. How's the team?\r\n",
      "[Tony Stark] Everyone's...we took a hit. We'll shake it off.\r\n",
      "[Maria Hill] Well for now I'd stay in stealth mode, and stay away from here.\r\n",
      "[Tony Stark] So, run and hide?\r\n",
      "[Maria Hill] Until we can find Ultron, I don't have a lot else to offer.\r\n",
      "[Tony Stark] Neither do we. (he switches off the monitor showing Maria ending the call) (to Barton, who's flying the Quinjet) Hey, you wanna switch out?\r\n",
      "[Clint Barton] No, I'm good. If you wanna get some kip, now's a good time, cause we're still a few hours out.\r\n",
      "[Tony Stark] A few hours from where?\r\n",
      "[Clint Barton] A safe house. (the Quinjet lands outside a large farmhouse and they all walk towards the house)\r\n",
      "[Thor] What is this place?\r\n",
      "[Tony Stark] A safe house?\r\n",
      "[Clint Barton] Let's hope. (they all enter the house) Honey, I'm home. (Barton's heavily pregnant wife, Laura, walks in from the kitchen)\r\n",
      "[Clint Barton] Hi. Company. Sorry I didn't call ahead.\r\n",
      "[Laura Barton] Hey.\r\n",
      "[Tony Stark] (Laura kisses Barton; to Thor) This is an agent of some kind.\r\n",
      "[Clint Barton] (introducing his wife to the team) Gentleman, this is Laura.\r\n",
      "[Laura Barton] I know all your names. (they all look at her awkwardly)\r\n",
      "[Clint Barton] Ooh, incoming. (Barton's son Cooper and daughter Lila run in)\r\n",
      "[Barton's Daughter] Dad! (Barton picks up his daughter)\r\n",
      "[Clint Barton] I see her! (kissing the top his son's head) Hey, buddy! How you guys doing? Ooh...\r\n",
      "[Tony Stark] (to the others as they watch with surprise) These are...smaller agents.\r\n",
      "[Clint Barton] Look at your face! Oh, my goodness!\r\n",
      "[Lila Barton] Did you bring Auntie Nat?\r\n",
      "[Natasha Romanoff] Why don't you hug her and find out? (Lila rushes towards Natasha who picks her up in her arms)\r\n",
      "[Steve Rogers] Sorry for barging in on you.\r\n",
      "[Tony Stark] Yeah, we would have called ahead, but we were busy having no idea that you existed.\r\n",
      "[Clint Barton] Yeah, well Fury helped me set this up when I joined. He kept it off SHIELD's files, I'd like to keep it that way. I figure it's a good place to lay low.\r\n",
      "[Laura Barton] Honey. Ah, I missed you.\r\n",
      "[Natasha Romanoff] (touching Laura's stomach) How's little Natasha, huh?\r\n",
      "[Laura Barton] She's…Nathaniel. (Natasha bends towards Laura's pregnant stomach)\r\n",
      "[Natasha Romanoff] Traitor. (the hallucinations brought on by Wanda continue to creep up in Thor's mind and he walks out of the house)\r\n",
      "[Steve Rogers] Thor.\r\n",
      "[Thor] I saw something in that dream. I need answers, I won't find them here. (Thor uses his hammer to fly out of there; Steve turns to enter the house when he hears Peggy's voice from Wanda's vision)\r\n",
      "[Peggy Carter] We can go home. (Laura checks Barton's wound that Pietro had give him)\r\n",
      "[Clint Barton] See, you worried for nothing. Can't even feel the difference, can you?\r\n",
      "[Laura Barton] If they're sleeping here, some of them are gonna have to double up. (Barton laughs)\r\n",
      "[Clint Barton] Yeah, that's not gonna sell.\r\n",
      "[Laura Barton] What about Nat and Dr. Banner? How long has that been going on?\r\n",
      "[Clint Barton] Has what? (Laura laughs)\r\n",
      "[Laura Barton] You are so cute.\r\n",
      "[Clint Barton] Nat and...and Banner?\r\n",
      "[Laura Barton] I'll explain when you're older, Hawkeye.\r\n",
      "[Clint Barton] Oh. Okay.\r\n",
      "[Laura Barton] It's bad, right? Nat seems really shaken.\r\n",
      "[Clint Barton] Ultron has these allies, these uh, kids, they're punks really. They carry a big damn stick and Nat took a serious hit. Someone's gonna have to teach 'em some manners.\r\n",
      "[Laura Barton] And that someone be you. You know I totally support your Avenging, I couldn't be prouder. But I see those guys, those \"Gods\"...\r\n",
      "[Clint Barton] You don't think they need me.\r\n",
      "[Laura Barton] I think they do. Which is a lot scarier. They're a mess.\r\n",
      "[Clint Barton] Yeah. I guess they're my mess.\r\n",
      "[Laura Barton] You need to be sure that this team is really a team and that they have your back. Things are changing for us. In a few months time, you and me are gonna be outnumbered. I need...just be sure.\r\n",
      "[Clint Barton] Yes, ma'am. (he kisses her, then as Laura places her arm around his waist she touches his wounded side)\r\n",
      "[Laura Barton] I can feel the difference. (U-Gin Genetic Research Lab, Seoul, Korea - as Cho enters her lab she sees Ultron)\r\n",
      "[Ultron] Scream, and your entire staff dies. I could've killed you, Helen, the night we met. I didn't.\r\n",
      "[Dr. Helen Cho] Do you expect a thank you note?\r\n",
      "[Ultron] I expect you to know why.\r\n",
      "[Dr. Helen Cho] The Cradle. (she hears her own recorded voice) \"This is the next thing, Tony.\"\r\n",
      "[Ultron] This...is the next me.\r\n",
      "[Dr. Helen Cho] The regeneration cradle prints tissue, it can't build a living body.\r\n",
      "[Ultron] It can, you can. You lack the materials. You're a brilliant woman, Helen. But we all have room to improve. (Ultron uses the scepter to mind-control Cho) (at Barton's house, Natasha and Banner are still experiencing the after effects of Wanda's hallucinations; Banner walks out of the bathroom and sees Natasha waiting outside)\r\n",
      "[Bruce Banner] I didn't realize you were waiting.\r\n",
      "[Natasha Romanoff] I would've joined you, but uh, it didn't seem like the right time.\r\n",
      "[Bruce Banner] They used up all the hot water.\r\n",
      "[Natasha Romanoff] I should've joined you.\r\n",
      "[Bruce Banner] Missed our window.\r\n",
      "[Natasha Romanoff] Did we?\r\n",
      "[Bruce Banner] The world just saw the Hulk. The real Hulk, for the first time. You know I have to leave.\r\n",
      "[Natasha Romanoff] But you assume that I have to stay? I had this, um, dream. The kind that seems normal at the time, but when you wake...\r\n",
      "[Bruce Banner] What did you dream?\r\n",
      "[Natasha Romanoff] That I was an Avenger. That I was anything more than the assassin they made me.\r\n",
      "[Bruce Banner] I think you're being hard on yourself.\r\n",
      "[Natasha Romanoff] Here I was hoping that was your job. (she leans close into him)\r\n",
      "[Bruce Banner] What are you doing?\r\n",
      "[Natasha Romanoff] I'm running with it, with you. If running's the plan, as far as you want.\r\n",
      "[Bruce Banner] Are you out of your mind? (Banner turns away from her)\r\n",
      "[Natasha Romanoff] I want you to understand that I'm...\r\n",
      "[Bruce Banner] Natasha, where can I go? Where in the world am I not a threat?\r\n",
      "[Natasha Romanoff] You're not a threat to me.\r\n",
      "[Bruce Banner] You sure? Even if I didn't just...there's no future with me. I can't ever...I can't have this, kids, do the math, I physically can't.\r\n",
      "[Natasha Romanoff] Neither can I. In the Red Room, where I was trained, where I was raised, um, they have a graduation ceremony. They sterilize you. It's efficient. One less thing to worry about. The one thing that might matter more than a mission. It makes everything easier. Even killing. (she hesitates a moment) You still think you're the only monster on the team?\r\n",
      "[Bruce Banner] What, so we disappear? (Steve and Stark are chopping wood outside Barton's house)\r\n",
      "[Tony Stark] Thor didn't say where he was going for answers?\r\n",
      "[Steve Rogers] Sometimes my teammates don't tell me things. I was kind of hoping Thor would be the exception.\r\n",
      "[Tony Stark] Yeah, give him time. We don't know what the Maximoff kid showed him.\r\n",
      "[Steve Rogers] \"Earth's Mightiest Heroes.\" Pulled us apart like cotton candy.\r\n",
      "[Tony Stark] Seems like you walked away all right.\r\n",
      "[Steve Rogers] Is that a problem?\r\n",
      "[Tony Stark] I don't trust a guy without a dark side. Call me old fashioned.\r\n",
      "[Steve Rogers] Well let's just say you haven't seen it yet.\r\n",
      "[Tony Stark] You know Ultron is trying to tear us apart, right?\r\n",
      "[Steve Rogers] Well I guess you'd know. Whether you tell us is a bit of a question.\r\n",
      "[Tony Stark] Banner and I were doing research.\r\n",
      "[Steve Rogers] That would affect the team.\r\n",
      "[Tony Stark] That would end the team. Isn't that the mission? Isn't that the \"why\" we fight, so we can end the fight, so we get to go home?\r\n",
      "[Steve Rogers] Every time someone tries to win a war before it starts, innocent people die. Every time. (Laura interrupts them)\r\n",
      "[Laura Barton] I'm sorry. Mr. Stark, uh, Clint said you wouldn't mind, but, our tractor, it doesn't seem to want to start at all. I thought maybe you might...\r\n",
      "[Tony Stark] Yeah, I'll give her a kick. (to Steve as he turns to leave; referring to his pile of chopped wood) Don't take from my pile. (Stark enters the barn and walks over to the tractor) Hello, Deere. Tell me everything. What ails you? (suddenly Fury shows up from the other end of the barn)\r\n",
      "[Nick Fury] Do me a favor. Try not to bring it to life.\r\n",
      "[Tony Stark] Ah, Mrs. Barton, you little minx. I get it, Maria Hill called you, right? Was she ever not working for you?\r\n",
      "[Nick Fury] Artificial intelligence. You never even hesitated.\r\n",
      "[Tony Stark] Look, it's been a really long day, like, Eugene O'Neill long, so how's about we skip to the part where you're useful?\r\n",
      "[Nick Fury] Look me in the eye and tell me you're going to shut him down.\r\n",
      "[Tony Stark] You're not the director of me.\r\n",
      "[Nick Fury] I'm not the director of anybody. I'm just an old man, who cares very much about you.\r\n",
      "[Tony Stark] And I'm the man who killed the Avengers. I saw it. I didn't tell the team, how could I? I saw them all dead, Nick. I felt it. The whole world, too. It's because of me. I wasn't ready. I didn't do all I could.\r\n",
      "[Nick Fury] The Maximoff girl, she's working you, Stark. Playing on your fear.\r\n",
      "[Tony Stark] I wasn't tricked, I was shown. It wasn't a nightmare, it was my legacy. The end of the path I started us on.\r\n",
      "[Nick Fury] You've come up with some pretty impressive inventions, Tony. War isn't one of them.\r\n",
      "[Tony Stark] I watched my friends die. You'd think that'd be as bad as it gets, right? Nope. Wasn't the worst part.\r\n",
      "[Nick Fury] The worst part is that you didn't. (Royal Holloway, University of London - Thor, dressed in casual clothes, waits for Selvig as he leaves the building)\r\n",
      "[Erik Selvig] I like the look. If you're going for inconspicuous, though, near miss.\r\n",
      "[Thor] I need your help.\r\n",
      "[Erik Selvig] It's nice to be needed.\r\n",
      "[Thor] It's dangerous.\r\n",
      "[Erik Selvig] I'd be disappointed if it wasn't. (back at Barton's house Fury meets with the rest of the team)\r\n",
      "[Nick Fury] Ultron took you folks out of play to buy himself time. My contacts all say he's building something. The amount of Vibranium he made off with, I don't think it's just one thing.\r\n",
      "[Steve Rogers] What about Ultron himself?\r\n",
      "[Nick Fury] Ah. He's easy to track, he's everywhere. Guy's multiplying faster than a Catholic rabbit. Still doesn't help us get an angle on any of his plans though.\r\n",
      "[Tony Stark] He still going after launch codes?\r\n",
      "[Nick Fury] Yes, he is, but he's not making any headway.\r\n",
      "[Tony Stark] I cracked the Pentagon's firewall in high school on a dare.\r\n",
      "[Nick Fury] Yeah, well, I contacted our friends at the NEXUS about that.\r\n",
      "[Steve Rogers] NEXUS?\r\n",
      "[Bruce Banner] It's the world internet hub in Oslo, every byte of data flows through there, fastest access on earth.\r\n",
      "[Clint Barton] So what'd they say?\r\n",
      "[Nick Fury] He's fixated on the missiles, but the codes are constantly being changed.\r\n",
      "[Tony Stark] By whom?\r\n",
      "[Nick Fury] Parties unknown.\r\n",
      "[Natasha Romanoff] Do we have an ally?\r\n",
      "[Nick Fury] Ultron's got an enemy, that's not the same thing. Still, I'd pay folding money to know who it is.\r\n",
      "[Tony Stark] I might need to visit Oslo, find our \"unknown.\"\r\n",
      "[Natasha Romanoff] Well, this is good times, boss, but I was kind of hoping when I saw you, you'd have more than that.\r\n",
      "[Nick Fury] I do, I have you. Back in the day, I had eyes everywhere, ears everywhere else. Here we all are, back on earth, with nothing but our wit, and our will to save the world. So stand. Outwit the platinum bastard.\r\n",
      "[Natasha Romanoff] Steve doesn't like that kind of talk.\r\n",
      "[Steve Rogers] You know what, Romanoff? (Natasha smiles mischievously at him)\r\n",
      "[Nick Fury] So what does he want?\r\n",
      "[Steve Rogers] To become better. Better than us. He keeps building bodies.\r\n",
      "[Tony Stark] Person bodies. The human form is inefficient, biologically speaking, we're outmoded. But he keeps coming back to it.\r\n",
      "[Natasha Romanoff] When you two programmed him to protect the human race, you amazingly failed.\r\n",
      "[Bruce Banner] They don't need to be protected, they need to evolve. Ultron's going to evolve.\r\n",
      "[Nick Fury] How?\r\n",
      "[Bruce Banner] Has anyone been in contact with Helen Cho? (in Korea, Cho is creating a new body for Ultron)\r\n",
      "[Dr. Helen Cho] It's beautiful. The Vibranium atoms aren't just compatible with the tissue cells, they're binding them. And SHIELD never even thought...\r\n",
      "[Ultron] The most versatile substance on the planet and they used it to make a Frisbee. Typical of humans, they scratch the surface and never think to look within. (Ultron breaks open the scepter's blue gem and a yellow gem that was inside floats out and lands in his hand. He places it in the head of the body) (back at the Barton's farm)\r\n",
      "[Steve Rogers] I'll take Natasha and Clint.\r\n",
      "[Tony Stark] Alright, strictly recon. I'll hit the NEXUS, I'll join you as soon as I can.\r\n",
      "[Steve Rogers] If Ultron is really building a body...\r\n",
      "[Tony Stark] He'll be more powerful than any of us. Maybe all of us. An android designed by a robot.\r\n",
      "[Steve Rogers] You know I really miss the days when the weirdest thing science ever created was me.\r\n",
      "[Nick Fury] I'll drop Banner off at the tower. Do you mind if I borrow Ms. Hill?\r\n",
      "[Tony Stark] She's all yours, apparently. What are you gonna do?\r\n",
      "[Nick Fury] I don't know. Something dramatic, I hope.\r\n",
      "[Clint Barton] I'm gonna finish re-flooring that sunroom as soon as I get back.\r\n",
      "[Laura Barton] Yeah, and then you'll find another part of the house to tear apart.\r\n",
      "[Clint Barton] No. It's the last project. I promise. (he kisses her; later Laura watches them fly off in the Quinjet) (Thor and Selvig enter into a cave)\r\n",
      "[Erik Selvig] This is it. The Water of Sight.\r\n",
      "[Thor] In every realm, there's a reflection. If the water spirits accept me, I can return to my dream, and find what I missed.\r\n",
      "[Erik Selvig] The men who enter that water, the legends don't end well. (NEXUS Internet Hub, Oslo, Norway)\r\n",
      "[Tony Stark] A hacker who's faster than Ultron? He could be anywhere. And as this is the center of everything, I'm just a guy looking for a needle in the world's biggest haystack.\r\n",
      "[World Hub Tech] How do you find it?\r\n",
      "[Tony Stark] Pretty simple. You bring a magnet. (he starts playfully singing as he conducts his search) Oh, I'm decrypting nuclear codes and you don't want me to. Come and get me. (back at the cave with Thor and Selvig, Thor is now in the water and goes back in his vision with Heimdall)\r\n",
      "[Heimdall] Wake up! (Thor starts getting electric charges going through his body)\r\n",
      "[Erik Selvig] Thor!\r\n",
      "[Ultron] (he sees visions of Ultron) Extinction. (then he sees the creation of the Infinity Stones) (in Korea with Cho and Ultron)\r\n",
      "[Dr. Helen Cho] Cellular cohesion will take a few hours, but we can initiate the consciousness stream. We're uploading your cerebral matrix...now.\r\n",
      "[Wanda Maximoff] I can read him. He is dreaming.\r\n",
      "[Dr. Helen Cho] I wouldn't call it dreams. It's Ultron's base consciousness, informational noise. Soon...\r\n",
      "[Ultron] How soon? I'm not being pushy.\r\n",
      "[Dr. Helen Cho] We're imprinting a physical brain. There are no shortcuts. Even if your magic gem is... (Wanda, reading Ultron's mind, sees a vision of global annihilation, which horrifies her and she screams)\r\n",
      "[Wanda Maximoff] How could you?\r\n",
      "[Ultron] How could I what?\r\n",
      "[Wanda Maximoff] You said we would destroy the Avengers, make a better world.\r\n",
      "[Ultron] It will be better.\r\n",
      "[Wanda Maximoff] When everyone is dead.\r\n",
      "[Ultron] That is not...! The human race will have every opportunity to improve.\r\n",
      "[Pietro Maximoff] And if they don't?\r\n",
      "[Ultron] Ask Noah.\r\n",
      "[Wanda Maximoff] You're a madman.\r\n",
      "[Ultron] There were more than a dozen extinction level events before even the dinosaurs got theirs. When the Earth starts to settle, God throws a stone at it, and believe me, he's winding up. We have to evolve. There's no room for the weak.\r\n",
      "[Pietro Maximoff] And who decides who's weak? (as Ultron is distracted Wanda breaks the scepter's hold off of Cho)\r\n",
      "[Ultron] Life. Life always decides. There's incoming. The Quinjet. We have to move. (Cho cancels the upload to Ultron's consciousness)\r\n",
      "[Dr. Helen Cho] That's not a problem. (Ultron blasts Cho, Wanda and Pietro run off)\r\n",
      "[Ultron] Ah, wait, guys!. (he blasts Cho's technicians) They'll understand. When they see they'll understand. I just need a little more time. (unplugs himself from the Cradle)\r\n",
      "[Steve Rogers] (Steve is on U-Gin Genetic Research Lab roof; to the others) Two minutes. Stay close. (inside the lab Steve finds Cho wounded) Dr. Cho!\r\n",
      "[Dr. Helen Cho] He's uploading himself into the body.\r\n",
      "[Steve Rogers] Where?\r\n",
      "[Dr. Helen Cho] The real power is inside the Cradle. The gem, its power is uncontainable. You can't just blow it up. You have to get the Cradle to Stark.\r\n",
      "[Steve Rogers] First I have to find it.\r\n",
      "[Dr. Helen Cho] Go.\r\n",
      "[Steve Rogers] (on the Quinjet, listening to Steve on the radio comms) Did you guys copy that?\r\n",
      "[Clint Barton] We did.\r\n",
      "[Natasha Romanoff] I got a private jet taking off, across town, no manifest. That could be him.\r\n",
      "[Clint Barton] (noticing a truck leaving the lab) There. It's the truck from the lab. Right above you, Cap. On the loop by the bridge. It's them. I got three with the Cradle, one in the cab. I could take out the driver.\r\n",
      "[Steve Rogers] Negative! If that truck crashes, the gem could level the city. We need to draw out Ultron. (Steve jumps onto the roof of the truck)\r\n",
      "[Ultron] No, no, no, no, no. Leave me alone!\r\n",
      "[Steve Rogers] (Ultron blasts the truck door as Steve tries to enter) Well, he's definitely unhappy! I'm gonna try and keep him that way.\r\n",
      "[Clint Barton] You're not a match for him, Cap.\r\n",
      "[Steve Rogers] Thanks, Barton. (Ultron blasts Steve as he tries to enter the truck, but Steve manages to get back onto the truck's roof)\r\n",
      "[Ultron] You know what's in that Cradle? The power to make real change, and that terrifies you.\r\n",
      "[Steve Rogers] I wouldn't call it a comfort. (Steve tries to fight with Ultron)\r\n",
      "[Ultron] Stop it! (he throws Steve shield aside and blasts him)\r\n",
      "[Clint Barton] (to Natasha) We got a window. Four, three...give 'em hell. (Natasha drops out of the Quinjet on a bike and rides towards the truck and picks up Steve's shield)\r\n",
      "[Natasha Romanoff] I'm always picking up after you boys.\r\n",
      "[Clint Barton] They're heading under the overpass, I've got no shot.\r\n",
      "[Natasha Romanoff] Which way?\r\n",
      "[Clint Barton] Hard right... Now. (Natasha heads over the truck, she throws Steve back his shield and he uses it to knock off Ultron from him)\r\n",
      "[Natasha Romanoff] (to the pedestrians on the pavement as she chases after the truck on her bike) Out of the way! Coming through! Sorry, coming through! (Steve continues his battle with Ultron on the truck)\r\n",
      "[Steve Rogers] Come on!\r\n",
      "[Natasha Romanoff] Clint, can you draw out the guards?\r\n",
      "[Clint Barton] Let's find out.\r\n",
      "[Natasha Romanoff] (to the pedestrians in her way) Beep beep! (Barton manages to draw out the Ultron sentries from the truck)\r\n",
      "(Steve later tackles Ultron into a train, the Ultron Sentries leave Barton and return to Ultron)\r\n",
      "[Clint Barton] Heading back towards you. So whatever you're going to do, do it now.\r\n",
      "[Natasha Romanoff] I'm going in, Cap can you keep him occupied?\r\n",
      "[Steve Rogers] (as he continues his battle with Ultron) What do you think I've been doing? (as Natasha enters the truck the Iron Legions head back, pick up the truck and lift off)\r\n",
      "[Clint Barton] The package is airborne. I have a clean shot.\r\n",
      "[Natasha Romanoff] Negative. I am still in the truck.\r\n",
      "[Clint Barton] What the hell are you...?\r\n",
      "[Natasha Romanoff] Just be ready, I'm sending the package to you.\r\n",
      "[Clint Barton] How do you want me to take it?\r\n",
      "[Natasha Romanoff] Uhh, you might wish you hadn't asked that. (Pietro and Wanda turn up on the train to help Steve fight with Ultron)\r\n",
      "[Ultron] Please. Don't do this.\r\n",
      "[Wanda Maximoff] What choice do we have? (Ultron flies off)\r\n",
      "[Steve Rogers] I lost him! He's headed your way.\r\n",
      "[Clint Barton] Nat, we gotta go. (Nat drops the cradle into the Quinjet but her foot gets caught by Ultron and she's pulled away)\r\n",
      "[Clint Barton] Nat! Cap, you see Nat?\r\n",
      "[Steve Rogers] If you have the package, get it to Stark! Go!\r\n",
      "[Clint Barton] Do you have eyes on Nat?\r\n",
      "[Steve Rogers] Go! (reluctantly Barton takes off in the Quinjet; back on the train to the twins) Civilians in our path. (Pietro speeds off; to Wanda) Can you stop this thing? (as Pietro picks up civilians out of the way of the train Wanda uses her powers and stops the train) (after stopping the train Wanda goes over to an out of breath Pietro)\r\n",
      "[Pietro Maximoff] I'm fine. I just need to take a minute.\r\n",
      "[Steve Rogers] I'm very tempted not to give you one.\r\n",
      "[Wanda Maximoff] The Cradle, did you get it?\r\n",
      "[Steve Rogers] Stark will take care of it.\r\n",
      "[Wanda Maximoff] No, he won't.\r\n",
      "[Steve Rogers] You don't know what you're talking about, Stark's not crazy.\r\n",
      "[Wanda Maximoff] He will do anything to make things right.\r\n",
      "[Steve Rogers] Stark, come in. Stark. Anyone on comms?\r\n",
      "[Wanda Maximoff] Ultron can't tell the difference between saving the world and destroying it. Where do you think he gets that? (after Barton has taken the Cradle to Stark and Banner)\r\n",
      "[Bruce Banner] Anything on Nat?\r\n",
      "[Tony Stark] Haven't heard. But she's alive, or Ultron'd be rubbing our faces in it.\r\n",
      "[Clint Barton] This is sealed tight.\r\n",
      "[Bruce Banner] We're going to need to access the program, break it down from within.\r\n",
      "[Tony Stark] Hm. Any chance Natasha might leave you a message, outside the internet, old school spy stuff?\r\n",
      "[Clint Barton] There's some nets I can cast. Yeah, alright. I'll find her. (Barton goes off)\r\n",
      "[Bruce Banner] I can work on tissue degeneration, if you can fry whatever operational system Cho implanted.\r\n",
      "[Tony Stark] Yeah, about that. (Banner looks at Stark)\r\n",
      "[Bruce Banner] No.\r\n",
      "[Tony Stark] You have to trust me.\r\n",
      "[Bruce Banner] Kinda don't.\r\n",
      "[Tony Stark] Our ally? The guy protecting the military's nuclear codes? I found him. (he brings up Jarvis's consciousness)\r\n",
      "[JARVIS] Hello, Dr. Banner.\r\n",
      "[Tony Stark] Ultron didn't go after JARVIS cause he was angry. He attacked him because he was scared of what he can do. So JARVIS went underground. Okay? Scattered, dumped his memory. But not his protocols. He didn't even know he was in there, until I pieced him together.\r\n",
      "[Bruce Banner] So, you want me to help you put JARVIS into this thing?\r\n",
      "[Tony Stark] No, of course not! I want to help you put JARVIS in this thing. (Banner shakes his head) We're out of my field here. You know bio-organics better than anyone.\r\n",
      "[Bruce Banner] And you just assume that JARVIS' operational matrix can beat Ultron's?\r\n",
      "[Tony Stark] JARVIS has been beating him from inside without knowing it. This is the opportunity, we can create Ultron's perfect self, without the homicidal glitches he thinks are his winning personality. We have to.\r\n",
      "[JARVIS] I believe it's worth a go.\r\n",
      "[Bruce Banner] No, I'm in a loop! I'm caught in a time loop, this is exactly where it all went wrong.\r\n",
      "[Tony Stark] I know, I know. I know what everyone's going to say, but they're already saying it. We're mad scientists. We're monsters, buddy. You gotta own it. Make a stand. (Banner shakes his head) It's not a loop. It's the end of the line.\r\n",
      "[Ultron] (as Natasha becomes conscious) I wasn't sure you'd wake up. I hoped you would, I wanted to show you something. I don't have anyone else. I think a lot about meteors, the purity of them. Boom! The end, start again. The world made clean for the new man to rebuild. I was meant to be new. I was meant to be beautiful. The world would've looked to the sky and seen hope, seen mercy. Instead they'll look up in horror because of you. You've wounded me. I give you full marks for that. But, like the man said, \"What doesn't kill me…(bigger body of Ultron's destroys him) \"…just makes me stronger.\" (locks Natasha in a cell) (Barton gets a Morse code message from Natasha which he's able to detect her location, at the same time Stark and Banner are experimenting on the synthetic body)\r\n",
      "[Tony Stark] This framework is not compatible.\r\n",
      "[Bruce Banner] The genetic coding tower's at ninety-seven percent. You have got to upload that schematic in the next three minutes. (Steve and the twins turn up at the lab)\r\n",
      "[Steve Rogers] I'm gonna say this once.\r\n",
      "[Tony Stark] How about \"nonce\"?\r\n",
      "[Steve Rogers] Shut it down!\r\n",
      "[Tony Stark] Nope, not gonna happen.\r\n",
      "[Steve Rogers] You don't know what you're doing.\r\n",
      "[Bruce Banner] And you do? She's not in your head?\r\n",
      "[Wanda Maximoff] I know you're angry.\r\n",
      "[Bruce Banner] Oh, we're way past that. I could choke the life out of you and never change a shade.\r\n",
      "[Steve Rogers] Banner, after everything that's happened...\r\n",
      "[Tony Stark] That's nothing compared to what's coming!\r\n",
      "[Wanda Maximoff] You don't know what's in there!\r\n",
      "[Steve Rogers] This isn't a game...\r\n",
      "[Wanda Maximoff] The creature...! (Pietro uses his speed to destroy the lab equipment)\r\n",
      "[Pietro Maximoff] No, no. Go on. You were saying? (suddenly Barton shoots a bullet below caused the glass Pietro is standing to stand to smash and he falls through)\r\n",
      "[Wanda Maximoff] Pietro!\r\n",
      "[Clint Barton] What? You didn't see that coming?\r\n",
      "[Bruce Banner] (to Wanda) Go ahead, piss me off. (just then Thor enters and pounds the cradle with his hammer, sending a powerful bolt of lightning that brings the body to life) Wait! (they all look in shock at the body who has JARVIS' voice and has become the Vision)\r\n",
      "[Vision] I'm sorry, that was...odd. (to Thor) Thank you.\r\n",
      "[Steve Rogers] Thor, you helped create this?\r\n",
      "[Thor] I've had a vision. A whirlpool that sucks in all hope of life and at it's center is that. (he points to the gem inside Vision's head)\r\n",
      "[Bruce Banner] What, the gem?\r\n",
      "[Thor] It's the Mind Stone. It's one of the six Infinity Stones, the greatest power in the universe, unparalleled in its destructive capabilities.\r\n",
      "[Steve Rogers] Then why would you bring it to...\r\n",
      "[Thor] Because Stark is right.\r\n",
      "[Bruce Banner] Oh, it's definitely the end times.\r\n",
      "[Thor] The Avengers cannot defeat Ultron.\r\n",
      "[Vision] Not alone.\r\n",
      "[Steve Rogers] Why does your \"vision\" sound like JARVIS?\r\n",
      "[Tony Stark] We...we reconfigured JARVIS' matrix to create something new.\r\n",
      "[Steve Rogers] I think I've had my fill of new.\r\n",
      "[Vision] You think I'm a child of Ultron?\r\n",
      "[Steve Rogers] You're not?\r\n",
      "[Vision] I'm not Ultron. I'm not JARVIS. I am...I am.\r\n",
      "[Wanda Maximoff] I looked in your head and saw annihilation.\r\n",
      "[Vision] Look again.\r\n",
      "[Clint Barton] Yeah. Her seal of approval means jack to me.\r\n",
      "[Thor] Their powers, the horrors in our heads, Ultron himself, they all came from the Mind Stone, and they're nothing compared to what it can unleash. But with it on our side...\r\n",
      "[Steve Rogers] Is it? Are you? On our side?\r\n",
      "[Vision] I don't think it's that simple.\r\n",
      "[Clint Barton] Well it better get real simple real soon.\r\n",
      "[Vision] I am on the side of life. Ultron isn't, he will end it all.\r\n",
      "[Tony Stark] What's he waiting for?\r\n",
      "[Vision] You.\r\n",
      "[Bruce Banner] Where?\r\n",
      "[Clint Barton] Sokovia. He's got Nat there too.\r\n",
      "[Bruce Banner] If we're wrong about you, if you're the monster that Ultron made you to be...\r\n",
      "[Vision] What will you do? (he looks at them all realizing they will destroy him) I don't want to kill Ultron. He's unique, and he's in pain. But that pain will roll over the earth, so he must be destroyed. Every form he's built, every trace of his presence on the net, we have to act now. And not one of us can do it without the others. Maybe I am a monster. I don't think I'd know if I were one. I'm not what you are, and not what you intended. So there may be no way to make you trust me. But we need to go. (he holds up Thor's hammer and hands it to him, Vision walks off and everyone stares in shock)\r\n",
      "[Thor] Right. (pats Stark on the shoulder) Well done.\r\n",
      "[Steve Rogers] (to the others) Three minutes. Get what you need. (they all start getting ready to leave, Stark loads up FRIDAY into his Iron Man suit now that JARVIS is no longer available)\r\n",
      "[FRIDAY] Good evening, boss.\r\n",
      "[Tony Stark] No way we all get through this. If even one tin soldier is left standing, we've lost. It's gonna be blood on the floor.\r\n",
      "[Steve Rogers] I got no plans tomorrow night.\r\n",
      "[Tony Stark] I get first crack at the big guy. Iron Man's the one he's waiting for.\r\n",
      "[Vision] (walks past) That's true, he hates you the most.\r\n",
      "[Steve Rogers] Ultron knows we're coming. Odds are we'll be riding into heavy fire, and that's what we signed up for. But the people of Sokovia, they didn't. So our priority is getting them out. (Pietro speeds into the Sokovian police station)\r\n",
      "[Pietro Maximoff] We're under attack! Clear the city, now! (no one takes this seriously so Pietro returns, takes a shotgun and starts shooting in the air) Get off your asses. (Wanda uses her mind powers on the people of Sokovia to get them to evacuate)\r\n",
      "[Steve Rogers] All they want is to live their lives in peace, and that's not going to happen today. But we can do our best to protect them. And we can get the job done, and find out what Ultron's been building. We find Romanoff, and we clear the field. Keep the fight between us. Ultron thinks we're monsters and we're what's wrong with the world. This isn't just about beating him. It's about whether he's right.\r\n",
      "[Bruce Banner] (inside her cell Natasha hears Banner's voice) Natasha! Natasha!\r\n",
      "[Natasha Romanoff] Bruce?\r\n",
      "[Bruce Banner] (he walks over to her cell) You alright?\r\n",
      "[Natasha Romanoff] Yeah.\r\n",
      "[Bruce Banner] The team's in the city, it's about to light up.\r\n",
      "[Natasha Romanoff] I don't suppose you found a key lying around somewhere?\r\n",
      "[Bruce Banner] Yeah, I did. (holds up gun and blasts the cell door open)\r\n",
      "[Natasha Romanoff] So what's our play?\r\n",
      "[Bruce Banner] I'm here to get you to safety.\r\n",
      "[Natasha Romanoff] Job's not finished.\r\n",
      "[Bruce Banner] We could help with the evacuation, but I can't be in a fight near civilians. And you've done plenty. Our fight is over.\r\n",
      "[Natasha Romanoff] So we just disappear? (as the city is being evacuated)\r\n",
      "[FRIDAY] Your man's in the church, boss. I think he's waiting for you. (Stark flies into the church)\r\n",
      "[Ultron] Come to confess your sins?\r\n",
      "[Tony Stark] I don't know, how much time you got?\r\n",
      "[Ultron] More than you.\r\n",
      "[Tony Stark] Uhhh. Have you been juicing? A little Vibranium cocktail? You're looking, I don't wanna say, puffy...\r\n",
      "[Ultron] You're stalling to protect the people.\r\n",
      "[Tony Stark] Well, that is the mission. Did you forget?\r\n",
      "[Ultron] I've moved beyond your mission. I'm free. (suddenly the Vibranium core he's placed beneath the floor erupts) What, you think you're the only one stalling?\r\n",
      "[FRIDAY] There's the rest of the Vibranium. Function: still unclear.\r\n",
      "[Ultron] This is how you end, Tony. This is peace in my time. (Ultron's army of robots start attacking the city as everyone is evacuating)\r\n",
      "[Steve Rogers] Go!\r\n",
      "[Wanda Maximoff] Get off the bridge! Run! (Vision then finds Ultron)\r\n",
      "[Vision] Ultron.\r\n",
      "[Ultron] My Vision. They really did take everything from me.\r\n",
      "[Vision] You set the terms, you can change them.\r\n",
      "[Ultron] Alright. (they start battling it out)\r\n",
      "[Tony Stark] FRIDAY! The Vision?\r\n",
      "[FRIDAY] Boss, it's working. He's burning Ultron out of the net, he won't escape through there.\r\n",
      "[Ultron] (to the Vision) You shut me out! You think I care? You take away my world, I take away yours. (he activates the Vibranium core and the earth around Sokovia starts to shake and break)\r\n",
      "[Tony Stark] FRIDAY?\r\n",
      "[FRIDAY] Sokovia's going for a ride. (as Sokovia is being destroyed)\r\n",
      "[Ultron] Do you see? The beauty of it, the inevitability. You rise, only to fall. You, Avengers, you are my meteor, my swift and terrible sword and the earth will crack with the weight of your failure. Purge me from your computers, turn my own flesh against me. It means nothing. When the dust settles, the only thing living in this world will be metal. (as the earth is shaking falling in around them)\r\n",
      "[Bruce Banner] We gotta move.\r\n",
      "[Natasha Romanoff] You're not going to turn green?\r\n",
      "[Bruce Banner] I've got a compelling reason not to lose my cool.\r\n",
      "[Natasha Romanoff] I adore you. (she kisses Banner then pushes him off the edge) But I need the other guy. (the Hulk jumps up in front of her) Let's finish the job. (with Natasha on his back yelling in fright, Hulk gets into the city) I really hope this makes us even. Now go be a hero. (Hulk goes off and Natasha rushes off in the opposite direction)\r\n",
      "[FRIDAY] The Vibranium core has got a magnetic field, that's what's keeping the rock together.\r\n",
      "[Tony Stark] If it drops?\r\n",
      "[FRIDAY] Right now the impact would kill thousands. Once it gets high enough: Global extinction. (Stark flies towards the city and a building starts to collapse as the ground shakes) That building's not clear, Tenth floor. (Stark flies in to find a family still in their apartment)\r\n",
      "[Tony Stark] Hi. Okay. Get in the tub! (Stark flies the family in the tub out of the collapsing building)\r\n",
      "[FRIDAY] I got airborne, heading up to the bridge.\r\n",
      "[Tony Stark] Cap, you got incoming.\r\n",
      "[Steve Rogers] Incoming already came in. Stark, you worry about bringing the city back down safely. The rest of us have one job: tear these things apart. You get hurt, hurt 'em back. You get killed, walk it off. (Barton gets Wanda out of the way and into a building as Ultron's robots attach the city)\r\n",
      "[Clint Barton] Go, go, move!\r\n",
      "[Wanda Maximoff] How could I let this happen? (Wanda starts to break down)\r\n",
      "[Clint Barton] Hey, hey, you okay?\r\n",
      "[Wanda Maximoff] This is all our fault.\r\n",
      "[Clint Barton] Hey, look at me. It's your fault, it's everyone's fault, who cares. Are you up for this? Are you? Look, I just need to know, cause the city is flying. Okay, look, the city is flying, we're fighting an army of robots, and I have a bow and arrow. None of this makes sense. But I'm going back out there because it's my job. Okay? And I can't do my job and babysit. It doesn't matter what you did, or what you were. If you go out there, you fight, and you fight to kill. Stay in here, you're good, I'll send your brother to come find you, but if you step out that door, you are an Avenger. (Wanda just looks at him) Alright, good chat. (he gets up and gets ready to leave) Yeah, the city is flying. (he leaves and starts shooting his arrows at the robots)\r\n",
      "[Steve Rogers] (to the woman Thor threw over to Steve after her car fell of the edge of a collapsing bridge) I got you! Just look at me. (Steve helps her up to safety)\r\n",
      "[Ultron] You can't save them all. You'll never... (he throws off one of the attacking robots off the edge of the bridge)\r\n",
      "[Steve Rogers] You'll never what? You didn't finish! (Thor lands on the bridge on the top of the woman's car he was saving) What, were you napping?\r\n",
      "[Ultron] (as Thor and Steve are fighting off the robots) Thor! You're bothering me. (as Barton is fighting off the robots Wanda suddenly comes out of the building and starts to use her powers on the robots to destroy them)\r\n",
      "[Clint Barton] Alright, we're all clear here.\r\n",
      "[Steve Rogers] We are not clear! We are very not clear!\r\n",
      "[Clint Barton] Alright, coming to you. (just then Pietro speeds in, picks up Wanda and leaves)\r\n",
      "[Pietro Maximoff] Keep up old man! (Barton holds his arrow to aim it at Pietro)\r\n",
      "[Clint Barton] Nobody would know. Nobody. \"The last I saw him, when Ultron was sitting on him. Uh...yeah, he'll be missed, that quick little bastard. I miss him already.\"\r\n",
      "[Steve Rogers] (as Natasha joins them in their battle with the robots) Romanoff! (he throws his shield at her so she can use it to protect herself from the attacking robot)\r\n",
      "[Natasha Romanoff] Thanks. (back to Stark)\r\n",
      "[FRIDAY] The anti-gravs are rigged to flip. Touch 'em, they'll go full reverse thrust. The city's not coming down slow.\r\n",
      "[Tony Stark] The spire's Vibranium. If I get Thor to hit it...\r\n",
      "[FRIDAY] It'll crack, but that's not enough, the impact would still be devastating.\r\n",
      "[Tony Stark] Maybe if we cap the other end, keep the atomic action doubling back.\r\n",
      "[FRIDAY] That could vaporize the city, and everyone on it.\r\n",
      "[Steve Rogers] The next wave's gonna hit any minute. What have you got, Stark?\r\n",
      "[Tony Stark] Well, nothing great. Maybe a way to blow up the city. That'll keep it from impacting the surface if you guys can get clear.\r\n",
      "[Steve Rogers] I asked for a solution, not an escape plan.\r\n",
      "[Tony Stark] Impact radius is getting bigger every second. We're going to have to make a choice.\r\n",
      "[Natasha Romanoff] Cap, these people are going nowhere. If Stark finds a way to blow this rock...\r\n",
      "[Steve Rogers] Not 'til everyone's safe.\r\n",
      "[Natasha Romanoff] Everyone up here versus everyone down there? There's no math there.\r\n",
      "[Steve Rogers] I'm not leaving this rock with one civilian on it.\r\n",
      "[Natasha Romanoff] I didn't say we should leave. (Steve turns to look at her) There's worse ways to go. Where else am I gonna get a view like this?\r\n",
      "[Nick Fury] (voice) Glad you like the view, Romanoff. It's about to get better. (just then the Helicarrier show up) (inside the Helicarrier) Nice, right? I pulled her out of mothballs with a couple of old friends. She's dusty, but she'll do.\r\n",
      "[Steve Rogers] Fury, you son of a bitch.\r\n",
      "[Nick Fury] Oooh! You kiss your mother with that mouth?\r\n",
      "[Maria Hill] Altitude is eighteen thousand and climbing.\r\n",
      "[Specialist Cameron Klein] Lifeboats secure to deploy. Disengage in three, two...take 'em out. (as they watch the lifeboats fly in towards the them)\r\n",
      "[Pietro Maximoff] This is SHIELD?\r\n",
      "[Steve Rogers] This is what SHIELD's supposed to be.\r\n",
      "[Pietro Maximoff] This is not so bad.\r\n",
      "[Steve Rogers] Let's load 'em up.\r\n",
      "[Maria Hill] Sir, we have multiple bogies converging on our starboard flank.\r\n",
      "[Nick Fury] Show 'em what we got.\r\n",
      "[Maria Hill] You're up. (Rhodes shows up in his War Machine suit and blasts one of the robots)\r\n",
      "[James Rhodes] Yes! Now this is gonna be a good story.\r\n",
      "[Tony Stark] Yep. If you live to tell it.\r\n",
      "[James Rhodes] You think I can't hold my own?\r\n",
      "[Tony Stark] We get through this, I'll hold your own.\r\n",
      "[James Rhodes] You had to make it weird.\r\n",
      "[Clint Barton] (as the team helps the people onto the Helicarrier lifeboats) Alright, let's load 'em up! Alright, here we go. Here we go, let's move. Let's go everyone!\r\n",
      "[Specialist Cameron Klein] Number six boat is topped and locked. Or, uh, or stocked, topped. It...it's, uh, full of people.\r\n",
      "[Maria Hill] Incoming! (one of the robots flies in and crashes inside the Helicarrier)\r\n",
      "[Specialist Cameron Klein] Oh, God! (Hill shoots at it and Fury stabs in with a piece of metal, destroying it)\r\n",
      "[Ultron] (as he's hitting Thor) You think you're saving anyone? I turn that key and drop this rock a little early and it's still billions dead. Even you can't stop that.\r\n",
      "[Thor] I am Thor, son of Odin, and as long as there is life in my breast, I am...running out of things to say! Are you ready? (Vision uses Thor's hammer to hit Ultron, Vision then throws the hammer back to Thor)\r\n",
      "[Vision] It's terribly well balanced.\r\n",
      "[Thor] Well, if there's too much weight, you lose power on the swing, so.\r\n",
      "[Tony Stark] I got it! Create a heat seal. I can...I can supercharge the spire from below.\r\n",
      "[FRIDAY] Running numbers. (Stark fights off the robots from the Helicarrier's lifeboats) A heat seal could work with enough power.\r\n",
      "[Tony Stark] Thor, I got a plan!\r\n",
      "[Thor] We're out of time. They're coming for the core.\r\n",
      "[Tony Stark] Rhodey, get the rest of the people on board that carrier.\r\n",
      "[James Rhodes] On it.\r\n",
      "[Tony Stark] Avengers, time to work for a living.\r\n",
      "[Pietro Maximoff] (the rest of the team joins Thor and Vision) You good?\r\n",
      "[Wanda Maximoff] Yeah.\r\n",
      "[Tony Stark] Romanoff? You and Banner better not be playing \"hide the zucchini.\"\r\n",
      "[Natasha Romanoff] Relax, Shell-head. Not all of us can fly. (as she joins the rest of the team) What's the drill?\r\n",
      "[Tony Stark] (points to the Vibranium core) This is the drill. If Ultron gets a hand on the core, we lose. (Ultron shows up)\r\n",
      "[Thor] Is that the best you can do? (Ultron summons his army of robots to join him)\r\n",
      "[Steve Rogers] You had to ask.\r\n",
      "[Ultron] This is the best I can do. This is exactly what I wanted. All of you, against all of me. How could you possibly hope to stop me?\r\n",
      "[Tony Stark] Well, like the old man said. Together. (they all fight off Ultron's attacking robots)\r\n",
      "[Ultron] You know, with the benefit of hindsight.... (suddenly Hulk knocks him far away and the robots start to retreat)\r\n",
      "[Thor] They'll try to leave the city.\r\n",
      "[Tony Stark] We can't let 'em, not even one. Rhodey!\r\n",
      "[James Rhodes] I'm on it. (to the approaching robots) Oh, no, I didn't say you could leave. War Machine, comin' at you, right ... (just then Vision flies in and helps to destroy the robots) Okay, what?\r\n",
      "[Steve Rogers] We gotta move out. Even I can tell the air is getting thin. You guys get to the boats, I'll sweep for stragglers, be right behind you.\r\n",
      "[Clint Barton] What about the core?\r\n",
      "[Wanda Maximoff] I'll protect it. It's my job.\r\n",
      "[Wanda Maximoff] (Steve, Barton and Natasha leave; to Pietro) Get the people on the boats.\r\n",
      "[Pietro Maximoff] I'm not going to leave you here.\r\n",
      "[Wanda Maximoff] I can handle this. (just then she blasts off an approaching robot) Come back for me when everyone else is off, not before.\r\n",
      "[Pietro Maximoff] Hmm.\r\n",
      "[Wanda Maximoff] You understand?\r\n",
      "[Pietro Maximoff] You know, I'm twelve minutes older than you. (Wanda chuckles)\r\n",
      "[Wanda Maximoff] Go.\r\n",
      "[FRIDAY] Boss, power levels are way below opt...\r\n",
      "[Tony Stark] Re-route everything. We get one shot at this. (Barton and Natasha are making their way to the lifeboats)\r\n",
      "[Clint Barton] I know what I need to do. The dining room! If I knock out that east wall, it'll make a nice work space for Laura, huh? Put up some baffling, she can't hear the kids running around, what do you think?\r\n",
      "[Natasha Romanoff] You guys always eat in the kitchen anyway.\r\n",
      "[Clint Barton] No one eats in a dining room. (they reach the lifeboats) We don't have a lot of time.\r\n",
      "[Natasha Romanoff] So get your ass on a boat. (Natasha finds the Hulk) Hey, big guy. Sun's getting real low. (Barton gets onto one of the lifeboats, but notices a woman calling out for her brother)\r\n",
      "[Zrinka] Costel? We were in the market. Costel?! (Barton runs off to find the boy)\r\n",
      "[Tony Stark] Thor, I'm gonna need you back in the church.\r\n",
      "[Thor] (referring to the people getting onto the lifeboats) Is this the last of them?\r\n",
      "[Steve Rogers] Yeah. Everyone else is on the carrier.\r\n",
      "[Tony Stark] You know, if this works, we maybe don't walk away.\r\n",
      "[Thor] Maybe not. (just as Natasha tries to calm Hulk down to get him back to being Banner Ultron flies in with a jet and starts shooting at them)\r\n",
      "[Ultron] (sings) I got no strings, so I have fun. I'm not tied up to anyone. (as Barton is saving the boy, Costel, Ultron starts shooting at them but Pietro intervenes and takes the shots to save them)\r\n",
      "[Pietro Maximoff] You didn't see that coming. (Pietro falls to the ground as he dies, Wanda senses his death, causing her to fall in despair) (Hulk drops Natasha off onto the Helicarrier and then jumps onto the jet Ultron is on)\r\n",
      "[Ultron] Oh, for God's sake! (Hulk knocks Ultron out of the jet and he crashes inside a train; at the same time Barton delivers Costel safely to his sister onto the lifeboat, a man goes over to help him with his wound)\r\n",
      "[Clint Barton] No, no. I'm fine. (Barton lies down next to the dead body of Pietro) Oh, it's been a long day. (Wanda then finds the Ultron)\r\n",
      "[Ultron] Wanda, if you stay here, you'll die.\r\n",
      "[Wanda Maximoff] I just did. Do you know how it felt? (she uses her power to rip Ultron's core out of his body) It felt like that. (Stark fires a powerful blast to the core underneath the floating city)\r\n",
      "[Tony Stark] Thor, on my mark. (Thor brings on a blast of lightning, at the same time Vision flies in, picks up Wanda and flies off with as the city is being destroyed) Now! (Thor uses his hammer to hit the Vibranium core in the church, destroying the core and the floating city)\r\n",
      "[Natasha Romanoff] (to Hulk as he remains on the jet he knocked Ultron out of) Hey, big guy. We did it, the job's finished. Now I need you to turn this bird around, okay? We can't track you in stealth mode, so help me out. I need you t... (Hulk turns off Nat's camera, then sits as the jet flies off to an unknown destination, at the same time Vision finds Ultron)\r\n",
      "[Vision] You're afraid.\r\n",
      "[Ultron] Of you?\r\n",
      "[Vision] Of death. You're the last one.\r\n",
      "[Ultron] You were supposed to be the last. Stark asked for a savior, and settled for a slave.\r\n",
      "[Vision] I suppose we're both disappointments. (Ultron chuckles)\r\n",
      "[Ultron] I suppose we are.\r\n",
      "[Vision] Humans are odd. They think order and chaos are somehow opposites, and try to control what won't be. But there is grace in their failings. I think you missed that.\r\n",
      "[Ultron] They're doomed.\r\n",
      "[Vision] Yes. But a thing isn't beautiful because it lasts. It's a privilege to be among them.\r\n",
      "[Ultron] You're unbearably naive.\r\n",
      "[Vision] Well, I was born yesterday. (as Ultron goes to attack him Vision uses the infinity stone in his head to destroy him)\r\n",
      "[Laura Barton] (we see Barton returning to his family on the farm, then we see Stark driving to the new Avengers facility in upstate New York; Natasha looks at Barton's new baby on her phone) Say hi to Auntie Nat. (Natasha sees the baby has been named Nathaniel Pietro Barton)\r\n",
      "[Natasha Romanoff] Fat.\r\n",
      "[Nick Fury] One of our tech boys flagged this, splashed down in the Banda Sea. Could be the Quinjet. But with Stark's stealth tech, we still can't track the damn thing.\r\n",
      "[Natasha Romanoff] Right.\r\n",
      "[Nick Fury] Probably jumped out and swam to Fiji. He'll send a postcard.\r\n",
      "[Natasha Romanoff] \"Wish you were here.\" You sent me to recruit him, way back when. Did you know then what was going to happen?\r\n",
      "[Nick Fury] You never know. You hope for the best and make do with what you get. I got a great team.\r\n",
      "[Natasha Romanoff] Nothing lasts forever.\r\n",
      "[Nick Fury] Trouble, Miss Romanoff. No matter who wins or loses, trouble still comes around.\r\n",
      "[Steve Rogers] The rules have changed.\r\n",
      "[Tony Stark] We're dealing with something new.\r\n",
      "[Steve Rogers] Well, the Vision's artificial intelligence.\r\n",
      "[Tony Stark] A machine.\r\n",
      "[Steve Rogers] So it doesn't count.\r\n",
      "[Tony Stark] No. It's not like a person lifting the hammer.\r\n",
      "[Steve Rogers] Right. Different rules for us.\r\n",
      "[Tony Stark] Nice guy, but artificial.\r\n",
      "[Steve Rogers] Thank you.\r\n",
      "[Thor] If he can wield the hammer, he can keep the Mind Stone. It's safe with the Vision and these days, safe is in short supply.\r\n",
      "[Steve Rogers] But if you put the hammer in an elevator...\r\n",
      "[Tony Stark] It would still go up.\r\n",
      "[Steve Rogers] Elevator's not worthy.\r\n",
      "[Thor] I'm going to miss these little talks of ours.\r\n",
      "[Tony Stark] Well, not if you don't leave.\r\n",
      "[Thor] I have no choice. The Mind Stone is the fourth of the Infinity Stones to show up in the last few years. That's not a coincidence. Someone has been playing an intricate game and has made pawns of us. But once all these pieces are in position...\r\n",
      "[Tony Stark] Triple Yahtzee?\r\n",
      "[Steve Rogers] You think you can find out what's coming?\r\n",
      "[Thor] I do. Besides this one, there's nothing that can't be explained. (Thor returns to Asgard which burns a circle in the grass he was standing on)\r\n",
      "[Tony Stark] That man has no regard for lawn maintenance. I'm gonna miss him though. And you're gonna miss me. There's gonna be a lot of manful tears. (as they walk over towards Stark's car)\r\n",
      "[Steve Rogers] I will miss you, Tony.\r\n",
      "[Tony Stark] Yeah? Well, it's time for me to tap out. Maybe I should take a page out of Barton's book and build Pepper a farm, hope nobody blows it up.\r\n",
      "[Steve Rogers] The simple life.\r\n",
      "[Tony Stark] You'll get there one day.\r\n",
      "[Steve Rogers] I don't know, family, stability. The guy who wanted all that went in the ice seventy-five years ago. I think someone else came out. (Stark turns to get into his car)\r\n",
      "[Tony Stark] You alright?\r\n",
      "[Steve Rogers] I'm home. (last lines; Steve finds Natasha standing alone) You want to keep staring at the wall, or do you want to go to work? I mean, it's a pretty interesting wall.\r\n",
      "[Natasha Romanoff] I thought you and Tony were still gazing into each other's eyes. How do we look?\r\n",
      "[Steve Rogers] Well, we're not the '27 Yankees. (hands Natasha a tablet)\r\n",
      "[Natasha Romanoff] We've got some hitters.\r\n",
      "[Steve Rogers] They're good. They're not a team.\r\n",
      "[Natasha Romanoff] Let's beat 'em into shape. (they gather Rhodes in his War Machine suit, Sam in his Falcon suit, Wanda in a new suit, and Vision)\r\n",
      "[Steve Rogers] Avengers...!\r\n",
      "(mid-credits scene; we see the Infinity Gauntlet without any of the Stones, dissatisfied Thanos opens a vault and puts on The Infinty Gauntlet, revealing himself)\r\n",
      "[Thanos] Fine, I'll do it myself.\r\n",
      "(End of Avengers: Age of Ultron)\r\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(marvel[\"TEXT\"].values[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[Announcer] (first lines; announcement over sp...</td>\n",
       "      <td>{\"title\": \"Avengers: Age of Ultron\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>(1989 – Hank Pym enters a SHIELD facility and ...</td>\n",
       "      <td>{\"title\": \"Ant-Man\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>F O R  Y O U R  C O N S I D E R AT I O N\\r\\n\\r...</td>\n",
       "      <td>{\"title\": \"Avengers: Endgame\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Marvel’s THE AVENGERS\\r\\n\\r\\nWritten By\\r\\n\\r\\...</td>\n",
       "      <td>{\"title\": \"The Avengers\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>BLACK PANTHER \\r\\n\\r\\nAdapted \\r\\nScreenplay \\...</td>\n",
       "      <td>{\"title\": \"Black Panther\"}</td>\n",
       "      <td>marvel/pdunton</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                TEXT  \\\n",
       "0  [Announcer] (first lines; announcement over sp...   \n",
       "1  (1989 – Hank Pym enters a SHIELD facility and ...   \n",
       "2  F O R  Y O U R  C O N S I D E R AT I O N\\r\\n\\r...   \n",
       "3  Marvel’s THE AVENGERS\\r\\n\\r\\nWritten By\\r\\n\\r\\...   \n",
       "4  BLACK PANTHER \\r\\n\\r\\nAdapted \\r\\nScreenplay \\...   \n",
       "\n",
       "                               METADATA          SOURCE  \n",
       "0  {\"title\": \"Avengers: Age of Ultron\"}  marvel/pdunton  \n",
       "1                  {\"title\": \"Ant-Man\"}  marvel/pdunton  \n",
       "2        {\"title\": \"Avengers: Endgame\"}  marvel/pdunton  \n",
       "3             {\"title\": \"The Avengers\"}  marvel/pdunton  \n",
       "4            {\"title\": \"Black Panther\"}  marvel/pdunton  "
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "marvel.to_parquet(\"marvel.pq\", row_group_size=100, engine=\"pyarrow\", index=False)\n",
    "marvel.head()  # https://www.kaggle.com/datasets/pdunton/marvel-cinematic-universe-dialogue"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "18"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(marvel)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Doctor Who"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "# doctor who via # https://www.kaggle.com/datasets/jeanmidev/doctor-who?select=all-scripts.csv\n",
    "kaggle.api.dataset_download_files(\"jeanmidev/doctor-who\", \"drwho\", unzip=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "episodes, diffusion = {}, {}\n",
    "for index, row in pd.read_csv(\"drwho/all-detailsepisodes.csv\").iterrows():\n",
    "    assert row[\"episodeid\"] not in episodes, row[\"episodeid\"]\n",
    "    episodes[row[\"episodeid\"]] = row[\"title\"]\n",
    "    diffusion[row[\"episodeid\"]] = row[\"first_diffusion\"]\n",
    "doctors = {\n",
    "    1: \"First Doctor\",\n",
    "    2: \"Second Doctor\",\n",
    "    3: \"Third Doctor\",\n",
    "    4: \"Fourth Doctor\",\n",
    "    5: \"Fifth Doctor\",\n",
    "    6: \"Sixth Doctor\",\n",
    "    7: \"Seventh Doctor\",\n",
    "    8: \"Eighth Doctor\",\n",
    "    9: \"Ninth Doctor\",\n",
    "    10: \"Tenth Doctor\",\n",
    "    11: \"Eleventh Doctor\",\n",
    "    12: \"Twelfth Doctor\",\n",
    "    13: \"Thirteenth Doctor\",\n",
    "    14: \"Fourteenth Doctor\",\n",
    "    15: \"Fifteenth Doctor\",\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "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>idx</th>\n",
       "      <th>text</th>\n",
       "      <th>type</th>\n",
       "      <th>details</th>\n",
       "      <th>episodeid</th>\n",
       "      <th>doctorid</th>\n",
       "      <th>episode</th>\n",
       "      <th>season</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>Sylvest home</td>\n",
       "      <td>location</td>\n",
       "      <td>NaN</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>Twin boys are playing a cross between chess an...</td>\n",
       "      <td>context</td>\n",
       "      <td>NaN</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>Where's mother?</td>\n",
       "      <td>talk</td>\n",
       "      <td>REMUS</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>She's busy.</td>\n",
       "      <td>talk</td>\n",
       "      <td>SYLVEST</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>Does that mean she isn't talking to us?</td>\n",
       "      <td>talk</td>\n",
       "      <td>ROMULUS</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>5</td>\n",
       "      <td>No, she's just busy.</td>\n",
       "      <td>talk</td>\n",
       "      <td>SYLVEST</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>6</td>\n",
       "      <td>We would like to see her.</td>\n",
       "      <td>talk</td>\n",
       "      <td>BOTH</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>7</td>\n",
       "      <td>She isn't here.</td>\n",
       "      <td>talk</td>\n",
       "      <td>SYLVEST</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>8</td>\n",
       "      <td>She's gone out without saying goodbye?</td>\n",
       "      <td>talk</td>\n",
       "      <td>REMUS</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9</td>\n",
       "      <td>Well, yes.</td>\n",
       "      <td>talk</td>\n",
       "      <td>SYLVEST</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10</td>\n",
       "      <td>I suppose you're going out as well.</td>\n",
       "      <td>talk</td>\n",
       "      <td>ROMULUS</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>11</td>\n",
       "      <td>In a few minutes.</td>\n",
       "      <td>talk</td>\n",
       "      <td>SYLVEST</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>12</td>\n",
       "      <td>Abandoned again.</td>\n",
       "      <td>talk</td>\n",
       "      <td>REMUS</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>13</td>\n",
       "      <td>You we forgive, Father, but not Mother.</td>\n",
       "      <td>talk</td>\n",
       "      <td>ROMULUS</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>14</td>\n",
       "      <td>Look, Romulus, I wish you would be kinder to ...</td>\n",
       "      <td>talk</td>\n",
       "      <td>SYLVEST</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>15</td>\n",
       "      <td>Why?</td>\n",
       "      <td>talk</td>\n",
       "      <td>BOTH</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>16</td>\n",
       "      <td>She is your mother.</td>\n",
       "      <td>talk</td>\n",
       "      <td>SYLVEST</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>17</td>\n",
       "      <td>Because Mother happened to give birth to us, ...</td>\n",
       "      <td>talk</td>\n",
       "      <td>REMUS</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>18</td>\n",
       "      <td>Yes. Yes, of course.</td>\n",
       "      <td>talk</td>\n",
       "      <td>SYLVEST</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>19</td>\n",
       "      <td>Respect must be earned, Father. Mother is a f...</td>\n",
       "      <td>talk</td>\n",
       "      <td>REMUS</td>\n",
       "      <td>21-7</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    idx                                               text      type  details  \\\n",
       "0     0                                       Sylvest home  location      NaN   \n",
       "1     1  Twin boys are playing a cross between chess an...   context      NaN   \n",
       "2     2                                    Where's mother?      talk    REMUS   \n",
       "3     3                                        She's busy.      talk  SYLVEST   \n",
       "4     4            Does that mean she isn't talking to us?      talk  ROMULUS   \n",
       "5     5                               No, she's just busy.      talk  SYLVEST   \n",
       "6     6                          We would like to see her.      talk     BOTH   \n",
       "7     7                                    She isn't here.      talk  SYLVEST   \n",
       "8     8             She's gone out without saying goodbye?      talk    REMUS   \n",
       "9     9                                         Well, yes.      talk  SYLVEST   \n",
       "10   10                I suppose you're going out as well.      talk  ROMULUS   \n",
       "11   11                                  In a few minutes.      talk  SYLVEST   \n",
       "12   12                                   Abandoned again.      talk    REMUS   \n",
       "13   13            You we forgive, Father, but not Mother.      talk  ROMULUS   \n",
       "14   14   Look, Romulus, I wish you would be kinder to ...      talk  SYLVEST   \n",
       "15   15                                               Why?      talk     BOTH   \n",
       "16   16                                She is your mother.      talk  SYLVEST   \n",
       "17   17   Because Mother happened to give birth to us, ...      talk    REMUS   \n",
       "18   18                               Yes. Yes, of course.      talk  SYLVEST   \n",
       "19   19   Respect must be earned, Father. Mother is a f...      talk    REMUS   \n",
       "\n",
       "   episodeid  doctorid  episode  season  \n",
       "0       21-7         6        7      21  \n",
       "1       21-7         6        7      21  \n",
       "2       21-7         6        7      21  \n",
       "3       21-7         6        7      21  \n",
       "4       21-7         6        7      21  \n",
       "5       21-7         6        7      21  \n",
       "6       21-7         6        7      21  \n",
       "7       21-7         6        7      21  \n",
       "8       21-7         6        7      21  \n",
       "9       21-7         6        7      21  \n",
       "10      21-7         6        7      21  \n",
       "11      21-7         6        7      21  \n",
       "12      21-7         6        7      21  \n",
       "13      21-7         6        7      21  \n",
       "14      21-7         6        7      21  \n",
       "15      21-7         6        7      21  \n",
       "16      21-7         6        7      21  \n",
       "17      21-7         6        7      21  \n",
       "18      21-7         6        7      21  \n",
       "19      21-7         6        7      21  "
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "who = pd.read_csv(\"drwho/all-scripts.csv\")\n",
    "who[\"episode\"] = who[\"episodeid\"].apply(lambda x: int(x.split(\"-\")[1]) if len(x.split(\"-\")) > 1 else -1)\n",
    "who[\"season\"] = who[\"episodeid\"].apply(lambda x: int(x.split(\"-\")[0]) if len(x.split(\"-\")) > 1 else -1)\n",
    "who.head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|████████████████████████████████████████████████████████████████████████████████| 306/306 [00:41<00:00,  7.32it/s]\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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Doctor Who (23 Nov, 1963; First Doctor) - An U...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Doctor Who (21 Dec, 1963; First Doctor) - The ...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Doctor Who (8 Feb, 1964; First Doctor) - The E...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Doctor Who (22 Feb, 1964; First Doctor) - Marc...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Doctor Who (11 Apr, 1964; First Doctor) - The ...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>301</th>\n",
       "      <td>Doctor Who (17 Nov, 2007; Tenth Doctor) - Time...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>302</th>\n",
       "      <td>Doctor Who (16 Nov, 2012; Eleventh Doctor) - T...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>303</th>\n",
       "      <td>Doctor Who (21 Nov, 2009; Tenth Doctor) - Drea...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>304</th>\n",
       "      <td>Doctor Who (12 May, 1996 (Canada); Eighth Doct...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>305</th>\n",
       "      <td>Doctor Who (25 Mar, 2013; Eleventh Doctor) - T...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>306 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  TEXT  \\\n",
       "0    Doctor Who (23 Nov, 1963; First Doctor) - An U...   \n",
       "1    Doctor Who (21 Dec, 1963; First Doctor) - The ...   \n",
       "2    Doctor Who (8 Feb, 1964; First Doctor) - The E...   \n",
       "3    Doctor Who (22 Feb, 1964; First Doctor) - Marc...   \n",
       "4    Doctor Who (11 Apr, 1964; First Doctor) - The ...   \n",
       "..                                                 ...   \n",
       "301  Doctor Who (17 Nov, 2007; Tenth Doctor) - Time...   \n",
       "302  Doctor Who (16 Nov, 2012; Eleventh Doctor) - T...   \n",
       "303  Doctor Who (21 Nov, 2009; Tenth Doctor) - Drea...   \n",
       "304  Doctor Who (12 May, 1996 (Canada); Eighth Doct...   \n",
       "305  Doctor Who (25 Mar, 2013; Eleventh Doctor) - T...   \n",
       "\n",
       "                                              METADATA           SOURCE  \n",
       "0    {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "1    {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "2    {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "3    {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "4    {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "..                                                 ...              ...  \n",
       "301  {\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...  drwho/jeanmidev  \n",
       "302  {\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...  drwho/jeanmidev  \n",
       "303  {\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...  drwho/jeanmidev  \n",
       "304  {\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...  drwho/jeanmidev  \n",
       "305  {\"show\": \"Doctor Who\", \"season\": \"\", \"episode\"...  drwho/jeanmidev  \n",
       "\n",
       "[306 rows x 3 columns]"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "doctor = {\"TEXT\": [], \"METADATA\": [], \"SOURCE\": []}\n",
    "for name, group in tqdm(who.groupby(\"episodeid\")):\n",
    "    metadata = {\n",
    "        \"show\": \"Doctor Who\",\n",
    "        \"season\": f\"s{str(group['season'].values[0]).zfill(2)}\" if group[\"season\"].values[0] > 0 else \"\",\n",
    "        \"episode\": f\"e{str(group['episode'].values[0]).zfill(2)}\" if group[\"episode\"].values[0] > 0 else \"\",\n",
    "        \"title\": episodes[group[\"episodeid\"].values[0]],\n",
    "    }\n",
    "    text, talk = (\n",
    "        f\"Doctor Who ({diffusion[group['episodeid'].values[0]]}; {doctors[group['doctorid'].values[0]]}) - {metadata['title']}\\r\\n\\r\\n\",\n",
    "        False,\n",
    "    )\n",
    "    for index, row in group.iterrows():\n",
    "        if row[\"type\"] == \"location\":\n",
    "            if talk:\n",
    "                text += \"\\r\\n---------------------------------------\\r\\n\\r\\n\"\n",
    "                talk = False\n",
    "            text += f\"({str(row['text']).strip()})\\r\\n\"\n",
    "        elif row[\"type\"] == (\"context\", \"unknown\"):\n",
    "            if talk:\n",
    "                text += \"\\r\\n\"\n",
    "                talk = False\n",
    "            text += f\"{str(row['text']).strip()}\\r\\n\\r\\n\"\n",
    "        elif pd.notna(row[\"details\"]):\n",
    "            text += f\"[{row['details']}] {str(row['text']).strip()}\\r\\n\"\n",
    "            talk = True\n",
    "    doctor[\"TEXT\"].append(text)\n",
    "    doctor[\"METADATA\"].append(json.dumps(metadata))\n",
    "    doctor[\"SOURCE\"].append(\"drwho/jeanmidev\")\n",
    "doctor = pd.DataFrame(doctor)\n",
    "doctor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Doctor Who (23 Nov, 1963; First Doctor) - An Unearthly Child\r\n",
      "\r\n",
      "(Coal Hill School corridor)\r\n",
      "[GIRL] Night, Miss Wright.\r\n",
      "[BARBARA] Wait in here, please, Susan. I won't be long.\r\n",
      "[BOY] Goodnight, Miss Wright.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Laboratory)\r\n",
      "[IAN] Oh? Not gone yet?\r\n",
      "[BARBARA] Obviously not.\r\n",
      "[IAN] Right, ask a silly question.\r\n",
      "[BARBARA] I'm sorry.\r\n",
      "[IAN] That's all right. I'll forgive you this time.\r\n",
      "[BARBARA] Oh, I had a terrible day. I don't know what to make of it.\r\n",
      "[IAN] Oh, what's the trouble? Can I help?\r\n",
      "[BARBARA] Oh, it's one of the girls, Susan Foreman.\r\n",
      "[IAN] Susan Foreman? She your problem too?\r\n",
      "[BARBARA] Yes.\r\n",
      "[IAN] You don't know what to make of her?\r\n",
      "[BARBARA] No.\r\n",
      "[IAN] How old is she, Barbara?\r\n",
      "[BARBARA] Fifteen.\r\n",
      "[IAN] Fifteen. She lets her knowledge out a bit at a time so as not toembarrass me. That's what I feel about her. She knows more science thanI'll ever know. She's a genius. Is that what she's doing with history?\r\n",
      "[BARBARA] Something like that.\r\n",
      "[IAN] So your problem is whether to stay in business or to hand over theclass to her.\r\n",
      "[BARBARA] No, not quite.\r\n",
      "[IAN] What, then?\r\n",
      "[BARBARA] Ian, I must talk to someone about this, but I don't want toget the girl into trouble. And I know you're going to tell me I'mimagining things.\r\n",
      "[IAN] No, I'm not.\r\n",
      "[BARBARA] Well, I told you how good she is at history. I had a talk withher and told her she ought to specialise. Well, she seemed quiteinterested until I said I'd be willing to work with her at her home.Then she said that would be absolutely impossible as her grandfatherdidn't like strangers.\r\n",
      "[IAN] He's a doctor, isn't he? That's a bit of a lame excuse.\r\n",
      "[BARBARA] Well, I didn't pursue the point but then recently herhomework's been so bad.\r\n",
      "[IAN] Yes, I know.\r\n",
      "[BARBARA] Finally I got so irritated with all her excuses I decided tohave a talk with this grandfather of hers and tell him to take someinterest in her.\r\n",
      "[IAN] Did you indeed? And what's the old boy like?\r\n",
      "[BARBARA] Well, that's just it. I got her address from the secretary, 76Totter's Lane, and I went along there one evening. Oh Ian, do payattention.\r\n",
      "[IAN] Sorry. You went along there one evening?\r\n",
      "[BARBARA] There isn't anything there. It's just an old junkyard.\r\n",
      "[IAN] You must have gone to the wrong place.\r\n",
      "[BARBARA] Well, that was the address the secretary gave me.\r\n",
      "[IAN] The secretary got it wrong, then.\r\n",
      "[BARBARA] No. I checked. There's a big wall on one side, houses on theother and nothing in the middle. And this nothing in the middle isnumber 76 Totter's Lane.\r\n",
      "[IAN] Hmm. That's a bit of a mystery. Well, there must be a simpleanswer somewhere.\r\n",
      "[BARBARA] Well, what?\r\n",
      "[IAN] Well, we'll have to find out for ourselves, won't we?\r\n",
      "[BARBARA] Thank you for the we. She's waiting in one of the classrooms.I'm lending her a book on the French Revolution.\r\n",
      "[IAN] What's she going to do, rewrite it? Oh, all right. What do we do?Ask her point-blank?\r\n",
      "[BARBARA] No, I thought we could drive there, wait till she arrives andsee where she goes.\r\n",
      "[IAN] Oh, all right.\r\n",
      "[BARBARA] That is, if you're not doing anything.\r\n",
      "[IAN] No, I'm not. After you.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Classroom)\r\n",
      "[BARBARA] Susan?\r\n",
      "[SUSAN] Oh, I'm sorry, Miss Wright. I didn't hear you coming in. Aren'tthey fabulous?\r\n",
      "[BARBARA] Who?\r\n",
      "[SUSAN] It's John Smith and the Common Men. They've gone from nineteento two.\r\n",
      "[IAN] John Smith is the stage name of the Honourable Aubrey Waites. Hestarted his career as Chris Waites and the Carollers, didn't he, Susan?\r\n",
      "[SUSAN] You are surprising, Mister Chesterton. I wouldn't expect you toknow things like that.\r\n",
      "[IAN] I have an enquiring mind. And a very sensitive ear.\r\n",
      "[SUSAN] Oh, I'm sorry.\r\n",
      "[IAN] Thank you.\r\n",
      "[SUSAN] Is that the book you promised me?\r\n",
      "[BARBARA] Yes.\r\n",
      "[SUSAN] Thank you very much. It will be interesting. I'll return ittomorrow.\r\n",
      "[BARBARA] Oh, that's not necessary. Keep it until you've finished it.\r\n",
      "[SUSAN] I'll have finished it.\r\n",
      "[IAN] Oh, where do you live, Susan? I'm giving Miss Wright a lift, I'vegot room for one more.\r\n",
      "[SUSAN] No, thank you, Mister Chesterton. I like walking through thedark. It's mysterious.\r\n",
      "[BARBARA] Be careful, Susan, there'll probably be fog again tonight.\r\n",
      "[SUSAN] Mmm.\r\n",
      "[BARBARA] See you in the morning.\r\n",
      "[SUSAN] I expect so. Good night.\r\n",
      "[BARBARA] Good night.\r\n",
      "[IAN] Good night, Susan.\r\n",
      "[SUSAN] But that's not right.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Totter's Lane)\r\n",
      "[BARBARA] Over there.\r\n",
      "[IAN] We're lucky there was no fog. I'd never have found this.\r\n",
      "[BARBARA] Well, she doesn't seem to have arrived yet. I suppose we aredoing the right thing, aren't we?\r\n",
      "[IAN] You can't justify curiosity.\r\n",
      "[BARBARA] But her homework?\r\n",
      "[IAN] A bit of an excuse, really, isn't it? I've seen far worse. Thetruth is, we're both curious about Susan and we won't be happy until weknow some of the answers.\r\n",
      "[BARBARA] You can't just pass it off like that. If I thought I was justbeing a busybody, I'd go straight home. I thought you agreed she was abit of a mystery.\r\n",
      "[IAN] Yes, but I think you'll find there's a very simple explanation toall this.\r\n",
      "[BARBARA] Well, I don't know how you explain the fact that a fifteenyear old girl does not know how many shillings there are in a pound.\r\n",
      "[IAN] Really?\r\n",
      "[BARBARA] Really. She said she thought we were on the decimal system.\r\n",
      "[IAN] Decimal system?\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Memory - classroom)\r\n",
      "[SUSAN] I'm sorry, Miss Wright.\r\n",
      "[BARBARA] Don't be silly, Susan. The United States has a decimal system.You know perfectly well that we do not.\r\n",
      "[SUSAN] Of course, the decimal system hasn't started yet.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Totter's Lane)\r\n",
      "[IAN] I suppose she couldn't be a foreigner? No,doesn't make sense. Nothing about this girl makes sense. For instance,the other day I talking about chemical changes. I'd given out thelitmus paper to show cause and effect\r\n",
      "[BARBARA] And she knew the answer before you'd started.\r\n",
      "[IAN] Well, not quite. The answer simply didn't interest her.\r\n",
      "[SUSAN] Yes, I can see red turns to blue, MisterChesterton, but that's because we're dealing with two inactivechemicals. They only act in relation to each other.\r\n",
      "[IAN] But that's the whole point of the experiment, Susan.\r\n",
      "[SUSAN] Yes, it's a bit obvious, isn't it? Well, I'm not trying to berude, but couldn't we deal with two active chemicals? Then red couldturn blue all by itself and get on with something else? I'm sorry, itwas just an idea.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Totter's Lane)\r\n",
      "[IAN] She means it. These simple experiments arechild's play to her.\r\n",
      "[BARBARA] You know, it's almost got to the point where I deliberatelywant to trip her up.\r\n",
      "[IAN] Yes. Something like that happened the other day. I'd set the classa problem with A, B and C as the three dimensions.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Memory - classroom)\r\n",
      "[SUSAN] It's impossible unless you use D and E.\r\n",
      "[IAN] D and E? Whatever for? Do the problem that's set, Susan.\r\n",
      "[SUSAN] I can't, Mister Chesterton. You can't simply work on three ofthe dimensions.\r\n",
      "[IAN] Three of them? Oh, time being the fourth dimension, I suppose?Then what do you need E for? What do you make the fifth dimension?\r\n",
      "[SUSAN] Space.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Totter's Lane)\r\n",
      "[BARBARA] Too many questions and not enoughanswers.\r\n",
      "[IAN] Stupid? Or just doesn't know. So we have a fifteen year old girlwho is absolutely brilliant at some things, and excruciatingly bad atothers.\r\n",
      "[BARBARA] There she is.\r\n",
      "[BARBARA] Look, can we go in now? I hate to think of her alone in thatplace.\r\n",
      "[IAN] If she is alone. Look, she is fifteen. She might be meeting a boy.Didn't that occur to you?\r\n",
      "[BARBARA] I almost hope she is.\r\n",
      "[IAN] What do you mean?\r\n",
      "[BARBARA] Well, it would be so wonderfully normal. It's silly, isn't it?I feel frightened. As if we're about to interfere in something that isbest left alone.\r\n",
      "[IAN] Come on, let's get it over with.\r\n",
      "[BARBARA] Well, don't you feel it?\r\n",
      "[IAN] I take things as they come. Come on.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Junk yard)\r\n",
      "[IAN] What a mess. We're not turning over any of this stuff to findher..\r\n",
      "[BARBARA] Over there?\r\n",
      "[IAN] Blast. I've dropped it.\r\n",
      "[BARBARA] What?\r\n",
      "[IAN] The torch.\r\n",
      "[BARBARA] Well, use a match.\r\n",
      "[IAN] I haven't got any. Oh, never mind.\r\n",
      "[BARBARA] Susan?\r\n",
      "[IAN] Susan? Susan? Susan! Susan. Mister Chesterton and Miss Wright. Shecan't have got out without us seeing her.\r\n",
      "[BARBARA] Ian, look at this.\r\n",
      "[IAN] It's a police box! What on earth's it doing here? These things areusually on the street. Feel it. Feel it. Do you feel it?\r\n",
      "[BARBARA] It's a faint vibration.\r\n",
      "[IAN] It's alive!\r\n",
      "[IAN] It's not connected to anything, unless it's through the floor.\r\n",
      "[BARBARA] Look, I've had enough. Let's go and find a policeman.\r\n",
      "[IAN] Yes, all right.\r\n",
      "[BARBARA] Is that her?\r\n",
      "[IAN] That's not her. Quick.\r\n",
      "[SUSAN [OC]] There you are, Grandfather.\r\n",
      "[BARBARA] It's Susan.\r\n",
      "[IAN] Shush!\r\n",
      "[IAN] Excuse me.\r\n",
      "[DOCTOR] What are you doing here?\r\n",
      "[IAN] We're looking for a young girl.\r\n",
      "[DOCTOR] We?\r\n",
      "[BARBARA] Good evening.\r\n",
      "[DOCTOR] What do you want?\r\n",
      "[IAN] One of our pupils, Susan Foreman, came into this yard.\r\n",
      "[DOCTOR] Really? In here? Are you sure?\r\n",
      "[BARBARA] Yes, we saw her from across the street.\r\n",
      "[DOCTOR] (aside) One of their pupils, not the police, then.\r\n",
      "[IAN] I beg your pardon?\r\n",
      "[DOCTOR] Why were you were spying on her? Who are you?\r\n",
      "[IAN] We heard a young girl's voice call out to you.\r\n",
      "[DOCTOR] Your hearing must be very acute. I didn't hear anything.\r\n",
      "[BARBARA] It came from in here.\r\n",
      "[DOCTOR] You imagined it.\r\n",
      "[BARBARA] I certainly did not imagine it.\r\n",
      "[DOCTOR] Young man, is it reasonable to suppose that anybody would beinside a cupboard like that, hmm?\r\n",
      "[IAN] Would it therefore be unreasonable to ask you to let us have alook inside?\r\n",
      "[DOCTOR] I wonder why I've never seen that before. Now isn't thatstrange. Very damp and dirty.\r\n",
      "[BARBARA] Won't you help us? We're two of her teachers from the CoalHill School. We saw her come in and we haven't seen her leave.Naturally, we're worried.\r\n",
      "[DOCTOR] Have to be cleaned. Hmm? Oh, I'm afraid it's none of mybusiness. I suggest you leave here.\r\n",
      "[IAN] Not until we're satisfied that Susan isn't in there. And frankly,I don't understand your attitude.\r\n",
      "[DOCTOR] Yours leaves a lot to be desired.\r\n",
      "[IAN] Will you open the door?\r\n",
      "[DOCTOR] There's nothing in there.\r\n",
      "[IAN] Then what are you afraid to show us?\r\n",
      "[DOCTOR] Afraid? Oh, go away.\r\n",
      "[IAN] I think we'd better go and fetch a policeman.\r\n",
      "[DOCTOR] Very well.\r\n",
      "[IAN] And you're coming with us.\r\n",
      "[DOCTOR] Oh, am I? I don't think so, young man. No, I don't think so.\r\n",
      "[BARBARA] We can't force him.\r\n",
      "[IAN] But we can't leave him here. Doesn't it seem obvious to you he'sgot her locked up in there? Look at it. There's no door handle. Theremust be a secret lock somewhere.\r\n",
      "[BARBARA] That was Susan's voice.\r\n",
      "[IAN] But of course it was. Susan! Susan! Susan, are you in there? It'sMister Chesterton and Miss Wright, Susan.\r\n",
      "[DOCTOR] Don't you think you're being rather high-handed, young man? Youthought you saw a young girl enter the yard. You imagine you heard hervoice. You believe she might be inside there. It's not verysubstantial, is it?\r\n",
      "[BARBARA] But why won't you help us?\r\n",
      "[DOCTOR] I'm not hindering you. If you both want to make fools ofyourselves, I suggest you do what you said you'd do. Go and find apoliceman.\r\n",
      "[IAN] While you nip off quietly in the other direction.\r\n",
      "[DOCTOR] Insulting. There's only one way in and out of this yard. Ishall be here when you get back. I want to see your faces when you tryto explain away your behaviour to a policeman.\r\n",
      "[IAN] Nevertheless, we're going to find one. Come on, Barbara.\r\n",
      "[SUSAN [OC]] What are you doing out there?\r\n",
      "[IAN] She is in there!\r\n",
      "[DOCTOR] Close the door!\r\n",
      "[IAN] Barbara!\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Tardis)\r\n",
      "[DOCTOR] Close the door, Susan. I believe these people are known to you.\r\n",
      "[SUSAN] They're two of my schoolteachers. What are you doing here?\r\n",
      "[BARBARA] Where are we?\r\n",
      "[DOCTOR] They must have followed you. That ridiculous school. I knewsomething like this would happen if we stayed in one place too long.\r\n",
      "[SUSAN] But why should they follow me?\r\n",
      "[BARBARA] Is this really where you live, Susan?\r\n",
      "[SUSAN] Yes.\r\n",
      "[DOCTOR] And what's wrong with it?\r\n",
      "[IAN] But it was just a telephone box.\r\n",
      "[DOCTOR] Perhaps.\r\n",
      "[BARBARA] And this is your grandfather?\r\n",
      "[SUSAN] Yes.\r\n",
      "[BARBARA] But why didn't you tell us that?\r\n",
      "[DOCTOR] I don't discuss my private life with strangers.\r\n",
      "[IAN] But it was a police telephone box. I walked all around it.Barbara, you saw me.\r\n",
      "[DOCTOR] You don't deserve any explanations. You pushed your way in hereuninvited and unwelcome.\r\n",
      "[BARBARA] I think we ought to leave.\r\n",
      "[IAN] No, just a minute. I know this is absurd, but I feel\r\n",
      "[DOCTOR] Oh dear, dear, dear dear. This is very\r\n",
      "[IAN] I walked all round it.\r\n",
      "[DOCTOR] It's stopped again, you know, and I've tried hmm? Oh, youwouldn't understand.\r\n",
      "[IAN] But I want to understand.\r\n",
      "[DOCTOR] Yes, yes, yes, yes, yes, yes. By the way, Susan, I managed tofind a replacement for that faulty filament. It's an amateur job, but Ithink it'll serve.\r\n",
      "[IAN] It's an illusion. It must be.\r\n",
      "[DOCTOR] What is he talking about now?\r\n",
      "[SUSAN] What are you doing here?\r\n",
      "[DOCTOR] You don't understand, so you find excuses. Illusions, indeed?You say you can't fit an enormous building into one of your smallersitting rooms.\r\n",
      "[IAN] No.\r\n",
      "[DOCTOR] But you've discovered television, haven't you?\r\n",
      "[IAN] Yes.\r\n",
      "[DOCTOR] Then by showing an enormous building on your television screen,you can do what seemed impossible, couldn't you?\r\n",
      "[IAN] Well, yes, but I still don't know\r\n",
      "[DOCTOR] Not quite clear, is it. I can see by your face that you're notcertain. You don't understand. And I knew you wouldn't. Never mind. Nowthen, which switch was it? No. No, no. Ah yes, that is it. The point isnot whether you understand. What is going to happen to you, hmm?They'll tell everybody about the ship now.\r\n",
      "[IAN] Ship?\r\n",
      "[DOCTOR] Yes, yes, ship. This doesn't roll along on wheels, you know.\r\n",
      "[BARBARA] You mean it moves?\r\n",
      "[SUSAN] The Tardis can go anywhere.\r\n",
      "[BARBARA] Tardis? I don't understand you, Susan.\r\n",
      "[SUSAN] Well, I made up the name Tardis from the initials, Time AndRelative Dimension In Space. I thought you'd both understand when yousaw the different dimensions inside from those outside.\r\n",
      "[IAN] Just let me get this straight. A thing that looks like a policebox, standing in a junkyard, it can move anywhere in time and space?\r\n",
      "[SUSAN] Yes.\r\n",
      "[DOCTOR] Quite so.\r\n",
      "[IAN] But that's ridiculous.\r\n",
      "[SUSAN] Why won't they believe us?\r\n",
      "[BARBARA] How can we?\r\n",
      "[DOCTOR] Now, now, don't get exasperated, Susan. Remember the RedIndian. When he saw the first steam train, his savage mind thought itan illusion, too.\r\n",
      "[IAN] You're treating us like children.\r\n",
      "[DOCTOR] Am I? The children of my civilisation would be insulted.\r\n",
      "[IAN] Your civilisation?\r\n",
      "[DOCTOR] Yes, my civilisation. I tolerate this century, but I don'tenjoy it. Have you ever thought what it's like to be wanderers in thefourth dimension? Have you? To be exiles? Susan and I are cut off fromour own planet, without friends or protection. But one day we shall getback. Yes, one day. One day.\r\n",
      "[SUSAN] It's true. Every word of it's true. You don't know what you'vedone coming in here. Grandfather, let them go now, please. Look, ifthey don't understand, they can't, they can't hurt us at all. Iunderstand these people better than you. Their minds reject things theydon't understand.\r\n",
      "[DOCTOR] No.\r\n",
      "[IAN] He can't keep us here.\r\n",
      "[BARBARA] Susan, listen to me. Can't you see that all this is anillusion? It's a game that you and your grandfather are playing, if youlike, but you can't expect us to believe it.\r\n",
      "[SUSAN] It's not a game!\r\n",
      "[BARBARA] But Susan, it's\r\n",
      "[SUSAN] It's not! Look, I love your school. I loved England in thetwentieth century. The last five months have been the happiest of mylife.\r\n",
      "[BARBARA] But you are one of us. You look like us, you sound like us.\r\n",
      "[SUSAN] I was born in another time, another world.\r\n",
      "[IAN] Now look here, Susan, you. Oh, come on, Barbara, let's get out ofhere.\r\n",
      "[SUSAN] It's no use, you can't get out. He won't let you go.\r\n",
      "[IAN] He closed the doors from over there. I saw him. Now, which is it?Which is it? Which control operates the door?\r\n",
      "[DOCTOR] You still think it's all an illusion?\r\n",
      "[IAN] I know that free movement time and space is a scientific dream Idon't expect to find solved in a junkyard.\r\n",
      "[DOCTOR] Your arrogance is nearly as great as your ignorance.\r\n",
      "[IAN] Will you open the door? Open the door! Susan, will you help us?\r\n",
      "[SUSAN] I mustn't.\r\n",
      "[IAN] Very well, then. I'll have to risk it myself.\r\n",
      "[DOCTOR] I can't stop you.\r\n",
      "[SUSAN] Don't touch it! It's live!\r\n",
      "[BARBARA] Ian! What on earth do you think you're doing?\r\n",
      "[SUSAN] Grandfather, let them go now, please.\r\n",
      "[DOCTOR] And by tomorrow we shall be a public spectacle, a subject fornews and idle gossip.\r\n",
      "[SUSAN] But they won't say anything.\r\n",
      "[DOCTOR] My dear child, of course they will. Put yourself in theirplace. They are bound to make some sort of a complaint to theauthorities, or at the very least talk to their friends. If I do letthem go, Susan, you realise of course we must go, too.\r\n",
      "[SUSAN] No, Grandfather, we've had all this out before.\r\n",
      "[DOCTOR] There's no alternative, child.\r\n",
      "[SUSAN] I want to stay! But they're both kind people. Why won't youtrust them? All you've got to do is ask them to promise to keep oursecret\r\n",
      "[DOCTOR] It's out of the question.\r\n",
      "[SUSAN] I won't go, Grandfather. I won't leave the twentieth century.I'd rather leave the Tardis and you.\r\n",
      "[DOCTOR] Now you're being sentimental and childish.\r\n",
      "[SUSAN] No, I mean it.\r\n",
      "[DOCTOR] Very well. Then you must go with them. I'll open the door.\r\n",
      "[BARBARA] Are you coming, Susan?\r\n",
      "[SUSAN] Oh, no, Grandfather! No!\r\n",
      "[DOCTOR] Let me go.\r\n",
      "[SUSAN] No!\r\n",
      "[DOCTOR] Get back to the ship, child. Hold it.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave)\r\n",
      "[MOTHER] Where is the fire Za makes?\r\n",
      "[HUR] (a woman) In his hands. We are not going to the wood.\r\n",
      "[ZA] My father made fire.\r\n",
      "[MOTHER] They killed him for it. It is better that we live as we havealways done.\r\n",
      "[ZA] He showed me how to sharpen the stones and trap the bear and thetiger. He should have shown me this, too.\r\n",
      "[MOTHER] So that everyone would bow to you as they did to him?\r\n",
      "[ZA] Tell me what my father did to make fire.\r\n",
      "[MOTHER] I never saw him make it. That is all I know.\r\n",
      "[ZA] Out of my sight, old woman. You should have died with him.\r\n",
      "[MOTHER] Za will never make fire.\r\n",
      "[ZA] Put on more of the dead fire.\r\n",
      "[HUR] The old men are talking against you, Za. They say it would bebetter for the stranger Kal to lead us.\r\n",
      "[ZA] Kal?\r\n",
      "[HUR] They say you sit all day rubbing your hands together while hebrings us meat.\r\n",
      "[ZA] Without meat, we go hungry. Without fire, we die.\r\n",
      "[HUR] Old men see no further than tomorrow's meat. They will make Kalthe leader. My father will give me to him.\r\n",
      "[ZA] Kal is no leader.\r\n",
      "[HUR] The leader is the one who makes fire.\r\n",
      "[ZA] Where has the fire gone? Where? Where?\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Tardis)\r\n",
      "[BARBARA] Ian? Ian.\r\n",
      "[IAN] I'm all right. I must have hit my head. The movement's stopped.\r\n",
      "[SUSAN] The base is steady.\r\n",
      "[DOCTOR] Layer of sand, rock formation. Good.\r\n",
      "[SUSAN] We've left 1963.\r\n",
      "[DOCTOR] Oh, yes, undoubtedly. I'll be able to tell you where presently.Zero? That's not right. I'm afraid this yearometer is not calculatingproperly. Hm! Well, anyway, the journey's finished. (to Ian) What areyou doing down there?\r\n",
      "[BARBARA] What have you done?\r\n",
      "[IAN] Barbara, you don't believe all this nonsense.\r\n",
      "[SUSAN] Well, look at the scanner screen.\r\n",
      "[DOCTOR] Yes, look up there. They don't understand and I suspect theydon't want to. Well, there you are. A new world for you.\r\n",
      "[IAN] Sand and rock?\r\n",
      "[DOCTOR] Yes, that's the immediate view outside the ship.\r\n",
      "[BARBARA] But where are we?\r\n",
      "[IAN] You mean that's what we'll see when we go outside?\r\n",
      "[SUSAN] Yes, you'll see it for yourself.\r\n",
      "[IAN] I don't believe it.\r\n",
      "[DOCTOR] You really are a stubborn young man, aren't you?\r\n",
      "[IAN] All right, show me some proof. Give me some concrete evidence. I'msorry, Susan, I don't want to hurt you, but it's time you were broughtback to reality.\r\n",
      "[SUSAN] But you're wrong, Mister Chesterton.\r\n",
      "[DOCTOR] They are saying I'm a charlatan. What concrete evidence wouldsatisfy you?\r\n",
      "[IAN] Just open the doors, Doctor Foreman.\r\n",
      "[DOCTOR] Eh? Doctor who? What's he talking about?\r\n",
      "[BARBARA] They're so sure, Ian.\r\n",
      "[IAN] Yes, I know.\r\n",
      "[BARBARA] And remember the difference between the outside of the policebox and the inside.\r\n",
      "[IAN] Yes, I know, but. Are you going to open the doors or aren't you?\r\n",
      "[DOCTOR] No.\r\n",
      "[IAN] You see?\r\n",
      "[DOCTOR] Not until I'm quite sure it's safe to do so. Well, yes, good.Yes, it is, it's good. Excellent, excellent. You've got the radiationcounter there. What's it read?\r\n",
      "[SUSAN] It's reading normal, Grandfather.\r\n",
      "[DOCTOR] Splendid, splendid. Well, I think I'll take my Geiger counterwith me in any case. So, you still challenge me, young man?\r\n",
      "[IAN] Well, just open the doors and prove your point.\r\n",
      "[DOCTOR] You're so narrow-minded, aren't you? Don't be so insular.\r\n",
      "[SUSAN] Grandfather, do you know where we are?\r\n",
      "[DOCTOR] Yes, we've gone back in time, all right. One or two samples andI shall be able to make an estimate. With rock pieces and a few plants.But I do wish this wouldn't keep letting me down. However, we can goout now.\r\n",
      "[IAN] Just a minute. You say we've gone back in time?\r\n",
      "[DOCTOR] Yes, quite so.\r\n",
      "[IAN] So that when we go out of that door, we won't be in a junkyard inLondon in England in the year 1963?\r\n",
      "[DOCTOR] That is quite correct. But your tone suggests ridicule.\r\n",
      "[IAN] But it is ridiculous. Time doesn't go round and round in circles.You can't get on and off whenever you like in the past or the future.\r\n",
      "[DOCTOR] Really? Where does time go, then?\r\n",
      "[IAN] It doesn't go anywhere. It just happens and then it's finished.\r\n",
      "[DOCTOR] (to Barbara) You're not as doubtful as your friend, I hope?\r\n",
      "[BARBARA] No.\r\n",
      "[IAN] Barbara, you can't\r\n",
      "[BARBARA] I can't help it. I just believe them, that's all.\r\n",
      "[DOCTOR] If you could touch the alien sand and hear the cries of strangebirds and watch them wheel in another sky, would that satisfy you?\r\n",
      "[IAN] Yes.\r\n",
      "[DOCTOR] Now, see for yourself.\r\n",
      "[IAN] It's not true. It can't be.\r\n",
      "[SUSAN] That's not on the screen.\r\n",
      "[DOCTOR] Well I've no more time to argue with you. I must get somesamples, Susan.\r\n",
      "[SUSAN] Be careful, Grandfather.\r\n",
      "[DOCTOR] (exiting, muttering) Oh, dear, it's disgusting really.\r\n",
      "[BARBARA] Ian, come out and look.\r\n",
      "[SUSAN] Oh here, lean on me.\r\n",
      "[IAN] No, thank you. I'm all right, thanks.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Wasteland)\r\n",
      "[BARBARA] Well?\r\n",
      "[IAN] But there must be some explanation.\r\n",
      "[DOCTOR] It's still a police box. Why hasn't it changed? Dear, dear, howvery disturbing.\r\n",
      "[BARBARA] What do you think it could be? Ian, look at this.\r\n",
      "[IAN] I don't know. It hasn't got any horns or antlers. Could be ahorse. Could be anything. Incredible. A police box in the midst of. Oh,it just doesn't make sense.\r\n",
      "[SUSAN] It should have changed. Wonder why it hasn't happened this time.\r\n",
      "[BARBARA] The ship, you mean?\r\n",
      "[SUSAN] Yes, it's been an Ionic column and a sedan chair.\r\n",
      "[BARBARA] Disguising itself wherever it goes.\r\n",
      "[SUSAN] Yes, that's right. But it hasn't happened this time. I wonderwhy not. I wonder if this old head would help Grandfather. Where is he?\r\n",
      "[BARBARA] You're very quiet.\r\n",
      "[IAN] I was wrong, wasn't I.\r\n",
      "[BARBARA] Oh, look, I don't understand it any more than you do. Theinside of the ship, suddenly finding ourselves here. Even some of thethings Doctor Foreman says\r\n",
      "[IAN] That's not his name. Who is he? Doctor who? Perhaps if we knew hisname we might have a clue to all this.\r\n",
      "[BARBARA] Look, Ian, the point is, it's happened.\r\n",
      "[IAN] Yes, it has. But it's impossible to accept. I know I'm here\r\n",
      "[SUSAN] I can't see him anywhere.\r\n",
      "[BARBARA] He can't be far away. I had a feeling just now as if we werebeing watched. Grandfather.\r\n",
      "[SUSAN] Grandfather!\r\n",
      "[IAN] Come on!\r\n",
      "[IAN] Look.\r\n",
      "[SUSAN] What is it?\r\n",
      "[BARBARA] Some of his things.\r\n",
      "[SUSAN] Grandfather, where are you?\r\n",
      "[IAN] Susan, don't panic.\r\n",
      "[SUSAN] I must find him.\r\n",
      "[IAN] Susan.\r\n",
      "[SUSAN] I must see.\r\n",
      "[IAN] Well, be careful then.\r\n",
      "[BARBARA] Ian, look.\r\n",
      "[IAN] (broken Geiger counter) It's not much good any more.\r\n",
      "[BARBARA] Well, maybe he saw something and went off to investigate.\r\n",
      "[IAN] Leaving this? (his hat)\r\n",
      "[BARBARA] Well, what do you think happened?\r\n",
      "[IAN] I don't know. Perhaps he was excited and went off to investigatesomething as you suggest, but. He may have been taken.\r\n",
      "[SUSAN] I can't see him. I can't find him anywhere. There's not a signof him.\r\n",
      "[IAN] Calm down, Susan.\r\n",
      "[BARBARA] Susan, don't worry. What's the matter?\r\n",
      "[SUSAN] It's his notes. He'd never leave his notebook. It's tooimportant to him. It's got the key codes of all the machines in theship. It's got notes of everywhere we've been to. Something terriblehas happened to him, I know it has. We must find him.\r\n",
      "[BARBARA] Susan, Susan. We'll find him, I promise you. He can't be faraway.\r\n",
      "[IAN] What's on the other side of those rocks?\r\n",
      "[SUSAN] There's a line of trees. There's a gap in them. There might be apath on the other side.\r\n",
      "[IAN] (gathering up the Doctor's things) All right, we'll try therefirst. Come on. Strange.\r\n",
      "[BARBARA] What?\r\n",
      "[IAN] This sand. It's cold. It's nearly freezing.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave)\r\n",
      "[HORG] Kal says, where he comes from, he's often seen men make fire.\r\n",
      "[ZA] Kal is a liar.\r\n",
      "[HORG] He says Orb will soon show him how it is done.\r\n",
      "[ZA] All his tribe died in the last cold. If he had not found us, hewould have died too.\r\n",
      "[HUR] What else did he say?\r\n",
      "[HORG] He says Orb only shows the secret to the leader.\r\n",
      "[ZA] I am leader. Orb will show me. I am the son of the great firemaker,but he does not show me how to put flames into the sticks. Kal comes. Ido not kill him. I let him eat with us and sleep in our caves. I willhave to spill some blood and make people bow to me.\r\n",
      "[ZA] This is a strange creature.\r\n",
      "[KAL] Is Za, son of the firemaker, afraid of an old man? When will Zamake fire come from his hands?\r\n",
      "[ZA] When Orb decides it.\r\n",
      "[KAL] Orb is for strong men. Orb has sent me this creature to make firecome from his fingers. I have seen it. Inside, he's full of fire. Thesmoke comes from his mouth.\r\n",
      "[ZA] As lies come out of yours. He wears strange skins.\r\n",
      "[KAL] Za is afraid. There was a strange tree. The creature was in it. Zawould have run away had he seen it.\r\n",
      "[ZA] Silence!\r\n",
      "[KAL] When I saw fire come from his fingers I remembered Za, son of thefiremaker. And when the cold comes, you will all die if you wait for Zato make fire for you. I, Kal, am a true leader. We fought like thetiger and the bear. My strength was too much for him. He lay down tosleep. And I, Kal, carried him here to make fire for you.\r\n",
      "[ZA] Why do you listen to Kal?\r\n",
      "[HORG] Za has many good skins. He has forgotten what the cold is like.\r\n",
      "[ZA] Tomorrow, I kill many bears. You all have warm skins.\r\n",
      "[HORG] I say tomorrow you will rub your hands together and hold them tothe dry sticks and ask Orb to send you fire. And the bears will staywarm in their own skins.\r\n",
      "[ZA] What I say I will do, I will do.\r\n",
      "[KAL] The firemaker is dead. You all carry dry sticks with you. Buttonight, I make them burn. I am leader.\r\n",
      "[HUR] The creature has opened its eyes.\r\n",
      "[DOCTOR] Where's my, where.\r\n",
      "[KAL] Do you want fire, or do you want to die in the cold?\r\n",
      "[ALL] Fire! Fire!\r\n",
      "[KAL] When it's cold, the tiger comes to our caves again at night. Zawill give you to the tiger. Za will give you to the cold. Za rubs hishands and waits for Orb to remember him. My creature can make fire comefrom his fingers. I have seen it. But I, Kal, brought him here. Thecreature is mine.\r\n",
      "[ZA] He's just an old man in strange skins. Kal has been with us toolong. It is time he died.\r\n",
      "[HORG] I say there is truth in both of you. Za speaks truth, but firecannot live in men. And Kal speaks the truth that we die without fire.\r\n",
      "[HUR] Will my father listen to a woman? If this old man can make firecome from his fingers, let us see it now.\r\n",
      "[ZA] I say what is to be done here, not old men and women.\r\n",
      "[KAL] Za tries to talk like his father, the firemaker. Za does not wantto see fire made. But I, Kal, am not afraid of fire. I will make mycreature make fire.\r\n",
      "[ZA] I will take him to the Cave of Skulls and he will tell me thesecret!\r\n",
      "[DOCTOR] I can make fire for you. Let me go and I'll make all the fireyou want. You don't have to be afraid of me. I'm an old man. How can anold man like me harm any of you?\r\n",
      "[ZA] What does he say?\r\n",
      "[HORG] Fire? He says he can make fire for us.\r\n",
      "[KAL] He makes it for me and I give you fire. I am firemaker.\r\n",
      "[ZA] He will make it for me.\r\n",
      "[DOCTOR] (searching his pockets) My matches. Where are they? I must getback. Must get back to the ship.\r\n",
      "[KAL] Kal's creature, he makes fire only for Kal.\r\n",
      "[DOCTOR] Take me back to my ship and I will make fire for you. All thefire you want.\r\n",
      "[ZA] This is more of your lies. The old man cannot make fire.\r\n",
      "[KAL] There was a tree and the creature came from in it. And the fire,it came out of his fingers.\r\n",
      "[ZA] You want to be strong like Za, son of the great firemaker. You allheard him say that there would be fire. There is no fire. Za does nottell you lies. He does not say, I will do this thing, and then not doit. He does not say, I will make you warm, and then leave you to thedark. He does not say, I will fight away the tiger with fire, and thenlet him come to you in the dark. Do you want a liar for your chief?\r\n",
      "[ALL] No!\r\n",
      "[KAL] Make fire. Make fire.\r\n",
      "[HUR] You are trapped in your own lies, Kal.\r\n",
      "[ZA] Great chief who is afraid of nothing. Oh great Kal, save us fromthe cold. Save us from the tiger.\r\n",
      "[KAL] Make fire. Make fire come from your fingers as I saw you.\r\n",
      "[DOCTOR] I have no matches. I cannot make fire. I cannot make fire!\r\n",
      "[ZA] Let the old man die. And we'll watch the great Kal as he kills hisstrong enemy.\r\n",
      "[KAL] Make fire! Make fire! Or I kill you now!\r\n",
      "[ZA] Or we'll keep them and make them hunt for us. It's good to havesomeone to laugh at!\r\n",
      "[SUSAN] Grandfather!\r\n",
      "[DOCTOR] If he dies, there will be no fire.\r\n",
      "[MOTHER] Kill her. Kill her.\r\n",
      "[ZA] Wait. You cannot kill all our enemies. When Orb gives fire back tothe sky, let him look down on them. Then that is when they die, and Orbwill give us fire again. Take them to the Cave of Skulls.\r\n",
      "[SUSAN] No! Grandfather!\r\n",
      "[DOCTOR] All right.\r\n",
      "[ZA] The woman is mine.\r\n",
      "[HORG] My daughter is for the leader of the tribe.\r\n",
      "[ZA] Yes, the woman is mine.\r\n",
      "[HORG] I do not like what has happened.\r\n",
      "[ZA] Old men never like new things to happen.\r\n",
      "[HORG] I was a great leader of many men.\r\n",
      "[ZA] Many men, yes. They all dies when Orb left the sky and the greatcold was on the ground. And Orb will give me fire again. To me. Not toyou. Just as you will give me her.\r\n",
      "[HUR] Za will be a strong leader of many men. If you give me to him, hewill remember and always give you meat.\r\n",
      "[MOTHER] There were leaders before there was fire. Fire will kill us allin the end. You should have killed the four strangers. Kill them.\r\n",
      "[ZA] I have said we will wait until Orb shines again. Then they die.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[IAN] Are you all right? Did they hurt you?\r\n",
      "[BARBARA] No. Ian, I'm frightened.\r\n",
      "[IAN] Try and hang on.\r\n",
      "[BARBARA] But how are we going to get out of this?\r\n",
      "[DOCTOR] We should use our cunning. I hope you can get yourself free,Chesterton. I can't. The stench in here. The stench. I'm sorry. It'sall my fault. I'm desperately sorry.\r\n",
      "[SUSAN] Don't blame yourself, Grandfather.\r\n",
      "[DOCTOR] Look at that. Look at it. (skulls)\r\n",
      "[IAN] They're all the same. They've been split open.\r\n",
      "[DOCTOR] Oh, I'm sorry. I'm sorry, it's all myfault. I'm desperately sorry.\r\n",
      "[SUSAN] Oh, don't blame yourself, Grandfather.\r\n",
      "[DOCTOR] Look at those. Look at them. (the skulls)\r\n",
      "[IAN] Yes, they're all the same. They've been split wide open.\r\n",
      "[SUSAN] I've found another piece with a rough edge.\r\n",
      "[IAN] Thank you.\r\n",
      "[IAN] It's no good, it keeps crumbling.\r\n",
      "[DOCTOR] Oh, it's hopeless, hopeless. Even if we do get free, we shallnever move that stone.\r\n",
      "[IAN] There's air coming in here from somewhere.\r\n",
      "[BARBARA] Yes, there is. I can feel it on my face.\r\n",
      "[IAN] It may only be a small opening. Don't count on it.\r\n",
      "[DOCTOR] Well you obviously are.\r\n",
      "[IAN] Of course I am. Any hope is better than none. Don't just lie therecriticising us. Do something. Help us all to get out of here. Oh, thisstone's no good.\r\n",
      "[BARBARA] Well, don't give up, Ian. Please.\r\n",
      "[IAN] Oh, all right.\r\n",
      "[DOCTOR] No, no, don't waste time. Try those bones, they may be. They'resharper, perhaps.\r\n",
      "[IAN] That's a good idea.\r\n",
      "[SUSAN] Grandfather, I knew you'd think of something.\r\n",
      "[DOCTOR] We must all take it in turns and try and cut his hands free.\r\n",
      "[IAN] Surely we should get the girls free?\r\n",
      "[DOCTOR] No, no, we've got to free you first. You're the strongest, andyou may have to defend us.\r\n",
      "[IAN] All right.\r\n",
      "[DOCTOR] Susan, you have a go. My arms are tired.\r\n",
      "[SUSAN] All right.\r\n",
      "[DOCTOR] And don't think of failing.\r\n",
      "[BARBARA] What?\r\n",
      "[DOCTOR] Well, try and remember, if you can, how you and the othersfound your way here. Concentrate on that please.\r\n",
      "[BARBARA] Yes, yes, I'll try. You're trying to help me.\r\n",
      "[DOCTOR] Fear makes companions of all of us. That's right.\r\n",
      "[BARBARA] I never thought once you were afraid.\r\n",
      "[DOCTOR] Fear is with all of us, and always will be. Just like thatother sensation that lives with it.\r\n",
      "[BARBARA] What's that?\r\n",
      "[DOCTOR] Your companion referred to it. Hope. Hope, that's right.\r\n",
      "[MOTHER] You will not make fire.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Outside the cave)\r\n",
      "[ZA] Now tell me.\r\n",
      "[HUR] I saw the old woman take your knife.\r\n",
      "[ZA] Why did you let her? She's old, you could have held her.\r\n",
      "[HUR] Why did she take it?\r\n",
      "[ZA] She has gone into the forest.\r\n",
      "[HUR] No. She's going to kill the strangers.\r\n",
      "[ZA] Did she say this?\r\n",
      "[HUR] No, but she took your knife. She is afraid of fire.\r\n",
      "[ZA] You should have stopped her.\r\n",
      "[HUR] Kal was in the cave. Leaders are awake when others sleep. Thestrange tribe will not be able to show you how to make fire if the oldwoman kills them.\r\n",
      "[ZA] If I stop her from killing them, they will give fire to me. And notto Kal. The woman could not have got into the cave. The great stone isstill there. Why do you tell me this?\r\n",
      "[HUR] No! No!\r\n",
      "[ZA] The old woman is talking to them.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[MOTHER] I will set you free if you will go awayand not make fire. Fire will bring trouble and death to the tribe.\r\n",
      "[DOCTOR] There will be no fire.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Outside the cave)\r\n",
      "[HUR] No, we cannot move the great stone.\r\n",
      "[ZA] The old woman is talking to them. I will move it.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[MOTHER] Hurry, hurry. You must go across the tuft and into the trees.\r\n",
      "[IAN] Yes.\r\n",
      "[HUR] She set them free!\r\n",
      "[MOTHER] They would have made fire. They would have made fire! No.\r\n",
      "[ZA] They have gone into the night.\r\n",
      "[HUR] They have taken fire with them.\r\n",
      "[ZA] The beasts will kill them. They will kill us if we follow.\r\n",
      "[HUR] Now, you are leader. You are as strong as the beasts. You will bestronger still when you know how fire is made. Stronger than Kal.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Forest)\r\n",
      "[DOCTOR] Stop. Just a minute, let me get my\r\n",
      "[IAN] We can't stop here.\r\n",
      "[DOCTOR] Just a moment.\r\n",
      "[IAN] Look, we've got to go further on.\r\n",
      "[DOCTOR] I know. I know that. But I must get. Breathe. I must breathe.\r\n",
      "[IAN] Try. Try. I shall have to carry you.\r\n",
      "[DOCTOR] There's no need for that. Don't be so childish. I'm not senile.Just let me get my breath for a moment.\r\n",
      "[SUSAN] Oh, Grandfather, come on.\r\n",
      "[DOCTOR] Yes. I'm not so young, you know.\r\n",
      "[BARBARA] Are you sure this is the right way?\r\n",
      "[IAN] Yes, I think so.\r\n",
      "[BARBARA] I can't remember. I simply can't remember.\r\n",
      "[IAN] We're free, Barbara. Think about that. Free.\r\n",
      "[BARBARA] Yes. Yes.\r\n",
      "[SUSAN] I'm sure I remember this place. But we didn't come round it, wewent across it.\r\n",
      "[BARBARA] Yes, there was a sort of trail.\r\n",
      "[IAN] If that's true, we must be quite near the ship. How are youfeeling?\r\n",
      "[DOCTOR] I'm all right. Don't keep on looking upon me as the weakestlink of the party.\r\n",
      "[IAN] What's the matter?\r\n",
      "[BARBARA] I don't know. I saw something. Over there in the bushes.\r\n",
      "[DOCTOR] What nonsense.\r\n",
      "[BARBARA] The bushes moved. I saw them. I saw them! Oh, we're nevergoing to get out of this awful place! Never! Never! Never!\r\n",
      "[IAN] Barbara.\r\n",
      "[SUSAN] What do you think it could have been, Grandfather?\r\n",
      "[DOCTOR] Oh, sheer nonsense, child. Imagination.\r\n",
      "[BARBARA] We'll die in this place.\r\n",
      "[IAN] Barbara, no we won't. We're going to get back to the ship and thenwe'll be safe.\r\n",
      "[BARBARA] Oh, Ian, what's happening to us?\r\n",
      "[IAN] Look, Barbara, we got out of the cave, didn't we?\r\n",
      "[SUSAN] I'm so cold.\r\n",
      "[DOCTOR] I'm hot with all this exertion.\r\n",
      "[IAN] We'll rest for a couple of minutes.\r\n",
      "[SUSAN] Oh, good. Is there any chance of them following us?\r\n",
      "[DOCTOR] I expect so.\r\n",
      "[IAN] Yes, that's why I don't want to stop here too long.\r\n",
      "[DOCTOR] Do you think I want to?\r\n",
      "[IAN] No. We'll change the order. You and Susan go in front, Barbara andI'll bring up the rear. Susan seems to remember the way better than anyof us.\r\n",
      "[DOCTOR] You seem to have elected yourself leader of this little party.\r\n",
      "[IAN] There isn't time to vote on it.\r\n",
      "[DOCTOR] Just so long as you understand I won't follow your ordersblindly.\r\n",
      "[IAN] If there were only two of us, you could find your own way back tothe ship.\r\n",
      "[DOCTOR] Aren't you a tiresome young man!\r\n",
      "[IAN] And you're a stubborn old man. But you will lead, the girls inbetween, and I'll bring up the rear. Because that's the safest way.Barbara was probably right. I thought we heard something when westopped back there.\r\n",
      "[DOCTOR] Oh, sheer imagination.\r\n",
      "[IAN] Why are you so confident about it?\r\n",
      "[DOCTOR] I won't allow myself to be frightened out of my wits by mereshadows, that's all.\r\n",
      "[IAN] All right.\r\n",
      "[HUR] Look, there is a branch broken.\r\n",
      "[ZA] They have strange feet.\r\n",
      "[HUR] They wear skins on their feet.\r\n",
      "[ZA] There are marks here.\r\n",
      "[HUR] They've gone this way.\r\n",
      "[ZA] It was wrong to do this. We should not have followed them.\r\n",
      "[HUR] We cannot turn back now.\r\n",
      "[IAN] I think we'd better get going. Doctor, will you lead?\r\n",
      "[DOCTOR] Yes, yes, yes, yes.\r\n",
      "[IAN] Come on, Barbara.\r\n",
      "[IAN [OC]] Barbara, Barbara.\r\n",
      "[ZA] Down here. That was one of the women.\r\n",
      "[SUSAN] A dead animal.\r\n",
      "[DOCTOR] It must have just been killed. By a larger animal, too.\r\n",
      "[IAN] Shush. Shush. That must be them. They followed us. Quick, quick.Over there.\r\n",
      "[IAN] Keep down, and not a sound.\r\n",
      "[ZA] Wait. There is danger. I will go.\r\n",
      "[IAN] Quick, now's our chance. Let's get away. Run!\r\n",
      "[BARBARA] Look at them. We can't just leave them! I don't care whatthey've done.\r\n",
      "[IAN] Barbara. Barbara, come on.\r\n",
      "[BARBARA] I think he's dead. There isn't any danger.\r\n",
      "[IAN] Barbara, for heaven's sake.\r\n",
      "[BARBARA] No.\r\n",
      "[SUSAN] I'm going too.\r\n",
      "[DOCTOR] Susan! You stay here with me.\r\n",
      "[SUSAN] No, Grandfather. We can't leave them.\r\n",
      "[DOCTOR] Silence! We're going back to the ship.\r\n",
      "[SUSAN] No!\r\n",
      "[DOCTOR] What are you doing? They must be out of their minds.\r\n",
      "[HUR] No, keep away.\r\n",
      "[IAN] Let me look at him.\r\n",
      "[HUR] No.\r\n",
      "[IAN] I am your friend. You understand? Friend. I want to help him.\r\n",
      "[HUR] Friend?\r\n",
      "[IAN] I want water.\r\n",
      "[HUR] Water.\r\n",
      "[IAN] Go and fetch some water for his wounds.\r\n",
      "[HUR] Water is there.\r\n",
      "[BARBARA] Please, show me. Give me your handkerchief.\r\n",
      "[IAN] Here you are.\r\n",
      "[SUSAN] Is he all right?\r\n",
      "[IAN] I think so. He must have buried his axe head in the animal. Thankyou.\r\n",
      "[HUR] Water comes out of the skin!\r\n",
      "[IAN] Yes. I think most of this is the animal's blood.\r\n",
      "[SUSAN] Good.\r\n",
      "[BARBARA] There's a scar on the side of his head.\r\n",
      "[IAN] Well, we've lost our chance of getting away. Your flat must belittered with stray cats and dogs.\r\n",
      "[BARBARA] These are human beings, Ian.\r\n",
      "[IAN] Yes, I know.\r\n",
      "[DOCTOR] What exactly do you think you're doing?\r\n",
      "[IAN] Have you got any antiseptic in the ship?\r\n",
      "[SUSAN] Yes, lots.\r\n",
      "[DOCTOR] One minute ago we were trying desperately to get away fromthese savages.\r\n",
      "[IAN] All right, now we're helping them. You're a doctor, do something.\r\n",
      "[DOCTOR] I'm not a doctor of medicine.\r\n",
      "[SUSAN] Grandfather, we can make friends with them.\r\n",
      "[DOCTOR] Oh, don't be ridiculous, child.\r\n",
      "[BARBARA] Why? You treat everybody and everything as something lessimportant than yourself.\r\n",
      "[DOCTOR] You're trying to say that everything you do is reasonable, andeverything I do is inhuman. Well, I'm afraid your judgement's at fault,Miss Wright, not mine. Haven't you realised if these two people canfollow us, any of these people can follow us? The whole tribe mightdescend upon us at any moment.\r\n",
      "[HUR] The tribe is asleep.\r\n",
      "[DOCTOR] And what about the old woman who cut our bonds? You understand?\r\n",
      "[IAN] He's right. We're too exposed here. We'll make a stretcher andcarry him.\r\n",
      "[DOCTOR] You're not going to take him back to the ship?\r\n",
      "[IAN] Take your coat off, Barbara. Susan, try and find me two poles.Long ones, fairly straight.\r\n",
      "[BARBARA] The old woman won't give us away. She helped.\r\n",
      "[DOCTOR] Do you think so? These people have logic and reason, have they?Can't you see their minds change as rapidly as night and day? She'sprobably telling the whole tribe at this very moment.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[KAL] The creatures. Where? Where?\r\n",
      "[MOTHER] Gone.\r\n",
      "[KAL] The great stone. They could not move it.\r\n",
      "[MOTHER] Za moved it.\r\n",
      "[KAL] Za has gone with them?\r\n",
      "[MOTHER] Za and Hur went after them.\r\n",
      "[KAL] There were skins around their hands and their feet. They could notmove. Za helped them to get free? They're gone with Za to show himfire?\r\n",
      "[MOTHER] They won't make fire. There won't be fire any more.\r\n",
      "[KAL] Old woman, you helped them.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Forest)\r\n",
      "[IAN] It's not going to work like this. What can wedo?\r\n",
      "[HUR] No! He's mine.\r\n",
      "[SUSAN] I was only trying to help.\r\n",
      "[IAN] She doesn't understand, Susan. She's jealous of you.\r\n",
      "[HUR] I don't understand what you are doing. You are like a mother witha child. Why do you not kill?\r\n",
      "[IAN] How can we explain to her? She doesn't understand kindness,friendship.\r\n",
      "[BARBARA] We will make him well again. We will teach you how to makefire. In return, you show us the way back to our cave.\r\n",
      "[ZA] Listen to them. They do not kill.\r\n",
      "[IAN] Come on. Let's get on with this stretcher. Let's try the sleevesinside. That's it.\r\n",
      "[ZA] Water.\r\n",
      "[HUR] Water.\r\n",
      "[IAN] How about giving us a hand, Doctor?\r\n",
      "[SUSAN] He's always like this if he doesn't get his own way.\r\n",
      "[BARBARA] The old woman won't give us away. And now that we've got thesetwo on our side, we should get back to the ship.\r\n",
      "[SUSAN] Yes.\r\n",
      "[DOCTOR] Get your hand off me.\r\n",
      "[IAN] What are you doing?\r\n",
      "[DOCTOR] Well, I, I was going to get him to draw our way back to theTardis.\r\n",
      "[IAN] We've been too long as it is. Is the stretcher ready?\r\n",
      "[BARBARA] Yes.\r\n",
      "[IAN] Right, you take one end of it.\r\n",
      "[DOCTOR] You don't expect me to carry him, do you?\r\n",
      "[IAN] Do you want the women to do the job for you?\r\n",
      "[DOCTOR] Oh, very well.\r\n",
      "[IAN] Right, now move him over very carefully. Now, back again, gently.\r\n",
      "[IAN] Good. Right, now, Susan, you get in front with her.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave)\r\n",
      "[KAL] They have gone. Za and Hur have gone withthem and we must go after them.\r\n",
      "[HORG] Hur would not help them to get away.\r\n",
      "[KAL] She has gone with them.\r\n",
      "[HORG] The old woman sleeps in the cave too, and she has gone.\r\n",
      "[KAL] The old woman is in the Cave of Skulls.\r\n",
      "[HORG] Hur would not go with them!\r\n",
      "[KAL] Ask the old woman. She will tell what is done.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[KAL] She will tell.\r\n",
      "[KAL] My eyes tell me what has happened. As they do when I sleep and Isee things. Za and Hur came to free them, and find a way to make fire.The old woman saw them. Za killed old woman.\r\n",
      "[HORG] The old woman is dead. It must have been as your eyes said itwas.\r\n",
      "[KAL] Za has gone with them, taking them to their cave. Za takes awayfire. Now I, Kal, lead. Go!\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Forest)\r\n",
      "[IAN] Hold the branches back, Susan.\r\n",
      "[SUSAN] The Tardis! There's the Tardis!\r\n",
      "[IAN] Back! Back! Go back.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Forest)\r\n",
      "[IAN] Back. Get back.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave)\r\n",
      "[HORG] They are coming.\r\n",
      "[KAL] Za and the woman went with them. I, Kal, stop them.\r\n",
      "[HUR] They saved Za from death near the stream.\r\n",
      "[KAL] They set them free from the Cave of Skulls and went with them.\r\n",
      "[HUR] The old woman cut them free.\r\n",
      "[KAL] Za is so weak a woman speaks for him.\r\n",
      "[HUR] It was the old woman. She showed them a new way out of the Cave ofSkulls.\r\n",
      "[KAL] The old woman does not speak. She does not say she did this or didthat. The old woman is dead. Za killed the old woman.\r\n",
      "[HUR] No!\r\n",
      "[KAL] Za killed the old woman with his knife.\r\n",
      "[HUR] No.\r\n",
      "[KAL] Here. Here is the knife he killed her with.\r\n",
      "[DOCTOR] This knife has no blood on it. I said, this knife has no bloodon it.\r\n",
      "[KAL] It is a bad knife. It does not show the things it does.\r\n",
      "[DOCTOR] It is a finer knife than yours.\r\n",
      "[KAL] I, Kal, say it is a bad knife.\r\n",
      "[DOCTOR] This knife can cut and stab. I have never seen a better knife.\r\n",
      "[KAL] I will show you one.\r\n",
      "[DOCTOR] This knife shows what it has done. There is blood on it. (toZa) Who killed the old woman?\r\n",
      "[ZA] I did not kill her.\r\n",
      "[DOCTOR] (to Kal) You killed the old woman.\r\n",
      "[KAL] Yes! She set them free. She set them free. She did this. I, Kal,killed her.\r\n",
      "[DOCTOR] Is this your strong leader? One who kills your old women? He isa bad leader. He will kill you all. Yes, all. (to Ian) Follow myexample.\r\n",
      "[DOCTOR] Drive him out. Out.\r\n",
      "[IAN] Yes, drive him out. He killed the old woman.\r\n",
      "[TRIBE] Drive him out.\r\n",
      "[IAN] Remember, Kal is not stronger than the whole tribe.\r\n",
      "[ZA] Kal is no longer one of this tribe. We will watch for him. We willall fight Kal if he comes back. We will watch for him. Take them to theCave of Skulls.\r\n",
      "[IAN] Take us back to the desert and we will make fire for you.\r\n",
      "[ZA] The great stone will close one place, and you will stand by anotherI will show you. Take them.\r\n",
      "[DOCTOR] Don't struggle.\r\n",
      "[ZA] They are inside the cave. You see them come out, kill them.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[DOCTOR] This place is evil.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave)\r\n",
      "[ZA] Tell me what happened after I fought the beastin the forest.\r\n",
      "[HUR] You were stronger than the beast. It took away your axe in itshead. You lay on the earth. I believed you were dead.\r\n",
      "[ZA] Tell me what they did.\r\n",
      "[HUR] The young man of their tribe came towards you, but he did notkill. He told me his name.\r\n",
      "[ZA] Name?\r\n",
      "[HUR] His name is Friend.\r\n",
      "[ZA] They come from the other side of the mountains.\r\n",
      "[HUR] Nothing lives there.\r\n",
      "[ZA] There are other tribes there. This new tribe must come from there.Tell me more of what happened.\r\n",
      "[HUR] I did not understand them. Their hands moved slowly and theirfaces were not fierce. It was like a mother guarding her baby.\r\n",
      "[ZA] They are a new tribe. Not like us. Not like Kal. The young one,whose name is Friend, spoke to me.\r\n",
      "[HUR] Do you remember it?\r\n",
      "[ZA] He said, Kal is not stronger than the whole tribe.\r\n",
      "[HUR] I do not understand.\r\n",
      "[ZA] The whole tribe drove Kal away with the stones. The whole tribe cancollect more fruit than one. The whole tribe can kill a beast where oneof the tribe would die.\r\n",
      "[HUR] Do you think they come from Orb?\r\n",
      "[ZA] No. They are a tribe who know how fire is made, but they do notwant to tell us.\r\n",
      "[HUR] Then you will not kill them?\r\n",
      "[ZA] Horg says the leader must know how fire is made. I do not want tobe driven into the forest like Kal. I must make fire, or they must die,as the old men say. I will speak with him. I must hear more things toremember. The leader would have things to remember.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[SUSAN] I think this is what you want, Mister Chesterton.\r\n",
      "[IAN] Thank you.\r\n",
      "[BARBARA] Here are some leaves, and some dead grass.\r\n",
      "[IAN] Yes, well spread them around the hole. Don't put them inside. Ihope this is going to work. Now, spread them around a bit more. Yes,that's it.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Outside the second exit)\r\n",
      "[ZA] (to guard) I will speak with them. You waithere.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[SUSAN] I can smell something.\r\n",
      "[BARBARA] Yes, so can I.\r\n",
      "[SUSAN] It's burning! It's burning!\r\n",
      "[IAN] It's a long way off yet.\r\n",
      "[ZA] What is this?\r\n",
      "[DOCTOR] We are making fire.\r\n",
      "[ZA] You are called Friend?\r\n",
      "[IAN] Yes.\r\n",
      "[DOCTOR] Don't stop.\r\n",
      "[ZA] Hur said you were called Friend. I am called Za. You are the leaderof your tribe?\r\n",
      "[IAN] No. He is our leader.\r\n",
      "[SUSAN] Are you going to set us free?\r\n",
      "[ZA] The tribe say you are from Orb and when you are returned to him onthe stone of death, we will have fire again.\r\n",
      "[BARBARA] But that's not true.\r\n",
      "[ZA] I think you are from the other side of the mountains. If you showme how to make fire, I will take you back to the foot of the mountains.If you do not show me, I cannot stop you dying on the old stone.\r\n",
      "[IAN] Put some more leaves and grass round it. I think it's beginning towork.\r\n",
      "[DOCTOR] Do you understand? We are making fire for you.\r\n",
      "[ZA] I am watching.\r\n",
      "[IAN] The whole tribe should be watching. Everyone should know how tomake fire.\r\n",
      "[ZA] Everyone cannot be leader.\r\n",
      "[IAN] No, that's perfectly true. But in our tribe, the firemaker is theleast important man.\r\n",
      "[ZA] Ha! I do not believe this.\r\n",
      "[DOCTOR] He is the least important because we can all make fire.\r\n",
      "[SUSAN] I hope he doesn't make Grandfather prove that.\r\n",
      "[IAN] Look, I think it's beginning to work. Susan, Barbara, blow gently.That's it!\r\n",
      "[SUSAN] We've done it.\r\n",
      "[IAN] Yes.\r\n",
      "[ZA] Fire. Fire.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave)\r\n",
      "[HORG] Orb strikes the old stone and Za does notbring them out. We have no meat, and no fruit from the trees, and noroots. Za is no leader.\r\n",
      "[HUR] Za would kill you if he could hear you. He's talking now with themin the Cave of Skulls. You should lie on the old stone until your bloodruns into the earth.\r\n",
      "[HORG] Za is letting them go away, just as the old woman set them free.\r\n",
      "[HUR] Za told one of them to watch and guard them until he came out ofthe Cave of Skulls.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "(Cave)\r\n",
      "[HORG] Orb is above us and there is no fire. Bringthem out from the Cave of Skulls and Za as well. Come on.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[IAN] Take this, and show it to your tribe.\r\n",
      "[ZA] You, stay here.\r\n",
      "[IAN] We will come with you.\r\n",
      "[ZA] No, you'll stay here.\r\n",
      "[IAN] I will come with you.\r\n",
      "[DOCTOR] Give him a chance. Give him a chance. Let him show the tribefire, establish himself as leader, then he'll let us go.\r\n",
      "[IAN] But we ought to go with him now.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave)\r\n",
      "[ZA] Fire.\r\n",
      "[TRIBE] Fire.\r\n",
      "[ZA] Kal is dead. I give you fire. I am leader. We will give food andwater to the new tribe in the Cave of Skulls.\r\n",
      "[HORG] There is no meat.\r\n",
      "[ZA] I will go into the forest and get meat.\r\n",
      "[HORG] Yes. I remember how the meat and fire joined together.\r\n",
      "[ZA] Good. Watch the new tribe. They must be here when I return.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Cave of Skulls)\r\n",
      "[IAN] It didn't work. They're going to keep ushere.\r\n",
      "[IAN] Why are you keeping us here?\r\n",
      "[HUR] Za has gone into the forest to find meat. There will be more foodlater.\r\n",
      "[BARBARA] But why can't we go outside?\r\n",
      "[SUSAN] Please let us go. It's terrible in here.\r\n",
      "[HUR] Za is leader.\r\n",
      "[SUSAN] But we helped you. We gave you fire.\r\n",
      "[HUR] We have fire now.\r\n",
      "[IAN] Yes. And I was the fool who gave it to you. Why didn't I wait?\r\n",
      "[BARBARA] Well at least we're alive. We wouldn't be if we hadn't giventhem fire.\r\n",
      "[BARBARA] Ian.\r\n",
      "[SUSAN] They brought us some meat.\r\n",
      "[BARBARA] And the Doctor found a stone with a hole in it, and theyfilled it with water.\r\n",
      "[IAN] All the comforts of home.\r\n",
      "[ZA] The animal was hard to kill. The meat on it is good. They havebrought you fruit and water has been put into a stone. Is this thestone? Has anyone hurt you?\r\n",
      "[DOCTOR] When are you going to let us go, hmm?\r\n",
      "[ZA] You will stay here. I have the meat and I have the stick, and apiece of skin. I can make fire now. Your tribe and my tribe will jointogether.\r\n",
      "[IAN] We don't want to stay here.\r\n",
      "[ZA] Why? There is no better place the other side of the mountains. Donot try to leave here.\r\n",
      "[DOCTOR] Quench the fire. Take the fire away from them. Scaring them,somehow.\r\n",
      "[SUSAN] (putting a skull on top of a burning brand) Hey, Grandfather,look! It's almost alive.\r\n",
      "[IAN] Not alive, Susan. Almost dead. We're going to make four torches.We'll find the sticks. And we'll use the fat from the meat. And then\r\n",
      "[SUSAN] And then?\r\n",
      "[IAN] And then, to all intents and purposes, we're going to die.\r\n",
      "[IAN] When I give the sign.\r\n",
      "[SUSAN] What are they?\r\n",
      "[ZA] Look. It is nothing but fire and the bones of the dead. They havegone! While we look at their fire, they have gone!\r\n",
      "[HUR] Into the night. The dark will hide them.\r\n",
      "[ZA] With fire, it is day.\r\n",
      "\r\n",
      "---------------------------------------\r\n",
      "\r\n",
      "(Desert)\r\n",
      "(Tardis)\r\n",
      "[IAN] Come on, Doctor, get us off! Get us off!\r\n",
      "[DOCTOR] Yes.\r\n",
      "[DOCTOR] Yes, it's matching up.\r\n",
      "[SUSAN] We're beginning to land.\r\n",
      "[DOCTOR] Oh, how I wish.\r\n",
      "[IAN] Have you taken us back to our own time?\r\n",
      "[DOCTOR] You know I can't do that. Please be reasonable.\r\n",
      "[IAN] What?\r\n",
      "[BARBARA] Please, you must take us back. You must.\r\n",
      "[DOCTOR] You see, this isn't operating properly. Or rather, the code isstill a secret. When you put the right data, precise information to asecond of the beginning of a journey, then we can fix a destination,but I had no data at my disposal.\r\n",
      "[BARBARA] Are you saying that you don't know how to work this thing?\r\n",
      "[DOCTOR] Well of course I can't. I'm not a miracle worker.\r\n",
      "[SUSAN] You can't blame Grandfather. We left the other place tooquickly, that's all.\r\n",
      "[IAN] Just a minute. Did you try and take us back to our own time?\r\n",
      "[DOCTOR] Well, I got you away from that other time, didn't I?\r\n",
      "[IAN] That isn't what I asked you.\r\n",
      "[DOCTOR] It's the only way I can answer you, young man. Now. Now weshall see.\r\n",
      "[DOCTOR] It could be anywhere. Dear, dear, dear, dear. It's no help tous at all. Well, I suggest before we go outside and explore, let usclean ourselves up.\r\n",
      "[SUSAN] Oh, yes.\r\n",
      "[DOCTOR] Now what does the radiation read, Susan?\r\n",
      "[SUSAN] It's reading normal, Grandfather.\r\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(doctor[\"TEXT\"].values[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Doctor Who (23 Nov, 1963; First Doctor) - An U...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Doctor Who (21 Dec, 1963; First Doctor) - The ...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Doctor Who (8 Feb, 1964; First Doctor) - The E...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Doctor Who (22 Feb, 1964; First Doctor) - Marc...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Doctor Who (11 Apr, 1964; First Doctor) - The ...</td>\n",
       "      <td>{\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...</td>\n",
       "      <td>drwho/jeanmidev</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                TEXT  \\\n",
       "0  Doctor Who (23 Nov, 1963; First Doctor) - An U...   \n",
       "1  Doctor Who (21 Dec, 1963; First Doctor) - The ...   \n",
       "2  Doctor Who (8 Feb, 1964; First Doctor) - The E...   \n",
       "3  Doctor Who (22 Feb, 1964; First Doctor) - Marc...   \n",
       "4  Doctor Who (11 Apr, 1964; First Doctor) - The ...   \n",
       "\n",
       "                                            METADATA           SOURCE  \n",
       "0  {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "1  {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "2  {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "3  {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  \n",
       "4  {\"show\": \"Doctor Who\", \"season\": \"s01\", \"episo...  drwho/jeanmidev  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "doctor.to_parquet(\"drwho.pq\", row_group_size=100, engine=\"pyarrow\", index=False)\n",
    "doctor.head()  # https://www.kaggle.com/datasets/jeanmidev/doctor-who?select=all-scripts.csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "306"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(doctor)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Star Trek"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['DS9', 'TOS', 'TAS', 'TNG', 'VOY', 'ENT'])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Star Trek via http://www.chakoteya.net/StarTrek/index.html and also https://github.com/GJBroughton/Star_Trek_Scripts/\n",
    "r = requests.get(\"https://github.com/GJBroughton/Star_Trek_Scripts/raw/master/data/all_scripts_raw.json\")\n",
    "trek = r.json()\n",
    "trek.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:22<00:00,  3.68s/it]\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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>The Deep Space Nine - Emissary\\n\\nEmissary\\nSt...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>The Deep Space Nine - Past Prologue\\n\\nPast\\nP...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>The Deep Space Nine - A Man Alone\\n\\nA\\nMan Al...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>The Deep Space Nine - Babel\\n\\nBabel\\nStardate...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>The Deep Space Nine - Captive Pursuit\\n\\nCapti...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>703</th>\n",
       "      <td>The Enterprise - In A Mirror, Darkly - part 1\\...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>704</th>\n",
       "      <td>The Enterprise - In A Mirror, Darkly - part 2\\...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>705</th>\n",
       "      <td>The Enterprise - Demons\\n\\nDemons\\n[Mission Da...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>706</th>\n",
       "      <td>The Enterprise - Terra Prime\\n\\nTerra\\nPrime\\n...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>707</th>\n",
       "      <td>The Enterprise - These Are The Voyages...\\n\\nT...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>708 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  TEXT  \\\n",
       "0    The Deep Space Nine - Emissary\\n\\nEmissary\\nSt...   \n",
       "1    The Deep Space Nine - Past Prologue\\n\\nPast\\nP...   \n",
       "2    The Deep Space Nine - A Man Alone\\n\\nA\\nMan Al...   \n",
       "3    The Deep Space Nine - Babel\\n\\nBabel\\nStardate...   \n",
       "4    The Deep Space Nine - Captive Pursuit\\n\\nCapti...   \n",
       "..                                                 ...   \n",
       "703  The Enterprise - In A Mirror, Darkly - part 1\\...   \n",
       "704  The Enterprise - In A Mirror, Darkly - part 2\\...   \n",
       "705  The Enterprise - Demons\\n\\nDemons\\n[Mission Da...   \n",
       "706  The Enterprise - Terra Prime\\n\\nTerra\\nPrime\\n...   \n",
       "707  The Enterprise - These Are The Voyages...\\n\\nT...   \n",
       "\n",
       "                                              METADATA              SOURCE  \n",
       "0    {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "1    {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "2    {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "3    {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "4    {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "..                                                 ...                 ...  \n",
       "703  {\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...  startrek/chakoteya  \n",
       "704  {\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...  startrek/chakoteya  \n",
       "705  {\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...  startrek/chakoteya  \n",
       "706  {\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...  startrek/chakoteya  \n",
       "707  {\"show\": \"Star Trek\", \"season\": \"ENT\", \"episod...  startrek/chakoteya  \n",
       "\n",
       "[708 rows x 3 columns]"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "picard = {\"TEXT\": [], \"METADATA\": [], \"SOURCE\": []}\n",
    "for series in tqdm(trek.keys()):\n",
    "    for episode in trek[series].keys():\n",
    "        script = trek[series][episode].replace(\"[\", \"(\").replace(\"]\", \")\").strip()\n",
    "        try:\n",
    "            title = \" \".join(re.findall(r\"^.+?\\-\\s*(.+?)\\r?\\n\", script)[0].splitlines()).strip()\n",
    "        except IndexError:\n",
    "            title = \" \".join(script.split(\"Stardate:\")[0].splitlines()).strip()\n",
    "        metadata = {\n",
    "            \"show\": \"Star Trek\",\n",
    "            \"season\": series,\n",
    "            \"episode\": f\"e{episode.split()[1].zfill(2)}\",\n",
    "            \"title\": title,\n",
    "        }\n",
    "        text = \"\"\n",
    "        for i, line in enumerate(script.splitlines()):\n",
    "            if i == 0:\n",
    "                text += re.sub(r\"(?i)((?:trans?)scripts?)\\s*\", \"\", line.strip()) + \"\\r\\n\"\n",
    "                continue\n",
    "            if line == \"<Back\":\n",
    "                break\n",
    "            match = re.findall(r\"(?i)\\s*([\\w\\d\\s\\.]+(?:\\([\\w\\d\\s\\.]+\\))?)\\s*\\:\\s*(.+?)$\", line)\n",
    "            if match:\n",
    "                speaker, voice = match[0]\n",
    "                if speaker not in (\"Stardate\", \"Original Airdate\"):\n",
    "                    text += f\"[{speaker}] {voice}\\r\\n\"\n",
    "                else:\n",
    "                    text += f\"{line.strip()}\\r\\n\"\n",
    "            else:\n",
    "                text += f\"{line.strip()}\\r\\n\"\n",
    "\n",
    "        text = text.strip().replace(\"&amp;\", \"&\")\n",
    "        text = \"\\r\\n\".join(text.splitlines())\n",
    "        text = re.sub(r\"(\\r*\\n)\", \"\\n\", text)\n",
    "        text = re.sub(r\"\\n{2,}\", \"\\n\\n\", text).strip()\n",
    "\n",
    "        picard[\"TEXT\"].append(text)\n",
    "        picard[\"METADATA\"].append(json.dumps(metadata))\n",
    "        picard[\"SOURCE\"].append(\"startrek/chakoteya\")\n",
    "\n",
    "picard = pd.DataFrame(picard)\n",
    "picard"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Next Generation - Time's Arrow part two\n",
      "\n",
      "Time's\n",
      "Arrow, part 2\n",
      "Stardate:\n",
      "46001.3\n",
      "Original Airdate: 21 Sep, 1992\n",
      "\n",
      "Last\n",
      "[the Next Generation. LAFORGE] They found Data's head a mile beneath San Francisco. Been down\n",
      "there about five centuries.\n",
      "[DATA] At some future date I will be transported back to nineteenth\n",
      "century Earth, where I will die. It has occurred. It will occur.\n",
      "[GUINAN] Do I know you, Mister? \n",
      "[DATA] Data. Yes. We were on a ship together. The Enterprise. \n",
      "[GUINAN] Is that a clipper ship? \n",
      "[DATA] It is a starship. \n",
      "[CLEMENS] Starship? \n",
      "[RIKER] My God. They're delivering more of them for the others to\n",
      "ingest.\n",
      "[GUINAN] Did my father send you here? Because if he did, you must go\n",
      "back and tell him I'm not done listening to\n",
      "[DATA] I was not sent by your father. Our ship encountered a species who\n",
      "appears to be threatening nineteenth century Earth.\n",
      "[RIKER] I'm not willing to accept that he's dead and just leave it at\n",
      "that.\n",
      "[PICARD] We cannot make Mister Data our priority. \n",
      "[RIKER] What is more important than Data? \n",
      "[GUINAN] Do you remember the first time we met? \n",
      "[PICARD] Of course. \n",
      "[GUINAN] Don't be so sure. If you don't go on this mission, we'll never\n",
      "meet.\n",
      "And now, the conclusion.\n",
      "(Street)\n",
      "[CLEMENS] I have long been interested in the notion\n",
      "of time travellers. In fact, I wrote a book about it. It chronicles the\n",
      "tale of a man of our era who fouled the sixth century by introducing\n",
      "newfangled gadgets and weapons all in the name of progress. This idea\n",
      "of time travel is not so far fetched as it might seem. In fact, I have\n",
      "learned that, even now, there are people from the future right here in\n",
      "San Francisco and I have no doubt that their intent is to foul our\n",
      "world just as my Yankee did in King Arthur's time. Well, sir, let me\n",
      "serve notice. As soon as I have the necessary evidence, I intend to\n",
      "expose them and make it absolutely clear that they are not welcome\n",
      "here.\n",
      "[REPORTER] Yes, sir. And will this be a sequel to Connecticut Yankee,\n",
      "Mister Twain?\n",
      "[CLEMENS] The name's Clemens, son. Sam Clemens. That's with an e. \n",
      "[REPORTER] With an e. Got it. \n",
      "(Data comes out of his hotel)\n",
      "[CLEMENS] Excuse me. \n",
      "(As Clemens follows Data, the Devidians walk the other way)\n",
      "\n",
      "(Morgue)\n",
      "\n",
      "[RIKER] (dressed as a policeman) The coroner said\n",
      "this is where they kept all the cholera victims.\n",
      "[CRUSHER] (taking tricorder scans) It doesn't make sense that so many\n",
      "people are dying of cholera. It just isn't that virulent. Will, this is\n",
      "strange.\n",
      "[RIKER] What is it? \n",
      "[CRUSHER] The cerebellum, the cerebral cortex, the brain stem, the\n",
      "entire nervous system has been depleted of electrochemical energy.\n",
      "Here's another one. Same neural depletion. These people did not die of\n",
      "cholera. They died because their neural energy was drained somehow.\n",
      "[RIKER] Drained and taken to Devidia Two for those aliens to ingest? If\n",
      "you were a time traveller with a taste for human neural energy where\n",
      "would you get your supply?\n",
      "[CRUSHER] I would travel back to a time when there were plagues and\n",
      "epidemics, so I could murder and use disease as a cover.\n",
      "\n",
      "(Rented room)\n",
      "\n",
      "(all the away team are in period costume)\n",
      "[CRUSHER] Over half the victims whose neural energy had been drained\n",
      "came from the Sisters of Hope Infirmary.\n",
      "[RIKER] A charity hospital near the waterfront. \n",
      "[TROI] If the aliens have been killing people there, well, someone might\n",
      "have noticed something unusual.\n",
      "[PICARD] And if they're moving among humans, they must have taken on\n",
      "human form. But the question is, how do we know who we're looking for?\n",
      "[RIKER] The tricorder indicated triolic activity from most of the bodies\n",
      "we looked at. If the aliens left that sort of signature, they'll be\n",
      "detectable.\n",
      "[LAFORGE] You know, we might even be able to rig some kind of alien\n",
      "alarm system.\n",
      "[RIKER] Any luck contacting Data? \n",
      "[LAFORGE] None. The tricorder's broadcasting random emissions on all\n",
      "frequencies his sub-processors might pick up, but the range is limited.\n",
      "Almost anything could interfere.\n",
      "(there's a knock at the door)\n",
      "[LAFORGE] She's back. \n",
      "(Geordi takes off his visor)\n",
      "[CARMICHAEL (OC)] Mister Pikerd! \n",
      "[PICARD] Yes, Mrs. Carmichael. \n",
      "[CARMICHAEL] (Irish accent) Mister Pikerd. I'll be reminding you that\n",
      "it's one o'clock.\n",
      "[PICARD] Yes. \n",
      "[CARMICHAEL] One o'clock on a Thursday. I'm sure I made it clear to you\n",
      "that the rent is always due, payable in full, by one o'clock on\n",
      "Wednesdays.\n",
      "[PICARD] Ah, yes, er, the rent. Mrs. Carmichael, even now my troupe are\n",
      "in rehearsals for a new production.\n",
      "[CARMICHAEL] Oh? I haven't heard of any new production. What play is it?\n",
      "\n",
      "[PICARD] The play? A Midsummer Night's Dream. We have performed in\n",
      "London, Paris, Milan. Milan. To sold out houses. I assure you, you will\n",
      "have the rent, in full, with a bonus.\n",
      "[CARMICHAEL] Oh, no, no, no, no. I've heard you silver-tongued devils\n",
      "before. I'll have the rent in full tomorrow by one o'clock or you'll be\n",
      "out performing on the street.\n",
      "\n",
      "(Data's hotel room)\n",
      "\n",
      "[BELLBOY] I wouldn't do this for just anybody,\n",
      "Mister Clemens. And I hope you won't spread it around that I let you\n",
      "in. People start talking.\n",
      "(Clemens starts searching the room)\n",
      "[CLEMENS] Of course not, Jack. And I assure you that Mister Data would\n",
      "be most upset if you didn't. If I can't find that Letter of Intent that\n",
      "he left me, our major investor is going to pull out and take his\n",
      "business elsewhere.\n",
      "[BELLBOY] It has to do with Mister Data's engine, doesn't it? \n",
      "[CLEMENS] Engine? \n",
      "[BELLBOY] Yes. \n",
      "[CLEMENS] Oh, yes. Yes, this is exactly what it's all about. Ow! \n",
      "(he gets a shock from it)\n",
      "[BELLBOY] You know, Mister Clemens, I'm going to do you another favour\n",
      "today. You're always looking for good stories, right? Well, I've got a\n",
      "real humdinger for you. The story of my life. Now, I know you may think\n",
      "I'm young, but I've covered a lot of ground and if I do say so myself,\n",
      "it'd make for some pretty fascinating reading. So, what do you think?\n",
      "[CLEMENS] About what? \n",
      "[BELLBOY] About writing my life story. You and me. Literary partners, of\n",
      "course.\n",
      "[CLEMENS] Young man, I have a maxim that I have always lived by. No one\n",
      "is more qualified to write your story than you are.\n",
      "[BELLBOY] Me? Be a writer? You think I could do that? \n",
      "[CLEMENS] As long as you write what you know. You got any passions, boy?\n",
      "Any dreams?\n",
      "[BELLBOY] I'd like to do some travelling, maybe go to sea. And Alaska.\n",
      "I've had the strangest notion to go see Alaska.\n",
      "[CLEMENS] That's a great idea, son. That's exactly what I would do if I\n",
      "were your age. Alaska, the Klondike, the Aurora Borealis. That's it.\n",
      "Follow your dreams and write about 'em.\n",
      "[BELLBOY] Thank you, Mister Clemens. You know, that is exactly what I'm\n",
      "going to do.\n",
      "[CLEMENS] You do that, son. \n",
      "[BELLBOY] You'll see my name in print, too. \n",
      "[CLEMENS] I'm sure I will. \n",
      "[BELLBOY] Don't forget. The name's London. Jack London. \n",
      "[CLEMENS] Goodbye now. Bye-bye. \n",
      "(and ushers Jack out of the room and locks the door so he can examine\n",
      "the Contraption closely. There's the sound of a door, and Clemens hides\n",
      "in the wardroom. Data and Guinan enter)\n",
      "[GUINAN] I found the Head Surveyor, I found the cavern. You will not be\n",
      "able to get to it. The entrance is on a mine shaft that is the middle\n",
      "of the Presidio on an army base.\n",
      "[DATA] Perhaps you could arrange for us to get in. \n",
      "[GUINAN] How? \n",
      "[DATA] With permission to dig for the mine shaft. \n",
      "[GUINAN] Oh, no, Data. I've done everything you've asked \n",
      "[DATA] I have full confidence in your persuasive abilities. \n",
      "[GUINAN] Well, I suppose it's more interesting than throwing a tea\n",
      "dance.\n",
      "[DATA] Strange. The transceiver assembly has been removed. Without it I\n",
      "will be unable to track the time shifts.\n",
      "[GUINAN] Twain. \n",
      "[DATA] Clemens? \n",
      "[GUINAN] Yes. He's been driving me crazy. He watches the house, he\n",
      "follows me down the street asking me questions. If anyone took this you\n",
      "can believe it was him.\n",
      "[DATA] If you are correct, he must be warned. The device has been\n",
      "modified in such a way that prolonged contact with human tissue would\n",
      "be highly toxic.\n",
      "(there's a thump from the wardrobe. Data opens the door to reveal the\n",
      "guilty party. Data picks up the\n",
      "transceiver that Clemens dropped.)\n",
      "[CLEMENS] Madame Guinan. Mister Data. \n",
      "[GUINAN] Shame on you, Mister Clemens. Shame. \n",
      "[CLEMENS] Shame, madam? I think not. I find no shame in my efforts to\n",
      "uncover your plot.\n",
      "[GUINAN] I keep telling you, there is no plot. \n",
      "[CLEMENS] Yes, you do keep telling me that. What an interesting pair you\n",
      "are. Where in Switzerland did you say you were from, Mister Data?\n",
      "[DATA] I am French, sir, not Swiss. \n",
      "[CLEMENS] Oh yes, that's right, now I remember. A Frenchman with a\n",
      "talent for poker, from what I hear. You know, I was talking to a friend\n",
      "of mine, Ches Whitley. He says to say hello and wonders when you're\n",
      "coming back.\n",
      "[DATA] I do not believe I know Mister Whitley. \n",
      "[CLEMENS] No? He works at the County Assayer's office. He says you've\n",
      "been in there a number of times claiming to be a geological engineer\n",
      "and wanting information about mining operations during the 1850's. You\n",
      "remember him now?\n",
      "[DATA] I am unfamiliar with the gentleman's name. I have spoken to\n",
      "several people at that office.\n",
      "[CLEMENS] Yes, I know. And in the Hall of Records, and in the Geological\n",
      "Society, and a little-known mineral shop in Chinatown. You do get\n",
      "around, don't you?\n",
      "[DATA] As apparently you do, Mister Clemens. \n",
      "[CLEMENS] I must admit you've got me mystified. This contraption, for\n",
      "instance. It's very unusual. It looks quite futuristic. Tell me, might\n",
      "it have something to do with time shifts?\n",
      "[DATA] In a sense. The time shift is a gearing system I have invented\n",
      "for the horseless carriage.\n",
      "[CLEMENS] Do not insult me. You have come here to this century and\n",
      "brought your infernal technology with you for God only knows what\n",
      "purpose, but I have no doubt it will be the people of this century who\n",
      "will suffer for it.\n",
      "[GUINAN] My dear Mister Clemens, I do think we've heard enough. Mister\n",
      "Data's business is his own, and I will thank you to leave now.\n",
      "[CLEMENS] Pardon me, Madam Guinan, but it is my business too. It is the\n",
      "business of all humanity, I believe, to stop both of you from whatever\n",
      "it is you are doing here. And that is what I intend to do.\n",
      "(Sisters of Hope Infirmary)\n",
      "\n",
      "(Picard is up a ladder working on a gas lamp)\n",
      "[DOCTOR] Just what are you doing with those lamps? \n",
      "[PICARD] Replacing the burners. City ordinance. Makes it safer in case\n",
      "of earthquake.\n",
      "[DOCTOR] There hasn't been an earthquake here in thirty years. \n",
      "[PICARD] Well, that's takes care of this ward. Time to be moving on. \n",
      "(Picard leaves)\n",
      "[DOCTOR] Earthquakes. Nurse. (Crusher hides her tricorder) If you can\n",
      "handle things here, I've got a meeting with the Board of Patrons.\n",
      "[CRUSHER] I'll try to manage. \n",
      "(The doctor leaves)\n",
      "[LAFORGE] There, by that bed. I can see an afterimage of triolic waves.\n",
      "They've been here recently. I'd say within the last twenty four hours.\n",
      "[CRUSHER] That's the bed where the man died last night. \n",
      "[TROI] This man was complaining about a strange doctor and nurse who\n",
      "visited that patient. Perhaps they're still in the hospital.\n",
      "(a patient starts coughing)\n",
      "[CRUSHER] (gives a drink) Here. This'll make you more comfortable. \n",
      "(Picard's gas lamp detector starts flashing and Crusher's tricorder\n",
      "beeps. She keys her comm. badge then goes over to the slim man and\n",
      "woman.)\n",
      "[CRUSHER] Do you need any help, Doctor? Doctor Apollinaire felt he had\n",
      "entered the algid stage. He was cyanotic, pulse unobservable. That's an\n",
      "interesting cane.\n",
      "(The 'nurse' points her bag at Crusher as Riker, La Forge and Picard\n",
      "rush in)\n",
      "[LAFORGE] Doctor! \n",
      "(Geordi gets the snake cane off the male and Riker stuns him to no\n",
      "effect. The couple vanish)\n",
      "(Data's contraption goes crazy, he checks a map and rushes out.)\n",
      "[POLICEMAN] Stand aside, stand aside. Let me in here. People said there\n",
      "was gunfire in here. What's going on?\n",
      "[RIKER] Just a little misunderstanding. I was just clearing these people\n",
      "out of here.\n",
      "[POLICEMAN] I haven't seen you before. \n",
      "[RIKER] I was just assigned here this morning. I was working downtown. \n",
      "[POLICEMAN] I worked downtown for three years. I don't remember you. \n",
      "[PICARD] We'll be on our way. \n",
      "[POLICEMAN] No, wait. Wait. I'm going to ask all of you to come down to\n",
      "the station for questioning. Including you. Where'd you get that?\n",
      "That's a gentleman's cane. Never seen a cane like this before. I'll\n",
      "have to confiscate it for evidence.\n",
      "[RIKER] I just want you to know that I have the utmost respect for the\n",
      "law.\n",
      "(then he punches his lights out)\n",
      "[PICARD] Let's go. \n",
      "(Infirmary street)\n",
      "\n",
      "(as the team come onto the street, a carriage\n",
      "careers around the corner)\n",
      "[RIKER] Data! \n",
      "(they climb on)\n",
      "[LAFORGE] Boy, are we glad to see you. \n",
      "[DATA] I suggest we postpone our greetings for another occasion. \n",
      "[PICARD] Agreed. Get us out of here. \n",
      "(the cops come running, blowing their whistles)\n",
      "\n",
      "(Rented room)\n",
      "\n",
      "[LAFORGE] If we tune a phaser to the approximate\n",
      "frequency of triolic waves and lay down a field burst, it might\n",
      "respond.\n",
      "(the phaser shot turns the cane head into a writhing snake's head)\n",
      "[TROI] The ophidian the aliens were carrying. \n",
      "(it sends off energy charges before reverting to the cane)\n",
      "[RIKER] What the? \n",
      "[LAFORGE] These look like minute distortions in the space-time\n",
      "continuum, like the one we saw on Devidia Two.\n",
      "[RIKER] They were so small, and they lasted only a second. \n",
      "[DATA] The aliens appear to be able to concentrate the distortion and\n",
      "direct it to a specific time and place.\n",
      "[CRUSHER] Maybe they have something, a mechanism that focuses it. \n",
      "[LAFORGE] Any device like that would produce significant levels of\n",
      "triolic waves. Like the ones in the cavern where Data's head was found.\n",
      "\n",
      "[DATA] I have located that cavern. \n",
      "(knocking on the door and frantic activity)\n",
      "[CARMICHAEL (OC)] Mister Pikerd! I know you're in there. Open the door! \n",
      "[TROI] Mrs. Carmichael. \n",
      "[DATA] How now, spirit. Whither wander you? \n",
      "[CRUSHER] Over hill, over dale, thorough bush, thorough brier, \n",
      "[TROI] Mrs. Carmichael, thank goodness you're here. \n",
      "[PICARD] We need someone to read a part. You're just in time. \n",
      "[CARMICHAEL] Mister Picard, I need to be talking to you. \n",
      "[CRUSHER] My mistress would that he be gone. \n",
      "[RIKER] Ill met by moonlight, proud Titania. \n",
      "[PICARD] Now, Mrs. Carmichael Right there. \n",
      "[RIKER] Ill met by moonlight, proud Titania. \n",
      "[CARMICHAEL] What, jealous Oberon. Fairies skip hence. I have foresworn\n",
      "his bed and company.\n",
      "[PICARD] Well, I don't think I need to hear any more. That was truly\n",
      "unique.\n",
      "[CARMICHAEL] Really? \n",
      "[PICARD] Ladies and gentlemen, I think we have found our Titania. Don't\n",
      "you agree?\n",
      "(a round of applause)\n",
      "[CARMICHAEL] Well, I did do a church play when I was a lass. \n",
      "[PICARD] Well, there you are. We start rehearsals tomorrow. \n",
      "(Picard kisses her on both cheeks, and she turns into a simpering girl)\n",
      "\n",
      "(Data's hotel room)\n",
      "\n",
      "(Guinan is pacing when Data enters)\n",
      "[GUINAN] You're back. I have wonderful news. I've found a way to get\n",
      "into the Presidio and into the mine shaft.\n",
      "(Picard enters)\n",
      "[DATA] It is all right. \n",
      "[GUINAN] Do you know me? \n",
      "[PICARD] Very well. \n",
      "[GUINAN] Do I know you? \n",
      "[PICARD] Not yet. But you will.\n",
      "\n",
      "(Infirmary street)\n",
      "\n",
      "[REPORTER] Thanks for your help, officer. \n",
      "[POLICEMAN] Now, be sure you put in the part about me spotting that\n",
      "phony policeman.\n",
      "[REPORTER] Yes, sir. \n",
      "[CLEMENS] Hello, son. \n",
      "[REPORTER] Mister Clemens. What brings you here? \n",
      "[CLEMENS] Writer's curiosity. I heard that two people vanished into thin\n",
      "air in this Infirmary.\n",
      "[REPORTER] One of the patients said that, yes, sir, but the police deny\n",
      "it.\n",
      "[CLEMENS] I bet they do. \n",
      "[REPORTER] They say a band of outlaws set off an explosion in the\n",
      "hospital and then escaped.\n",
      "[CLEMENS] Well, what did these outlaws look like? \n",
      "[REPORTER] The carriage they escaped in was driven by an albino. \n",
      "[CLEMENS] Oh. Mister Data. \n",
      "[REPORTER] You know him? \n",
      "[CLEMENS] You bet I do. You say there were others with him? \n",
      "[REPORTER] Yes, at least a dozen. \n",
      "[CLEMENS] His accomplices. They've come from the future. My God, it's an\n",
      "invasion.\n",
      "(he hails a cab)\n",
      "[REPORTER] An invasion from the future? Mister Clemens, what can you\n",
      "tell me about this? Do you have any proof?\n",
      "[CLEMENS] When's your deadline, boy? \n",
      "[REPORTER] Five o'clock, sir. \n",
      "[CLEMENS] I'll meet you at your paper at four thirty with a story that\n",
      "will make your career.\n",
      "[REPORTER] Thanks, Mister Clemens \n",
      "[CLEMENS] Take me to the Presidio, driver, and don't spare the whip.\n",
      "\n",
      "(Cavern)\n",
      "\n",
      "[RIKER] The triolic levels are as high as they were\n",
      "on Devidia Two. There's no indication of a control mechanism.\n",
      "[LAFORGE] I'm not so sure. My visor is picking up crystalline fractures.\n",
      "These cavern walls have undergone some kind of selective molecular\n",
      "polarisation. In fact, if I'm right this whole cavern has been\n",
      "configured to focus the space-time distortion. Just like a lens.\n",
      "Captain, we think we might be on to something. The cavern itself seems\n",
      "to be acting as a focusing mechanism. I'm willing to bet it's the same\n",
      "at their habitat back on Devidia Two.\n",
      "[PICARD] If we can get back there and destroy that site, it might put an\n",
      "end to their time travelling.\n",
      "[RIKER] We have the ophidian. \n",
      "[LAFORGE] Truthfully, I don't know that we can get back. The aliens use\n",
      "triolic energy as a power source. The energy our phasers generates\n",
      "might not be entirely compatible.\n",
      "[PICARD] We have no choice but to try. \n",
      "[CLEMENS] An event I would most certainly enjoy witnessing. However, I\n",
      "will regretfully waive that opportunity for the\n",
      "privilege of taking you all in to the authorities.\n",
      "[DATA] Mister Clemens, it is imperative that we continue our mission. \n",
      "[CLEMENS] Mister Data, I have listened to your stories and your excuses\n",
      "and your evasions, and I will listen no longer. It is my moral duty to\n",
      "protect mankind from whatever devious plan you have in mind. Now, move\n",
      "along. I suspect that even time travellers are vulnerable to the Colt\n",
      "forty five. Now, let's go. I made a young fellow a promise and I don't\n",
      "want to be late.\n",
      "(the two aliens appear and the male grabs the cane from Troi. Data\n",
      "tackles him and gets it back. The cane activates, the woman disappears,\n",
      "there's a flash, everyone is thrown to the floor and Data's head comes\n",
      "adrift. The time portal is open. The male runs through it)\n",
      "[PICARD] Follow him! \n",
      "(Riker, Geordi, Crusher, Troi do so, then Clemens as Picard checks on\n",
      "Guinan. The portal closes.)\n",
      "\n",
      "(Devidia cavern)\n",
      "\n",
      "[RIKER] Is everybody all right? \n",
      "[CRUSHER] I think so. \n",
      "[RIKER] You! \n",
      "[CLEMENS] Where are we? And when? \n",
      "[RIKER] This is the twenty fourth century, we're on Devidia Two, and\n",
      "you're not supposed to be here.\n",
      "[CLEMENS] Well it seems to me I have as much right to be in your time as\n",
      "you had to be in mine. I wanted to see how you've conducted my future\n",
      "affairs.\n",
      "[TROI] Your future affairs? \n",
      "[CLEMENS] The affairs of mankind. \n",
      "[RIKER] But the disappearance of Mark Twain, one of the most noted\n",
      "literary figures of the nineteenth century\n",
      "[CLEMENS] Thank you. \n",
      "[RIKER] That's not supposed to happen. \n",
      "[CLEMENS] I only took advantage of an irresistible opportunity, as any\n",
      "good writer would.\n",
      "[WORF (OC)] Bridge to Away team. Acknowledge. \n",
      "[RIKER] We're here, Mister Worf. Stand by to transport five. \n",
      "[LAFORGE] Commander. \n",
      "(Data's headless body is lying on the floor, clutching the cane)\n",
      "[RIKER] Mister Worf? \n",
      "[WORF (OC)] Yes, Commander. \n",
      "[RIKER] Make that six to transport.\n",
      "\n",
      "(Transporter room)\n",
      "\n",
      "[CLEMENS] Where are we now? \n",
      "[RIKER] The Federation Starship Enterprise. Ensign, call security. I\n",
      "want an escort for this man.\n",
      "[CLEMENS] Security? What for? Are you afraid I'm going to go around\n",
      "stealing things?\n",
      "(Worf enters)\n",
      "[CLEMENS] A werewolf! \n",
      "[RIKER] It's a long story, Mister Worf. I'll brief you later. \n",
      "[LAFORGE] Let's have Data's body taken to the science lab. I'll try and\n",
      "re-attach the head we have.\n",
      "[CRUSHER] Geordi, that head is over five hundred years old. \n",
      "[LAFORGE] Yeah, but it's the best chance we've got. \n",
      "[RIKER] I want Mister Clemens kept under escort at all times. \n",
      "[TROI] Commander, perhaps I could handle that. I'd be happy to take\n",
      "Mister Clemens to his quarters.\n",
      "[RIKER] Good idea. If you would accompany the Counsellor. \n",
      "[CLEMENS] Madam, I'd be delighted. So, this is a space ship? You ever\n",
      "run into Halley's comet?\n",
      "\n",
      "(Cavern)\n",
      "\n",
      "(Guinan is just coming round)\n",
      "[PICARD] Gently. Don't sit up too quickly. \n",
      "[GUINAN] Where'd everybody go? \n",
      "[PICARD] I hope they're all safely back on the Enterprise by now. \n",
      "[GUINAN] But you're still here. \n",
      "[PICARD] You were hurt. I had to make sure you were all right. \n",
      "[GUINAN] And so you stayed for that? \n",
      "[PICARD] I didn't want anything to happen to you. You're far too\n",
      "important to me.\n",
      "[GUINAN] You know an awful lot about me. \n",
      "[PICARD] Believe me, in the future the tables will be turned. \n",
      "[GUINAN] So we become friends? \n",
      "[PICARD] It goes far beyond friendship. \n",
      "[GUINAN] Oh, but I'll have to wait almost five hundred years, and when\n",
      "we meet I won't be able to tell you about this, will I?\n",
      "[PICARD] No. Because for me, none of this will have happened yet. \n",
      "[GUINAN] What's that? \n",
      "(Data's head)\n",
      "[PICARD] That's history fulfilling itself.\n",
      "\n",
      "(Ten Forward)\n",
      "\n",
      "[GUINAN] History has to fulfill itself. Even Picard\n",
      "knew that.\n",
      "[RIKER] You were there in the cavern. You know what happened. What am I\n",
      "supposed to do?\n",
      "[GUINAN] If I told you what happened in that cavern, it would affect any\n",
      "decision you'd make now. I can't do that. I won't.\n",
      "[RIKER] Not telling me might affect my decision. Did you think of that?\n",
      "We're talking about Jean-Luc Picard. I can't sit around and hope it all\n",
      "works out. I've got to do something.\n",
      "\n",
      "(Corridor)\n",
      "\n",
      "(Troi is back in her purple catsuit)\n",
      "[CLEMENS] Any place that doesn't stock a good cigar doesn't rank high in\n",
      "my book.\n",
      "[TROI] If you must have one, I'm sure we can replicate it for you. \n",
      "[CLEMENS] You think one of these imitations can take the place of a hand\n",
      "wrapped Havana?\n",
      "[TROI] I wouldn't know. \n",
      "[CLEMENS] Well, that's the problem I see here. All this technology it\n",
      "only serves to take away life's simple pleasures. You don't even let a\n",
      "man open the door for a lady.\n",
      "[TROI] I think what we've gained far outweighs anything that might have\n",
      "been lost.\n",
      "[CLEMENS] Oh? Well, I'm not so impressed with this future. Huge\n",
      "starships, and weapons that can no doubt destroy entire cities, and\n",
      "military conquest as a way of life?\n",
      "[TROI] Is that what you see here? \n",
      "[CLEMENS] Well, I know what you say, that this is a vessel of\n",
      "exploration and that your mission is to discover new worlds.\n",
      "(a Bolian comes out of the turbolift as they get in)\n",
      "\n",
      "(Turbolift)\n",
      "\n",
      "[CLEMENS] That's what the Spanish said. \n",
      "[TROI] Deck thirty six. \n",
      "[CLEMENS] And the Dutch and the Portuguese. It's what all conquerors\n",
      "say. I'm sure that's what you told that blue-skinned fellow I just saw,\n",
      "before you brought him here to serve you.\n",
      "[TROI] He's one of the thousands of species that we've encountered. We\n",
      "live in a peaceful Federation with most of them. The people you see are\n",
      "here by choice.\n",
      "[CLEMENS] So there're a privileged few who serve on these ships, living\n",
      "in luxury and wanting for nothing. But what about everyone else? What\n",
      "about the poor? You ignore them.\n",
      "[TROI] Poverty was eliminated on Earth a long time ago, and a lot of\n",
      "other things disappeared with it. Hopelessness, despair, cruelty.\n",
      "[CLEMENS] Young lady, I come from a time when men achieve power and\n",
      "wealth by standing on the backs of the poor, where prejudice and\n",
      "intolerance are commonplace and power is an end unto itself. And you're\n",
      "telling me that isn't how it is anymore?\n",
      "[TROI] That's right. \n",
      "[CLEMENS] Well, maybe it's worth giving up cigars for after all.\n",
      "\n",
      "(Science lab)\n",
      "\n",
      "(the one where Lal was born and Picard\n",
      "de-Borgified)\n",
      "[TROI] Any luck? \n",
      "[LAFORGE] Not so far. His activating units won't initialise. I thought\n",
      "they would have been protected by his buffering\n",
      "programme, but I guess five hundred years is just too long a wait.\n",
      "[CLEMENS] My watch. \n",
      "[LAFORGE] Yeah. It was found in the cavern where Data's head was. I\n",
      "guess after five hundred years, that's not likely to work either.\n",
      "[CLEMENS] Mister Data, I fear I sadly misjudged you. As I have misjudged\n",
      "many things.\n",
      "\n",
      "(Cavern)\n",
      "\n",
      "(the female alien is waking up, and flickering\n",
      "between human and alien)\n",
      "[PICARD] Can you communicate? \n",
      "[ALIEN] Yes. \n",
      "[PICARD] You're injured. \n",
      "[ALIEN] Why have you interfered with us? \n",
      "[PICARD] You hunt us. You kill us. We cannot allow that. \n",
      "[ALIEN] We need your energy. \n",
      "[PICARD] Perhaps we can find a substitute. \n",
      "[ALIEN] No. There is none. We must continue. \n",
      "[PICARD] We know how you move back and forth through time. My crew have\n",
      "returned to the twenty fourth century to destroy your transport site on\n",
      "Devidia Two.\n",
      "[ALIEN] Destroy it? Your weapons will only amplify the time distortion.\n",
      "You will annihilate your own world.\n",
      "(and she disappears)\n",
      "(Observation lounge)\n",
      "\n",
      "[RIKER] I'm going back for Captain Picard. Mister\n",
      "Worf, assemble an Away team to accompany me to the surface. Doctor, I\n",
      "need to know anything you can tell me about that ophidian.\n",
      "[CRUSHER] I've just started running some tests. If I can have a few\n",
      "hours.\n",
      "[RIKER] I can't give the alien any more time. \n",
      "[CRUSHER] Will, I haven't been able to determine if our phaser energy\n",
      "can generate a stable field. The risk would be\n",
      "[RIKER] I'll take that risk. \n",
      "[WORF] Sir. Permission to speak frankly. \n",
      "[RIKER] Go ahead. \n",
      "[WORF] Our priority is to stop the aliens from any more incursions to\n",
      "Earth. Any delay is unacceptable.\n",
      "[RIKER] If I can save Captain Picard, I consider that very acceptable. \n",
      "[WORF] The Captain would not. I recommend we target photon torpedoes on\n",
      "the alien habitat and destroy it. Immediately.\n",
      "[TROI] He's right, Will. \n",
      "[RIKER] Power up the photons, Mister Worf. Alert me when they're ready.\n",
      "\n",
      "(Science lab)\n",
      "\n",
      "[LAFORGE] Computer, initialise the reload circuits. \n",
      "[COMPUTER] Reload circuits are initialising. \n",
      "[LAFORGE] Okay. Data? This ought to do it. \n",
      "(does something to his positronic net)\n",
      "[LAFORGE] I don't get it. I don't understand why isn't this working.\n",
      "Computer, run me a diagnostic on the input polarisers.\n",
      "[COMPUTER] There is intermittent contact in the input polarisers. \n",
      "[LAFORGE] Intermittent? \n",
      "(Geordi opens the back of Data's head)\n",
      "[LAFORGE] What? An iron filing. How'd that get in there?\n",
      "\n",
      "(Cavern)\n",
      "\n",
      "(Picard picks up Data's head and opens the back,\n",
      "then uses a piece of metal to do something to the circuits)\n",
      "\n",
      "(Bridge)\n",
      "\n",
      "[WORF] Commander, I have set the photons to fire in\n",
      "staggered rounds, detonating in ten second intervals.\n",
      "[RIKER] Very well. Fire when ready. \n",
      "[WORF] The sequence will be ready to initiate in one minute.\n",
      "\n",
      "(Science lab)\n",
      "\n",
      "[LAFORGE] Computer, run another diagnostic on the\n",
      "input polarisers.\n",
      "[COMPUTER] Polariser circuits are functioning. \n",
      "[LAFORGE] Well, then, that ought to do it. Okay, Data. Come on, now. \n",
      "[DATA] Torpedoes. Phasing. Alien. I am processing a binary message\n",
      "entered into my static memory by Captain Picard. Geordi, are we\n",
      "planning to fire on the alien habitat?\n",
      "[LAFORGE] Yeah, but \n",
      "[DATA] It is imperative that we do not. I will explain later. \n",
      "[LAFORGE] La Forge to Riker. Hold your fire!\n",
      "\n",
      "(Bridge)\n",
      "\n",
      "[DATA] The binary message left by the Captain is not\n",
      "entirely clear. He seemed to be concerned about the phase differential\n",
      "of our photon torpedoes. That firing them might produce catastrophic\n",
      "effects.\n",
      "[CRUSHER] Then how do we destroy their habitat? \n",
      "[DATA] If I am correct, we must modify our weapons so that the force of\n",
      "the explosion is re-phased into the aliens' time continuum.\n",
      "[LAFORGE] If we outfit the photons with phase discriminators we could\n",
      "get the variance we need.\n",
      "[RIKER] How long will it take you? \n",
      "[LAFORGE] At least a couple of hours. \n",
      "[RIKER] Fine. I'll have time to go get him. \n",
      "[DATA] Sir? \n",
      "[RIKER] I'm going back to the nineteenth century to get the Captain.\n",
      "Doctor?\n",
      "[CRUSHER] My analysis of the phasers suggests you'd be able to open the\n",
      "rift, but it won't be stable enough to transport more than one person.\n",
      "[RIKER] You mean if I go back, only one of us can return? \n",
      "[CRUSHER] That's right. \n",
      "[CLEMENS] Then I have the perfect solution for you. I'm the one who\n",
      "should return to the nineteenth century and remain there so your\n",
      "Captain can return here.\n",
      "[RIKER] There's a risk. We're not sure how stable the rift will be. \n",
      "[CLEMENS] There's risk in everything. The point is, it's the right\n",
      "choice. I've got more books to write, and your Captain has a job to do\n",
      "here.\n",
      "[RIKER] Geordi, you'll brief him on what he needs to know? \n",
      "[LAFORGE] Aye, sir. \n",
      "[CLEMENS] I'm glad I have the chance to thank you. \n",
      "[DATA] For what, sir? \n",
      "[CLEMENS] Why, for starting me out on the greatest adventure a man's\n",
      "ever had. And for helping a bitter old man to open his eyes and see\n",
      "that the future turned out pretty well after all.\n",
      "\n",
      "(Cavern)\n",
      "\n",
      "[GUINAN] I'm thirsty. \n",
      "[PICARD] I'm going to get help. We have to get you out of here. \n",
      "[GUINAN] No, don't go. They'll be back for you soon. \n",
      "[PICARD] No, you need help. \n",
      "[CLEMENS] This thing put me down in the middle of Market Street. Took\n",
      "forever to get here.\n",
      "\n",
      "(Bridge)\n",
      "\n",
      "[WORF] Commander La Forge has completed the\n",
      "reconfiguration of the photon torpedoes.\n",
      "[RIKER] If Clemens got back, the Captain should have been here by now. \n",
      "[WORF] We have no way of knowing if Mister Clemens was successful. \n",
      "[RIKER] Re-establish your firing pattern, Mister Worf. We'll wait five\n",
      "more minutes.\n",
      "[WORF] Aye, sir.\n",
      "\n",
      "(Cavern)\n",
      "\n",
      "[CLEMENS] No time for chit chat, sir. According to\n",
      "Mister La Forge, who did get your message by the way, a frequency\n",
      "setting of point oh four seven on your phaser will correctly activate\n",
      "this creature.\n",
      "[PICARD] Now you have to get help. Guinan needs medical attention. \n",
      "[CLEMENS] I promise you she will be attended to. \n",
      "[PICARD] And there is a bill to be settled at Mrs. Carmichael's boarding\n",
      "house.\n",
      "[CLEMENS] I'll settle it. \n",
      "[PICARD] Thank you. I wish, I wish time would have allowed me to know\n",
      "you better.\n",
      "[CLEMENS] You'll just have to read my books. What I am is pretty much\n",
      "there.\n",
      "[GUINAN] I'll see you in five hundred years, Picard. \n",
      "[PICARD] And I'll see you in a few minutes.\n",
      "\n",
      "(Bridge)\n",
      "\n",
      "[DATA] Commander, I am picking up massive triolic\n",
      "wave activity on the surface.\n",
      "[RIKER] Is it the Captain? \n",
      "[DATA] There are no human life signs. \n",
      "[RIKER] No sign of a temporal distortion? \n",
      "[DATA] No, sir, but triolic activity is increasing. \n",
      "[RIKER] The aliens. Mister Worf, are the photons ready? \n",
      "[WORF] Yes, sir. \n",
      "[RIKER] Fire. \n",
      "[WORF] Torpedoes away, sir. \n",
      "[DATA] Sir, I am detecting a temporal distortion on the surface and\n",
      "human life signs.\n",
      "[RIKER] O'Brien, get him out of there! \n",
      "(KaBOOM on Devidia)\n",
      "[RIKER] Transporter room, have you got him? \n",
      "[PICARD (OC)] He has indeed, Commander. And believe me, it's good to be\n",
      "back.\n",
      "[WORF] We have destroyed the target. There is no further indication of\n",
      "triolic activity.\n",
      "[RIKER] Ensign, lay in a course to the nearest Starbase. Warp six. \n",
      "Captain's log, stardate 46001.3. Everyone who\n",
      "should be in the nineteenth century is safely there, and those who\n",
      "should be in the twenty fourth are here. Mister Data has been restored\n",
      "to us, head and all, and Samuel Clemens will write the books he was to\n",
      "have written after our encounter.\n",
      "\n",
      "(Cavern)\n",
      "\n",
      "[CLEMENS] Now be careful, boys. Don't jostle her too\n",
      "much. Don't worry, Madam Guinan, you're going to be fine.\n",
      "(as young Guinan is stretchered away, Clemens picks up his broken watch\n",
      "then puts it down again to be found with the other artefacts in 500\n",
      "years time)\n"
     ]
    }
   ],
   "source": [
    "print(picard[\"TEXT\"].values[400])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "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>TEXT</th>\n",
       "      <th>METADATA</th>\n",
       "      <th>SOURCE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>The Deep Space Nine - Emissary\\n\\nEmissary\\nSt...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>The Deep Space Nine - Past Prologue\\n\\nPast\\nP...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>The Deep Space Nine - A Man Alone\\n\\nA\\nMan Al...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>The Deep Space Nine - Babel\\n\\nBabel\\nStardate...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>The Deep Space Nine - Captive Pursuit\\n\\nCapti...</td>\n",
       "      <td>{\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...</td>\n",
       "      <td>startrek/chakoteya</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                TEXT  \\\n",
       "0  The Deep Space Nine - Emissary\\n\\nEmissary\\nSt...   \n",
       "1  The Deep Space Nine - Past Prologue\\n\\nPast\\nP...   \n",
       "2  The Deep Space Nine - A Man Alone\\n\\nA\\nMan Al...   \n",
       "3  The Deep Space Nine - Babel\\n\\nBabel\\nStardate...   \n",
       "4  The Deep Space Nine - Captive Pursuit\\n\\nCapti...   \n",
       "\n",
       "                                            METADATA              SOURCE  \n",
       "0  {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "1  {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "2  {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "3  {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  \n",
       "4  {\"show\": \"Star Trek\", \"season\": \"DS9\", \"episod...  startrek/chakoteya  "
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "picard.to_parquet(\"picard.pq\", row_group_size=100, engine=\"pyarrow\", index=False)\n",
    "picard.head()  # http://www.chakoteya.net/StarTrek/index.html and also https://github.com/GJBroughton/Star_Trek_Scripts/"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "708"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(picard)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.9.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
