#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('pylab', 'inline') # # Game of Thrones TVD Plugin # ## Install # The following command will install **GameOfThrones TVD plugin** (and **TVD** if it is missing) # ```bash # pip install TVDGameOfThrones # ``` # This will install additional dependencies for visualizing resources in Jupyter/IPython notebook: # ```bash # pip install "tvd[notebook]" # ``` # ## Download all resources # The following command will download all resources for **Game Of Thrones** into `/tmp/` directory. # ```bash # python -m tvd.create metadata /tmp/ GameOfThrones # ``` # ## Available resources # Initialize GameOfThrones TVD plugin # In[2]: from tvd import GameOfThrones gameOfThrones = GameOfThrones('/tmp') # Get first episode # In[3]: episode = gameOfThrones.episodes[0] episode # ### Segmentation into scenes # Provides: # - manual segmentation into scenes # In[10]: scenes = gameOfThrones.get_resource('scenes', episode) scenes # ### Outlines # Source: http://gameofthrones.wikia.com/ # Provides # - scene summary # # Does not provide timestamps. # In[7]: outline_www = gameOfThrones.get_resource('outline_www', episode) outline_www # ### Transcripts # Source: http://foreverdreaming.org/ # Provides: # # - speaker label # - speech content # # Does not provide timestamps. # In[8]: transcript = gameOfThrones.get_resource('transcript', episode) transcript # ### Force-aligned transcripts # Source: [LIMSI](http://www.limsi.fr) # Provides: # # - word-level timestamps (start & end time) # In[9]: transcript_aligned = gameOfThrones.get_resource('transcript_aligned', episode) transcript_aligned.crop(180, 190)