Skip to content

Instantly share code, notes, and snippets.

@mmsamiei
Last active December 30, 2019 21:53
Show Gist options
  • Save mmsamiei/172906fd47a2810788046eeb84d9403b to your computer and use it in GitHub Desktop.
Save mmsamiei/172906fd47a2810788046eeb84d9403b to your computer and use it in GitHub Desktop.
wizard_of_wikipedia.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "wizard_of_wikipedia.ipynb",
"version": "0.3.2",
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/mmsamiei/172906fd47a2810788046eeb84d9403b/untitled24.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "HAxfysjCbQK3",
"colab_type": "code",
"outputId": "6b881ac4-c6a9-426d-fbb0-07c3f62a8ecc",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"from google.colab import drive\n",
"drive.mount('/content/gdrive')"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"Mounted at /content/gdrive\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "rcHp7XACbazD",
"colab_type": "code",
"outputId": "aa4450b4-d388-48af-f418-fde2854c66e0",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"%cd ./gdrive/"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"/content/gdrive\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "KsDxQvh7bgxg",
"colab_type": "code",
"outputId": "227f4452-3f3c-4ac8-8d07-b11731f037f9",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"%cd My\\ Drive"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"/content/gdrive/My Drive\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "qsLqFkbJbkGn",
"colab_type": "code",
"colab": {}
},
"source": [
"!mkdir parl"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "rejC8qtVbnwJ",
"colab_type": "code",
"outputId": "4b1bda19-ee2a-4f05-ca72-27ad1b9fc7a1",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"%cd parl"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"/content/gdrive/My Drive/parl\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "tpxBnJoSbpjp",
"colab_type": "code",
"outputId": "88dbe769-360c-463d-cdcb-153c7a2f7cab",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 106
}
},
"source": [
"!git clone https://github.com/facebookresearch/ParlAI.git ~/ParlAI"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"Cloning into '/root/ParlAI'...\n",
"remote: Enumerating objects: 20904, done.\u001b[K\n",
"remote: Total 20904 (delta 0), reused 0 (delta 0), pack-reused 20904\u001b[K\n",
"Receiving objects: 100% (20904/20904), 22.18 MiB | 27.91 MiB/s, done.\n",
"Resolving deltas: 100% (14515/14515), done.\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "KX3mZw3Rbt5n",
"colab_type": "code",
"outputId": "c8cbf934-229a-46d9-8f6f-c12aee153425",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 6356
}
},
"source": [
"!python setup.py develop"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"running develop\n",
"running egg_info\n",
"creating parlai.egg-info\n",
"writing parlai.egg-info/PKG-INFO\n",
"writing dependency_links to parlai.egg-info/dependency_links.txt\n",
"writing requirements to parlai.egg-info/requires.txt\n",
"writing top-level names to parlai.egg-info/top_level.txt\n",
"writing manifest file 'parlai.egg-info/SOURCES.txt'\n",
"reading manifest template 'MANIFEST.in'\n",
"writing manifest file 'parlai.egg-info/SOURCES.txt'\n",
"running build_ext\n",
"Creating /usr/local/lib/python3.6/dist-packages/parlai.egg-link (link to .)\n",
"Adding parlai 0.1.0 to easy-install.pth file\n",
"\n",
"Installed /root/ParlAI\n",
"Processing dependencies for parlai==0.1.0\n",
"Searching for websocket-server\n",
"Reading https://pypi.org/simple/websocket-server/\n",
"Downloading https://files.pythonhosted.org/packages/74/64/e86581ee7775a2e08aca530b41e1a1e3ee6b320233b1eff301dcb86d1636/websocket_server-0.4.tar.gz#sha256=91cd4b565d1e1b00ef107abcb2840a8090868b19543f3b38e1962d5f975d0c04\n",
"Best match: websocket-server 0.4\n",
"Processing websocket_server-0.4.tar.gz\n",
"Writing /tmp/easy_install-_wfqfyot/websocket_server-0.4/setup.cfg\n",
"Running websocket_server-0.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_wfqfyot/websocket_server-0.4/egg-dist-tmp-h9__3tit\n",
"zip_safe flag not set; analyzing archive contents...\n",
"Moving websocket_server-0.4-py3.6.egg to /usr/local/lib/python3.6/dist-packages\n",
"Adding websocket-server 0.4 to easy-install.pth file\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/websocket_server-0.4-py3.6.egg\n",
"Searching for websocket-client\n",
"Reading https://pypi.org/simple/websocket-client/\n",
"Downloading https://files.pythonhosted.org/packages/29/19/44753eab1fdb50770ac69605527e8859468f3c0fd7dc5a76dd9c4dbd7906/websocket_client-0.56.0-py2.py3-none-any.whl#sha256=1151d5fb3a62dc129164292e1227655e4bbc5dd5340a5165dfae61128ec50aa9\n",
"Best match: websocket-client 0.56.0\n",
"Processing websocket_client-0.56.0-py2.py3-none-any.whl\n",
"Installing websocket_client-0.56.0-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"writing requirements to /usr/local/lib/python3.6/dist-packages/websocket_client-0.56.0-py3.6.egg/EGG-INFO/requires.txt\n",
"Adding websocket-client 0.56.0 to easy-install.pth file\n",
"Installing wsdump.py script to /usr/local/bin\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/websocket_client-0.56.0-py3.6.egg\n",
"Searching for sphinx_rtd_theme\n",
"Reading https://pypi.org/simple/sphinx_rtd_theme/\n",
"Downloading https://files.pythonhosted.org/packages/60/b4/4df37087a1d36755e3a3bfd2a30263f358d2dea21938240fa02313d45f51/sphinx_rtd_theme-0.4.3-py2.py3-none-any.whl#sha256=00cf895504a7895ee433807c62094cf1e95f065843bf3acd17037c3e9a2becd4\n",
"Best match: sphinx-rtd-theme 0.4.3\n",
"Processing sphinx_rtd_theme-0.4.3-py2.py3-none-any.whl\n",
"Installing sphinx_rtd_theme-0.4.3-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"writing requirements to /usr/local/lib/python3.6/dist-packages/sphinx_rtd_theme-0.4.3-py3.6.egg/EGG-INFO/requires.txt\n",
"Adding sphinx-rtd-theme 0.4.3 to easy-install.pth file\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/sphinx_rtd_theme-0.4.3-py3.6.egg\n",
"Searching for sh\n",
"Reading https://pypi.org/simple/sh/\n",
"Downloading https://files.pythonhosted.org/packages/4a/22/17b22ef5b049f12080f5815c41bf94de3c229217609e469001a8f80c1b3d/sh-1.12.14-py2.py3-none-any.whl#sha256=ae3258c5249493cebe73cb4e18253a41ed69262484bad36fdb3efcb8ad8870bb\n",
"Best match: sh 1.12.14\n",
"Processing sh-1.12.14-py2.py3-none-any.whl\n",
"Installing sh-1.12.14-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"Adding sh 1.12.14 to easy-install.pth file\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg\n",
"Searching for py-gfm\n",
"Reading https://pypi.org/simple/py-gfm/\n",
"Downloading https://files.pythonhosted.org/packages/21/e0/be291e07b5e72e83285e4c0caf8060db0ab8d26f60bda254651e41493652/py_gfm-0.1.4-py2.py3-none-any.whl#sha256=d873541bcae194cc3b5053858719668834d3f1829342f0566ab3a48d0d744d58\n",
"Best match: py-gfm 0.1.4\n",
"Processing py_gfm-0.1.4-py2.py3-none-any.whl\n",
"Installing py_gfm-0.1.4-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"writing requirements to /usr/local/lib/python3.6/dist-packages/py_gfm-0.1.4-py3.6.egg/EGG-INFO/requires.txt\n",
"Adding py-gfm 0.1.4 to easy-install.pth file\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/py_gfm-0.1.4-py3.6.egg\n",
"Searching for gitpython\n",
"Reading https://pypi.org/simple/gitpython/\n",
"Downloading https://files.pythonhosted.org/packages/fe/e5/fafe827507644c32d6dc553a1c435cdf882e0c28918a5bab29f7fbebfb70/GitPython-2.1.11-py2.py3-none-any.whl#sha256=563221e5a44369c6b79172f455584c9ebbb122a13368cc82cb4b5addff788f82\n",
"Best match: GitPython 2.1.11\n",
"Processing GitPython-2.1.11-py2.py3-none-any.whl\n",
"Installing GitPython-2.1.11-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"writing requirements to /usr/local/lib/python3.6/dist-packages/GitPython-2.1.11-py3.6.egg/EGG-INFO/requires.txt\n",
"Adding GitPython 2.1.11 to easy-install.pth file\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/GitPython-2.1.11-py3.6.egg\n",
"Searching for flake8\n",
"Reading https://pypi.org/simple/flake8/\n",
"Downloading https://files.pythonhosted.org/packages/e9/76/b915bd28976068a9843bf836b789794aa4a8eb13338b23581005cd9177c0/flake8-3.7.7-py2.py3-none-any.whl#sha256=a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8\n",
"Best match: flake8 3.7.7\n",
"Processing flake8-3.7.7-py2.py3-none-any.whl\n",
"Installing flake8-3.7.7-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"writing requirements to /usr/local/lib/python3.6/dist-packages/flake8-3.7.7-py3.6.egg/EGG-INFO/requires.txt\n",
"Adding flake8 3.7.7 to easy-install.pth file\n",
"Installing flake8 script to /usr/local/bin\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/flake8-3.7.7-py3.6.egg\n",
"Searching for markdown<3.0\n",
"Reading https://pypi.org/simple/markdown/\n",
"Downloading https://files.pythonhosted.org/packages/6d/7d/488b90f470b96531a3f5788cf12a93332f543dbab13c423a5e7ce96a0493/Markdown-2.6.11-py2.py3-none-any.whl#sha256=9ba587db9daee7ec761cfc656272be6aabe2ed300fece21208e4aab2e457bc8f\n",
"Best match: Markdown 2.6.11\n",
"Processing Markdown-2.6.11-py2.py3-none-any.whl\n",
"Installing Markdown-2.6.11-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"Adding Markdown 2.6.11 to easy-install.pth file\n",
"Installing markdown_py script to /usr/local/bin\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/Markdown-2.6.11-py3.6.egg\n",
"Searching for gitdb2>=2.0.0\n",
"Reading https://pypi.org/simple/gitdb2/\n",
"Downloading https://files.pythonhosted.org/packages/da/30/a407568aa8d8f25db817cf50121a958722f3fc5f87e3a6fba1f40c0633e3/gitdb2-2.0.5-py2.py3-none-any.whl#sha256=e3a0141c5f2a3f635c7209d56c496ebe1ad35da82fe4d3ec4aaa36278d70648a\n",
"Best match: gitdb2 2.0.5\n",
"Processing gitdb2-2.0.5-py2.py3-none-any.whl\n",
"Installing gitdb2-2.0.5-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"writing requirements to /usr/local/lib/python3.6/dist-packages/gitdb2-2.0.5-py3.6.egg/EGG-INFO/requires.txt\n",
"Adding gitdb2 2.0.5 to easy-install.pth file\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/gitdb2-2.0.5-py3.6.egg\n",
"Searching for pyflakes<2.2.0,>=2.1.0\n",
"Reading https://pypi.org/simple/pyflakes/\n",
"Downloading https://files.pythonhosted.org/packages/84/f2/ed0ffb887f8138a8fe5a621b8c0bb9598bfb3989e029f6c6a85ee66628ee/pyflakes-2.1.1-py2.py3-none-any.whl#sha256=17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0\n",
"Best match: pyflakes 2.1.1\n",
"Processing pyflakes-2.1.1-py2.py3-none-any.whl\n",
"Installing pyflakes-2.1.1-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"Adding pyflakes 2.1.1 to easy-install.pth file\n",
"Installing pyflakes script to /usr/local/bin\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/pyflakes-2.1.1-py3.6.egg\n",
"Searching for pycodestyle<2.6.0,>=2.5.0\n",
"Reading https://pypi.org/simple/pycodestyle/\n",
"Downloading https://files.pythonhosted.org/packages/0e/0c/04a353e104d2f324f8ee5f4b32012618c1c86dd79e52a433b64fceed511b/pycodestyle-2.5.0-py2.py3-none-any.whl#sha256=95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56\n",
"Best match: pycodestyle 2.5.0\n",
"Processing pycodestyle-2.5.0-py2.py3-none-any.whl\n",
"Installing pycodestyle-2.5.0-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"Adding pycodestyle 2.5.0 to easy-install.pth file\n",
"Installing pycodestyle script to /usr/local/bin\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/pycodestyle-2.5.0-py3.6.egg\n",
"Searching for mccabe<0.7.0,>=0.6.0\n",
"Reading https://pypi.org/simple/mccabe/\n",
"Downloading https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl#sha256=ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42\n",
"Best match: mccabe 0.6.1\n",
"Processing mccabe-0.6.1-py2.py3-none-any.whl\n",
"Installing mccabe-0.6.1-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"Adding mccabe 0.6.1 to easy-install.pth file\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/mccabe-0.6.1-py3.6.egg\n",
"Searching for smmap2>=2.0.0\n",
"Reading https://pypi.org/simple/smmap2/\n",
"Downloading https://files.pythonhosted.org/packages/55/d2/866d45e3a121ee15a1dc013824d58072fd5c7799c9c34d01378eb262ca8f/smmap2-2.0.5-py2.py3-none-any.whl#sha256=0555a7bf4df71d1ef4218e4807bbf9b201f910174e6e08af2e138d4e517b4dde\n",
"Best match: smmap2 2.0.5\n",
"Processing smmap2-2.0.5-py2.py3-none-any.whl\n",
"Installing smmap2-2.0.5-py2.py3-none-any.whl to /usr/local/lib/python3.6/dist-packages\n",
"Adding smmap2 2.0.5 to easy-install.pth file\n",
"\n",
"Installed /usr/local/lib/python3.6/dist-packages/smmap2-2.0.5-py3.6.egg\n",
"Searching for tqdm==4.28.1\n",
"Best match: tqdm 4.28.1\n",
"Adding tqdm 4.28.1 to easy-install.pth file\n",
"Installing tqdm script to /usr/local/bin\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for Sphinx==1.8.5\n",
"Best match: Sphinx 1.8.5\n",
"Adding Sphinx 1.8.5 to easy-install.pth file\n",
"Installing sphinx-apidoc script to /usr/local/bin\n",
"Installing sphinx-autogen script to /usr/local/bin\n",
"Installing sphinx-build script to /usr/local/bin\n",
"Installing sphinx-quickstart script to /usr/local/bin\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for scipy==1.2.1\n",
"Best match: scipy 1.2.1\n",
"Adding scipy 1.2.1 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for scikit-learn==0.20.3\n",
"Best match: scikit-learn 0.20.3\n",
"Adding scikit-learn 0.20.3 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for requests==2.21.0\n",
"Best match: requests 2.21.0\n",
"Adding requests 2.21.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for regex==2018.1.10\n",
"Best match: regex 2018.1.10\n",
"Adding regex 2018.1.10 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for pyzmq==17.0.0\n",
"Best match: pyzmq 17.0.0\n",
"Adding pyzmq 17.0.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for pexpect==4.7.0\n",
"Best match: pexpect 4.7.0\n",
"Adding pexpect 4.7.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for numpy==1.16.3\n",
"Best match: numpy 1.16.3\n",
"Adding numpy 1.16.3 to easy-install.pth file\n",
"Installing f2py script to /usr/local/bin\n",
"Installing f2py3 script to /usr/local/bin\n",
"Installing f2py3.6 script to /usr/local/bin\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for nltk==3.2.5\n",
"Best match: nltk 3.2.5\n",
"Adding nltk 3.2.5 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for joblib==0.12.5\n",
"Best match: joblib 0.12.5\n",
"Adding joblib 0.12.5 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for h5py==2.8.0\n",
"Best match: h5py 2.8.0\n",
"Adding h5py 2.8.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for botocore==1.12.148\n",
"Best match: botocore 1.12.148\n",
"Adding botocore 1.12.148 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for boto3==1.9.148\n",
"Best match: boto3 1.9.148\n",
"Adding boto3 1.9.148 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for Pillow==4.3.0\n",
"Best match: Pillow 4.3.0\n",
"Adding Pillow 4.3.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for six==1.12.0\n",
"Best match: six 1.12.0\n",
"Adding six 1.12.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for snowballstemmer==1.2.1\n",
"Best match: snowballstemmer 1.2.1\n",
"Adding snowballstemmer 1.2.1 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for Pygments==2.1.3\n",
"Best match: Pygments 2.1.3\n",
"Adding Pygments 2.1.3 to easy-install.pth file\n",
"Installing pygmentize script to /usr/local/bin\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for Babel==2.6.0\n",
"Best match: Babel 2.6.0\n",
"Adding Babel 2.6.0 to easy-install.pth file\n",
"Installing pybabel script to /usr/local/bin\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for Jinja2==2.10.1\n",
"Best match: Jinja2 2.10.1\n",
"Adding Jinja2 2.10.1 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for docutils==0.14\n",
"Best match: docutils 0.14\n",
"Adding docutils 0.14 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for alabaster==0.7.12\n",
"Best match: alabaster 0.7.12\n",
"Adding alabaster 0.7.12 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for sphinxcontrib-websupport==1.1.0\n",
"Best match: sphinxcontrib-websupport 1.1.0\n",
"Adding sphinxcontrib-websupport 1.1.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for setuptools==41.0.1\n",
"Best match: setuptools 41.0.1\n",
"Adding setuptools 41.0.1 to easy-install.pth file\n",
"Installing easy_install script to /usr/local/bin\n",
"Installing easy_install-3.6 script to /usr/local/bin\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for imagesize==1.1.0\n",
"Best match: imagesize 1.1.0\n",
"Adding imagesize 1.1.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for packaging==19.0\n",
"Best match: packaging 19.0\n",
"Adding packaging 19.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for certifi==2019.3.9\n",
"Best match: certifi 2019.3.9\n",
"Adding certifi 2019.3.9 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for chardet==3.0.4\n",
"Best match: chardet 3.0.4\n",
"Adding chardet 3.0.4 to easy-install.pth file\n",
"Installing chardetect script to /usr/local/bin\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for idna==2.8\n",
"Best match: idna 2.8\n",
"Adding idna 2.8 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for urllib3==1.24.3\n",
"Best match: urllib3 1.24.3\n",
"Adding urllib3 1.24.3 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for ptyprocess==0.6.0\n",
"Best match: ptyprocess 0.6.0\n",
"Adding ptyprocess 0.6.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for entrypoints==0.3\n",
"Best match: entrypoints 0.3\n",
"Adding entrypoints 0.3 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for jmespath==0.9.4\n",
"Best match: jmespath 0.9.4\n",
"Adding jmespath 0.9.4 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for python-dateutil==2.5.3\n",
"Best match: python-dateutil 2.5.3\n",
"Adding python-dateutil 2.5.3 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for s3transfer==0.2.0\n",
"Best match: s3transfer 0.2.0\n",
"Adding s3transfer 0.2.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for olefile==0.46\n",
"Best match: olefile 0.46\n",
"Adding olefile 0.46 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for pytz==2018.9\n",
"Best match: pytz 2018.9\n",
"Adding pytz 2018.9 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for MarkupSafe==1.1.1\n",
"Best match: MarkupSafe 1.1.1\n",
"Adding MarkupSafe 1.1.1 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Searching for pyparsing==2.4.0\n",
"Best match: pyparsing 2.4.0\n",
"Adding pyparsing 2.4.0 to easy-install.pth file\n",
"\n",
"Using /usr/local/lib/python3.6/dist-packages\n",
"Finished processing dependencies for parlai==0.1.0\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "hYQDi8xGcU4y",
"colab_type": "code",
"outputId": "cd152751-446f-4242-862c-3e7283a03821",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 3605
}
},
"source": [
"!python examples/display_data.py -t wizard_of_wikipedia"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"[ optional arguments: ] \n",
"[ display_ignore_fields: agent_reply ]\n",
"[ max_display_len: 1000 ]\n",
"[ num_examples: 10 ]\n",
"[ Main ParlAI Arguments: ] \n",
"[ batchsize: 1 ]\n",
"[ datapath: /root/ParlAI/data ]\n",
"[ datatype: train:stream ]\n",
"[ download_path: /root/ParlAI/downloads ]\n",
"[ hide_labels: False ]\n",
"[ image_mode: raw ]\n",
"[ multitask_weights: [1] ]\n",
"[ numthreads: 1 ]\n",
"[ show_advanced_args: False ]\n",
"[ task: wizard_of_wikipedia ]\n",
"[ ParlAI Model Arguments: ] \n",
"[ dict_class: None ]\n",
"[ init_model: None ]\n",
"[ model: None ]\n",
"[ model_file: None ]\n",
"[ PytorchData Arguments: ] \n",
"[ batch_length_range: 5 ]\n",
"[ batch_sort_cache_type: pop ]\n",
"[ batch_sort_field: text ]\n",
"[ numworkers: 4 ]\n",
"[ pytorch_context_length: -1 ]\n",
"[ pytorch_datapath: None ]\n",
"[ pytorch_include_labels: True ]\n",
"[ pytorch_preprocess: False ]\n",
"[ pytorch_teacher_batch_sort: False ]\n",
"[ pytorch_teacher_dataset: None ]\n",
"[ pytorch_teacher_task: None ]\n",
"[ shuffle: False ]\n",
"[ ParlAI Image Preprocessing Arguments: ] \n",
"[ image_cropsize: 224 ]\n",
"[ image_size: 256 ]\n",
"[ Wizard Dialog Knowledge arguments: ] \n",
"[ include_checked_sentence: True ]\n",
"[ include_knowledge: True ]\n",
"[ include_knowledge_separator: False ]\n",
"[ label_type: response ]\n",
"\n",
"\u001b[1;91m*************\u001b[1;93m*************\u001b[1;92m*************\u001b[1;94m*************\u001b[1;96m*************\u001b[1;95m*************\u001b[0m\u001b[0m\n",
"Thank you for using ParlAI! We are conducting a user survey.\n",
"Please fill it out at https://forms.gle/uEFbYGP7w6hiuGQT9\n",
"\n",
"\u001b[1mThe survey will close in \u001b[1;91m0 days\u001b[0m\u001b[1m, on May 17, 2019.\u001b[0m\n",
"\n",
"\u001b[0mTo suppress this message (and future announcements), run\n",
"`touch /root/ParlAI/data/noannouncements`\n",
"\u001b[1;91m*************\u001b[1;93m*************\u001b[1;92m*************\u001b[1;94m*************\u001b[1;96m*************\u001b[1;95m*************\u001b[0m\n",
"\u001b[0m\n",
"[creating task(s): wizard_of_wikipedia]\n",
"[building data: /root/ParlAI/data/wizard_of_wikipedia]\n",
"[ downloading: http://parl.ai/downloads/wizard_of_wikipedia/wizard_of_wikipedia.tgz to /root/ParlAI/data/wizard_of_wikipedia/wizard_of_wikipedia.tgz ]\n",
"Downloading wizard_of_wikipedia.tgz: 100% 972M/972M [00:34<00:00, 28.1MB/s]\n",
"unpacking wizard_of_wikipedia.tgz\n",
"loading: /root/ParlAI/data/wizard_of_wikipedia/train.json\n",
"[chosen_topic]: Science fiction\n",
"[knowledge]: Science fiction Science fiction (often shortened to SF or sci-fi) is a genre of speculative fiction, typically dealing with imaginative concepts such as futuristic science and technology, space travel, time travel, faster than light travel, parallel universes, and extraterrestrial life.\n",
"Science fiction Science fiction often explores the potential consequences of scientific and other innovations, and has been called a \"literature of ideas\".\n",
"Science fiction It usually avoids the supernatural, unlike the related genre of fantasy.\n",
"Science fiction Historically, science-fiction stories have had a grounding in actual science, but now this is only expected of hard science fiction.\n",
"Science fiction Science fiction is difficult to define, as it includes a wide range of subgenres and themes.\n",
"Science ...\n",
"instructive.\n",
"Science fiction They supply knowledge... in a very palatable form... New adventures pictured for us in the scientifiction of today are not at all impossible of realization tomorrow...\n",
"\n",
"[title]: Science fiction\n",
"[checked_sentence]: Science fiction (often shortened to SF or sci-fi) is a genre of speculative fiction, typically dealing with imaginative concepts such as futuristic science and technology, space travel, time travel, faster than light travel, parallel universes, and extraterrestrial life.\n",
"[wizard_of_wikipedia]: Science fiction\n",
"[labels: I think science fiction is an amazing genre for anything. Future science, technology, time travel, FTL travel, they're all such interesting concepts.]\n",
"~~\n",
"[chosen_topic]: Science fiction\n",
"[knowledge]: Science fiction Science fiction (often shortened to SF or sci-fi) is a genre of speculative fiction, typically dealing with imaginative concepts such as futuristic science and technology, space travel, time travel, faster than light travel, parallel universes, and extraterrestrial life.\n",
"Science fiction Science fiction often explores the potential consequences of scientific and other innovations, and has been called a \"literature of ideas\".\n",
"Science fiction It usually avoids the supernatural, unlike the related genre of fantasy.\n",
"Science fiction Historically, science-fiction stories have had a grounding in actual science, but now this is only expected of hard science fiction.\n",
"Science fiction Science fiction is difficult to define, as it includes a wide range of subgenres and themes.\n",
"Science ...\n",
"used extensively in the \"Stargate Atlantis\" series.\n",
"List of starships in Stargate Puddle Jumpers were created by the Ancients and most exist within the city built by the Ancients known as Atlantis.\n",
"\n",
"[title]: Science fiction film\n",
"[checked_sentence]: Science fiction films have often been used to focus on political or social issues, and to explore philosophical issues like the human condition.\n",
"[wizard_of_wikipedia]: I'm a huge fan of science fiction myself! \n",
"[labels: Awesome! I really love how sci-fi storytellers focus on political/social/philosophical issues that would still be around even in the future. Makes them relatable.]\n",
"~~\n",
"[chosen_topic]: Science fiction\n",
"[knowledge]: Science fiction Science fiction (often shortened to SF or sci-fi) is a genre of speculative fiction, typically dealing with imaginative concepts such as futuristic science and technology, space travel, time travel, faster than light travel, parallel universes, and extraterrestrial life.\n",
"Science fiction Science fiction often explores the potential consequences of scientific and other innovations, and has been called a \"literature of ideas\".\n",
"Science fiction It usually avoids the supernatural, unlike the related genre of fantasy.\n",
"Science fiction Historically, science-fiction stories have had a grounding in actual science, but now this is only expected of hard science fiction.\n",
"Science fiction Science fiction is difficult to define, as it includes a wide range of subgenres and themes.\n",
"Science ...\n",
"for the Marvel One-Shots short film series, and other related projects of the MCU, including the fanfares for the two Marvel Studios logos, composed by Tyler and Michael Giacchino, respectively.\n",
"\n",
"[title]: Time travel in fiction\n",
"[checked_sentence]: The central premise for these stories oftentimes involves changing history, either intentionally or by accident, and the ways by which altering the past changes the future and creates an altered present or future for the time traveler when they return home.\n",
"[wizard_of_wikipedia]: I agree. One of my favorite forms of science fiction is anything related to time travel! I find it fascinating.\n",
"[labels: It's not quite sci-fi, but my favorite version of time travel is in Harry Potter and the Prisoner of Azkaban. Breaks zero logical rules.]\n",
"~~\n",
"[chosen_topic]: Science fiction\n",
"[knowledge]: Science fiction Science fiction (often shortened to SF or sci-fi) is a genre of speculative fiction, typically dealing with imaginative concepts such as futuristic science and technology, space travel, time travel, faster than light travel, parallel universes, and extraterrestrial life.\n",
"Science fiction Science fiction often explores the potential consequences of scientific and other innovations, and has been called a \"literature of ideas\".\n",
"Science fiction It usually avoids the supernatural, unlike the related genre of fantasy.\n",
"Science fiction Historically, science-fiction stories have had a grounding in actual science, but now this is only expected of hard science fiction.\n",
"Science fiction Science fiction is difficult to define, as it includes a wide range of subgenres and themes.\n",
"Science ...\n",
"series) The series was mainly produced by David Heyman, and stars Daniel Radcliffe, Rupert Grint, and Emma Watson as the three leading characters: Harry Potter, Ron Weasley, and Hermione Granger.\n",
"\n",
"[title]: Science fiction\n",
"[checked_sentence]: Science fiction often explores the potential consequences of scientific and other innovations, and has been called a \"literature of ideas\".\n",
"[wizard_of_wikipedia]: And that's difficult to do when dealing with time travel. I actually haven't seen the latest Harry Potter movies. Guess it's time to check them out!\n",
"[labels: If you really want a look at the potential negative consequences of scientific innovation, what you should check out is the TV show Fringe. Incredibly well written.]\n",
"- - - - - - - - - - - - - - - - - - - - -\n",
"~~\n",
"[chosen_topic]: Internet access\n",
"[knowledge]: Internet access Internet access is the ability of individuals and organizations to connect to the Internet using computer terminals, computers, and other devices; and to access services such as email and the World Wide Web.\n",
"Internet access Various technologies, at a wide range of speeds have been used by Internet service providers (ISPs) to provide this service.\n",
"Internet access Internet access was once rare, but has grown rapidly.\n",
"Internet access In 1995, only percent of the world's population had access, with well over half of those living in the United States, and consumer use was through dial-up.\n",
"Internet access By the first decade of the 21st century, many consumers in developed nations used faster broadband technology, and by 2014, 41 percent of the world's population had access, ...\n",
"for example in seconds per 30 years outage time as in the PSTN network) or security (say AES-128 as required for smart grid applications in the US) are often also assumed or defined as requirements.\n",
"\n",
"[title]: Internet access\n",
"[checked_sentence]: Internet access was once rare, but has grown rapidly.\n",
"[wizard_of_wikipedia]: Internet access\n",
"Can you imagine the world without internet access? \n",
"[labels: No I could not! I couldn't imagine living when internet access was rare and very few people had it!]\n",
"~~\n",
"[chosen_topic]: Internet access\n",
"[knowledge]: Internet access Internet access is the ability of individuals and organizations to connect to the Internet using computer terminals, computers, and other devices; and to access services such as email and the World Wide Web.\n",
"Internet access Various technologies, at a wide range of speeds have been used by Internet service providers (ISPs) to provide this service.\n",
"Internet access Internet access was once rare, but has grown rapidly.\n",
"Internet access In 1995, only percent of the world's population had access, with well over half of those living in the United States, and consumer use was through dial-up.\n",
"Internet access By the first decade of the 21st century, many consumers in developed nations used faster broadband technology, and by 2014, 41 percent of the world's population had access, ...\n",
"The origins of the Internet date back to research commissioned by the United States Federal Government in the 1960s to build robust, fault-tolerant communication via computer networks.\n",
"\n",
"[title]: Internet access\n",
"[checked_sentence]: Use by a wider audience only came in 1995 when restrictions on the use of the Internet to carry commercial traffic were lifted.\n",
"[wizard_of_wikipedia]: Oh me either! It seems like such a long time ago. I wonder when Internet was first created?\n",
"[labels: It used to be restricted, but around 1995, the restricted were lifted and commercial use of it began]\n",
"~~\n",
"[chosen_topic]: Internet access\n",
"[knowledge]: Internet access Internet access is the ability of individuals and organizations to connect to the Internet using computer terminals, computers, and other devices; and to access services such as email and the World Wide Web.\n",
"Internet access Various technologies, at a wide range of speeds have been used by Internet service providers (ISPs) to provide this service.\n",
"Internet access Internet access was once rare, but has grown rapidly.\n",
"Internet access In 1995, only percent of the world's population had access, with well over half of those living in the United States, and consumer use was through dial-up.\n",
"Internet access By the first decade of the 21st century, many consumers in developed nations used faster broadband technology, and by 2014, 41 percent of the world's population had access, ...\n",
"light, smoke, and floating materials (confetti for example).\n",
"Fireworks They may be designed to burn with colored flames and sparks including red, orange, yellow, green, blue, purple, and silver.\n",
"\n",
"[title]: Internet access\n",
"[checked_sentence]: The Internet developed from the ARPANET, which was funded by the US government to support projects within the government and at universities and research laboratories in the US – but grew over time to include most of the world's large universities and the research arms of many technology companies.\n",
"[wizard_of_wikipedia]: That is awesome. I wonder why it was restricted? Probably because they only wanted government and big companies to use it at first.\n",
"[labels: Yes, it was developed from a government funded projects to help with universities research and laboratories in the United States...I am so glad they expanded it! ]\n",
"~~\n",
"[chosen_topic]: Internet access\n",
"[knowledge]: Internet access Internet access is the ability of individuals and organizations to connect to the Internet using computer terminals, computers, and other devices; and to access services such as email and the World Wide Web.\n",
"Internet access Various technologies, at a wide range of speeds have been used by Internet service providers (ISPs) to provide this service.\n",
"Internet access Internet access was once rare, but has grown rapidly.\n",
"Internet access In 1995, only percent of the world's population had access, with well over half of those living in the United States, and consumer use was through dial-up.\n",
"Internet access By the first decade of the 21st century, many consumers in developed nations used faster broadband technology, and by 2014, 41 percent of the world's population had access, ...\n",
"the ARPANET in 1969 from computer science Professor Leonard Kleinrock's laboratory at University of California, Los Angeles (UCLA) to the second network node at Stanford Research Institute (SRI).\n",
"\n",
"[title]: Internet access\n",
"[checked_sentence]: Internet access is the ability of individuals and organizations to connect to the Internet using computer terminals, computers, and other devices; and to access services such as email and the World Wide Web.\n",
"[wizard_of_wikipedia]: I am too, it makes life so much easier!\n",
"[labels: What is your favorite thing to do with internet access? I like being able to use my computer and smartphone to use my email and browse the world wide web]\n",
"- - - - - - - - - - - - - - - - - - - - -\n",
"~~\n",
"[chosen_topic]: Pharmacist\n",
"[knowledge]: Pharmacist Pharmacists, also known as chemists (Commonwealth English) or druggists (North American and, archaically, Commonwealth English), are healthcare professionals who practice in pharmacy, the field of health sciences focusing on safe and effective medication use.\n",
"Pharmacist A pharmacist is a member of the health care team directly involved with patient care.\n",
"Pharmacist Pharmacists undergo university-level education to understand the biochemical mechanisms and actions of drugs, drug uses, therapeutic roles, side effects, potential drug interactions, and monitoring parameters.\n",
"Pharmacist This is mated to anatomy, physiology, and pathophysiology.\n",
"Pharmacist Pharmacists interpret and communicate this specialized knowledge to patients, physicians, and other health care ...\n",
"University Task Force The Task Force recommended that the admission of students to all the 7 M.Ed.\n",
"Bangalore University Task Force colleges be suspended for the academic year 2012 - 13.\n",
"\n",
"[title]: Pharmacy technician\n",
"[checked_sentence]: They may also perform administrative duties in pharmaceutical practice, such as reviewing prescription requests with doctor's offices and insurance companies to ensure correct medications are provided and payment is received.\n",
"[wizard_of_wikipedia]: Pharmacist\n",
"I am just finishing my university course and I will be a qualified pharmacist. I am so excited about finishing and getting out there into the world of work! Do you work yourself?\n",
"[labels: Yes, I perform administrative duties as a pharmacy technician.]\n",
"~~\n",
"[chosen_topic]: Pharmacist\n",
"[knowledge]: Pharmacist Pharmacists, also known as chemists (Commonwealth English) or druggists (North American and, archaically, Commonwealth English), are healthcare professionals who practice in pharmacy, the field of health sciences focusing on safe and effective medication use.\n",
"Pharmacist A pharmacist is a member of the health care team directly involved with patient care.\n",
"Pharmacist Pharmacists undergo university-level education to understand the biochemical mechanisms and actions of drugs, drug uses, therapeutic roles, side effects, potential drug interactions, and monitoring parameters.\n",
"Pharmacist This is mated to anatomy, physiology, and pathophysiology.\n",
"Pharmacist Pharmacists interpret and communicate this specialized knowledge to patients, physicians, and other health care ...\n",
"recruited locally to perform regulatory and administrative duties, but also perform some community policing duties in location such as Norfolk Island, Christmas Island and Jervis Bay Territory.\n",
"\n",
"[title]: Pharmacist\n",
"[checked_sentence]: A pharmacist is a member of the health care team directly involved with patient care.\n",
"[wizard_of_wikipedia]: Fantastic so you know all about the field. I completed my four year course and also two 6 month placements but its not the same until you actually start working. Do you work in a busy pharmacy?\n",
"[labels: Yes, I work directly with a lot of patients.]\n",
"~~\n",
"[ loaded 18430 episodes with a total of 74092 examples ]\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Bys_Kq86hBX7",
"colab_type": "code",
"outputId": "d6c0f9be-73b9-44bf-e159-c7426845ebaf",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"%cd data/"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"/root/ParlAI/data\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "hEvDs6FHhFoV",
"colab_type": "code",
"outputId": "07a0a534-c0bd-4c44-d773-9573e40b2347",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"%cd wizard_of_wikipedia/"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"/root/ParlAI/data/wizard_of_wikipedia\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Wv49pYQIhVji",
"colab_type": "code",
"outputId": "44acd13f-0174-4dab-917d-0274a401f71c",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 159
}
},
"source": [
"!ls -l"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"total 2990700\n",
"-rw-rw-r-- 1 1185200140 1185200140 1531216535 Nov 5 2018 data.json\n",
"-rw-rw-r-- 1 1185200140 1185200140 132457230 Nov 5 2018 test_random_split.json\n",
"-rw-rw-r-- 1 1185200140 1185200140 131854205 Nov 5 2018 test_topic_split.json\n",
"-rw-rw-r-- 1 1185200140 1185200140 22458 Nov 5 2018 topic_splits.json\n",
"-rw-rw-r-- 1 1185200140 1185200140 997181494 Nov 5 2018 train.json\n",
"-rw-rw-r-- 1 1185200140 1185200140 135977298 Nov 5 2018 valid_random_split.json\n",
"-rw-rw-r-- 1 1185200140 1185200140 133746308 Nov 5 2018 valid_topic_split.json\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Pgg-TjXNhyTK",
"colab_type": "code",
"colab": {}
},
"source": [
"import json\n",
"filename = './test_topic_split.json'\n",
"if filename:\n",
" with open(filename, 'r') as f:\n",
" datastore = json.load(f)"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "IVySMuGKiR2m",
"colab_type": "code",
"outputId": "864412d6-955b-4e4c-c159-87a8cf588e5d",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"datastore[1].keys()"
],
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"dict_keys(['chosen_topic', 'persona', 'wizard_eval', 'dialog', 'chosen_topic_passage'])"
]
},
"metadata": {
"tags": []
},
"execution_count": 58
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "KkyscbPJjGqv",
"colab_type": "code",
"outputId": "05c04398-3aca-4680-9e33-768c33b59aec",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"len(datastore[1]['dialog'])"
],
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"8"
]
},
"metadata": {
"tags": []
},
"execution_count": 72
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "NlDAc86wivbU",
"colab_type": "code",
"outputId": "176ad657-1083-4a7f-98c8-b2fc4f7d1780",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"type(datastore[1]['dialog'][0])"
],
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"dict"
]
},
"metadata": {
"tags": []
},
"execution_count": 70
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "X0Ipm5rRjB7l",
"colab_type": "code",
"outputId": "b8004c2a-e00f-427d-fb51-55c8a2f9fe28",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"datastore[1]['dialog'][0].keys()"
],
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"dict_keys(['speaker', 'text', 'candidate_responses', 'retrieved_passages', 'retrieved_topics'])"
]
},
"metadata": {
"tags": []
},
"execution_count": 71
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "QvtbDDFKjLRl",
"colab_type": "code",
"outputId": "d595ebce-cd08-4072-95fe-8f661595e270",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 53
}
},
"source": [
"print(datastore[1]['dialog'][0]['speaker'])\n",
"print(datastore[1]['dialog'][1]['speaker'])"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"0_Apprentice\n",
"1_Wizard\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "1Sdwr25yjS1f",
"colab_type": "code",
"outputId": "3470f05e-5365-4270-8cad-a7ac82af64ab",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
}
},
"source": [
"datastore[1]['dialog'][3]['text']"
],
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'There are lots of low-lying mountains in Ireland. Do you fancy a hike?'"
]
},
"metadata": {
"tags": []
},
"execution_count": 81
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment