{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "gVQ4p7NWzaB6", "outputId": "5825d1b7-5f9f-4860-885e-2b1f4040d92c" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\u001b[33mWarning: `huggingface-cli` is deprecated and no longer works. Use `hf` instead.\n", "\u001b[0m\n", "\u001b[90mHint: A new version of huggingface_hub (1.16.4) is available! You are using version 1.16.1.\n", "To update, run: hf update\u001b[0m\n", "\u001b[90mHint: `hf` is already installed! Use it directly.\n", "\u001b[0m\n", "\u001b[90mHint: Examples:\n", " hf auth login\n", " hf download unsloth/gemma-4-31B-it-GGUF\n", " hf upload my-cool-model . .\n", " hf models ls --search \"gemma\"\n", " hf repos ls --format json\n", " hf jobs run python:3.12 python -c 'print(\"Hello!\")'\n", " hf --help\n", "\u001b[0m\n" ] } ], "source": [ "!huggingface-cli login --token #insert" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "sT1QlPxfynvS", "outputId": "2d510f01-8a30-4888-df3e-c3d3d53fe8ab" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Collecting rdflib\n", " Downloading rdflib-7.6.0-py3-none-any.whl.metadata (12 kB)\n", "Requirement already satisfied: pyparsing<4,>=2.1.0 in /usr/local/lib/python3.12/dist-packages (from rdflib) (3.3.2)\n", "Downloading rdflib-7.6.0-py3-none-any.whl (615 kB)\n", "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/615.4 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m615.4/615.4 kB\u001b[0m \u001b[31m42.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: rdflib\n", "Successfully installed rdflib-7.6.0\n", "Requirement already satisfied: gradio in /usr/local/lib/python3.12/dist-packages (5.50.0)\n", "Collecting gradio\n", " Downloading gradio-6.15.1-py3-none-any.whl.metadata (17 kB)\n", "Requirement already satisfied: anyio<5.0,>=3.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (4.13.0)\n", "Requirement already satisfied: brotli>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (1.2.0)\n", "Requirement already satisfied: fastapi<1.0,>=0.115.2 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.136.1)\n", "Collecting gradio-client==2.5.0 (from gradio)\n", " Downloading gradio_client-2.5.0-py3-none-any.whl.metadata (7.1 kB)\n", "Requirement already satisfied: groovy~=0.1 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.1.2)\n", "Collecting hf-gradio<1.0,>=0.4.1 (from gradio)\n", " Downloading hf_gradio-0.4.1-py3-none-any.whl.metadata (428 bytes)\n", "Requirement already satisfied: httpx<1.0,>=0.24.1 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.28.1)\n", "Requirement already satisfied: huggingface-hub<2.0,>=0.33.5 in /usr/local/lib/python3.12/dist-packages (from gradio) (1.16.1)\n", "Requirement already satisfied: jinja2<4.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (3.1.6)\n", "Requirement already satisfied: markupsafe<4.0,>=2.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (3.0.3)\n", "Requirement already satisfied: numpy<3.0,>=1.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (2.0.2)\n", "Requirement already satisfied: orjson~=3.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (3.11.9)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.12/dist-packages (from gradio) (26.2)\n", "Requirement already satisfied: pandas<4.0,>=1.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (2.2.2)\n", "Requirement already satisfied: pillow<13.0,>=8.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (11.3.0)\n", "Requirement already satisfied: pydantic<=3.0,>=2.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (2.12.3)\n", "Requirement already satisfied: pydub<1.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.25.1)\n", "Requirement already satisfied: python-multipart<1.0,>=0.0.18 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.0.29)\n", "Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.12/dist-packages (from gradio) (2025.2)\n", "Requirement already satisfied: pyyaml<7.0,>=5.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (6.0.3)\n", "Requirement already satisfied: safehttpx<0.2.0,>=0.1.7 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.1.7)\n", "Requirement already satisfied: semantic-version~=2.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (2.10.0)\n", "Requirement already satisfied: starlette<2.0,>=0.40.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.52.1)\n", "Requirement already satisfied: tomlkit<0.15.0,>=0.12.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.13.3)\n", "Requirement already satisfied: typer<1.0,>=0.12 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.25.1)\n", "Requirement already satisfied: typing-extensions~=4.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (4.15.0)\n", "Requirement already satisfied: uvicorn>=0.14.0 in /usr/local/lib/python3.12/dist-packages (from gradio) (0.47.0)\n", "Requirement already satisfied: fsspec in /usr/local/lib/python3.12/dist-packages (from gradio-client==2.5.0->gradio) (2025.3.0)\n", "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.12/dist-packages (from anyio<5.0,>=3.0->gradio) (3.15)\n", "Requirement already satisfied: typing-inspection>=0.4.2 in /usr/local/lib/python3.12/dist-packages (from fastapi<1.0,>=0.115.2->gradio) (0.4.2)\n", "Requirement already satisfied: annotated-doc>=0.0.2 in /usr/local/lib/python3.12/dist-packages (from fastapi<1.0,>=0.115.2->gradio) (0.0.4)\n", "Requirement already satisfied: certifi in /usr/local/lib/python3.12/dist-packages (from httpx<1.0,>=0.24.1->gradio) (2026.5.20)\n", "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.12/dist-packages (from httpx<1.0,>=0.24.1->gradio) (1.0.9)\n", "Requirement already satisfied: h11>=0.16 in /usr/local/lib/python3.12/dist-packages (from httpcore==1.*->httpx<1.0,>=0.24.1->gradio) (0.16.0)\n", "Requirement already satisfied: filelock>=3.10.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub<2.0,>=0.33.5->gradio) (3.29.0)\n", "Requirement already satisfied: hf-xet<2.0.0,>=1.4.3 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub<2.0,>=0.33.5->gradio) (1.5.0)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub<2.0,>=0.33.5->gradio) (4.67.3)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.12/dist-packages (from pandas<4.0,>=1.0->gradio) (2.9.0.post0)\n", "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.12/dist-packages (from pandas<4.0,>=1.0->gradio) (2026.2)\n", "Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/lib/python3.12/dist-packages (from pydantic<=3.0,>=2.0->gradio) (0.7.0)\n", "Requirement already satisfied: pydantic-core==2.41.4 in /usr/local/lib/python3.12/dist-packages (from pydantic<=3.0,>=2.0->gradio) (2.41.4)\n", "Requirement already satisfied: click>=8.2.1 in /usr/local/lib/python3.12/dist-packages (from typer<1.0,>=0.12->gradio) (8.4.0)\n", "Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.12/dist-packages (from typer<1.0,>=0.12->gradio) (1.5.4)\n", "Requirement already satisfied: rich>=13.8.0 in /usr/local/lib/python3.12/dist-packages (from typer<1.0,>=0.12->gradio) (13.9.4)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.12/dist-packages (from python-dateutil>=2.8.2->pandas<4.0,>=1.0->gradio) (1.17.0)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.12/dist-packages (from rich>=13.8.0->typer<1.0,>=0.12->gradio) (4.2.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.12/dist-packages (from rich>=13.8.0->typer<1.0,>=0.12->gradio) (2.20.0)\n", "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.12/dist-packages (from markdown-it-py>=2.2.0->rich>=13.8.0->typer<1.0,>=0.12->gradio) (0.1.2)\n", "Downloading gradio-6.15.1-py3-none-any.whl (20.1 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.1/20.1 MB\u001b[0m \u001b[31m40.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading gradio_client-2.5.0-py3-none-any.whl (59 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.0/60.0 kB\u001b[0m \u001b[31m2.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading hf_gradio-0.4.1-py3-none-any.whl (4.5 kB)\n", "Installing collected packages: gradio-client, hf-gradio, gradio\n", " Attempting uninstall: gradio-client\n", " Found existing installation: gradio_client 1.14.0\n", " Uninstalling gradio_client-1.14.0:\n", " Successfully uninstalled gradio_client-1.14.0\n", " Attempting uninstall: gradio\n", " Found existing installation: gradio 5.50.0\n", " Uninstalling gradio-5.50.0:\n", " Successfully uninstalled gradio-5.50.0\n", "Successfully installed gradio-6.15.1 gradio-client-2.5.0 hf-gradio-0.4.1\n", "Requirement already satisfied: ipywidgets in /usr/local/lib/python3.12/dist-packages (7.7.1)\n", "Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.12/dist-packages (from ipywidgets) (6.17.1)\n", "Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets) (0.2.0)\n", "Requirement already satisfied: traitlets>=4.3.1 in /usr/local/lib/python3.12/dist-packages (from ipywidgets) (5.7.1)\n", "Requirement already satisfied: widgetsnbextension~=3.6.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets) (3.6.10)\n", "Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets) (7.34.0)\n", "Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets) (3.0.16)\n", "Requirement already satisfied: debugpy>=1.0 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets) (1.8.15)\n", "Requirement already satisfied: jupyter-client>=6.1.12 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets) (7.4.9)\n", "Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets) (0.2.2)\n", "Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets) (1.6.0)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets) (26.2)\n", "Requirement already satisfied: psutil in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets) (5.9.5)\n", "Requirement already satisfied: pyzmq>=17 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets) (26.2.1)\n", "Requirement already satisfied: tornado>=6.1 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets) (6.5.1)\n", "Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets) (75.2.0)\n", "Collecting jedi>=0.16 (from ipython>=4.0.0->ipywidgets)\n", " Downloading jedi-0.20.0-py2.py3-none-any.whl.metadata (23 kB)\n", "Requirement already satisfied: decorator in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets) (4.4.2)\n", "Requirement already satisfied: pickleshare in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets) (0.7.5)\n", "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets) (3.0.52)\n", "Requirement already satisfied: pygments in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets) (2.20.0)\n", "Requirement already satisfied: backcall in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets) (0.2.0)\n", "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets) (4.9.0)\n", "Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.12/dist-packages (from widgetsnbextension~=3.6.0->ipywidgets) (6.5.7)\n", "Requirement already satisfied: parso<0.9.0,>=0.8.6 in /usr/local/lib/python3.12/dist-packages (from jedi>=0.16->ipython>=4.0.0->ipywidgets) (0.8.7)\n", "Requirement already satisfied: entrypoints in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets) (0.4)\n", "Requirement already satisfied: jupyter-core>=4.9.2 in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets) (5.9.1)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets) (2.9.0.post0)\n", "Requirement already satisfied: jinja2 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (3.1.6)\n", "Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (25.1.0)\n", "Requirement already satisfied: nbformat in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (5.10.4)\n", "Requirement already satisfied: nbconvert>=5 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (7.17.1)\n", "Requirement already satisfied: Send2Trash>=1.8.0 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (2.1.0)\n", "Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.18.1)\n", "Requirement already satisfied: prometheus-client in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.25.0)\n", "Requirement already satisfied: nbclassic>=0.4.7 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.3.3)\n", "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.12/dist-packages (from pexpect>4.3->ipython>=4.0.0->ipywidgets) (0.7.0)\n", "Requirement already satisfied: wcwidth in /usr/local/lib/python3.12/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets) (0.7.0)\n", "Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.12/dist-packages (from jupyter-core>=4.9.2->jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets) (4.9.6)\n", "Requirement already satisfied: notebook-shim>=0.2.3 in /usr/local/lib/python3.12/dist-packages (from nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.2.4)\n", "Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (4.13.5)\n", "Requirement already satisfied: bleach!=5.0.0 in /usr/local/lib/python3.12/dist-packages (from bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (6.3.0)\n", "Requirement already satisfied: defusedxml in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.7.1)\n", "Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.3.0)\n", "Requirement already satisfied: markupsafe>=2.0 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (3.0.3)\n", "Requirement already satisfied: mistune<4,>=2.0.3 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (3.2.1)\n", "Requirement already satisfied: nbclient>=0.5.0 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.10.4)\n", "Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.5.1)\n", "Requirement already satisfied: fastjsonschema>=2.15 in /usr/local/lib/python3.12/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (2.21.2)\n", "Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.12/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (4.26.0)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.12/dist-packages (from python-dateutil>=2.8.2->jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets) (1.17.0)\n", "Requirement already satisfied: argon2-cffi-bindings in /usr/local/lib/python3.12/dist-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (25.1.0)\n", "Requirement already satisfied: webencodings in /usr/local/lib/python3.12/dist-packages (from bleach!=5.0.0->bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.5.1)\n", "Requirement already satisfied: tinycss2<1.5,>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.4.0)\n", "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (26.1.0)\n", "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (2025.9.1)\n", "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.37.0)\n", "Requirement already satisfied: rpds-py>=0.25.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.30.0)\n", "Requirement already satisfied: jupyter-server<3,>=1.8 in /usr/local/lib/python3.12/dist-packages (from notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (2.14.0)\n", "Requirement already satisfied: cffi>=1.0.1 in /usr/local/lib/python3.12/dist-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (2.0.0)\n", "Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.12/dist-packages (from beautifulsoup4->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (2.8.3)\n", "Requirement already satisfied: typing-extensions>=4.0.0 in /usr/local/lib/python3.12/dist-packages (from beautifulsoup4->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (4.15.0)\n", "Requirement already satisfied: pycparser in /usr/local/lib/python3.12/dist-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (3.0)\n", "Requirement already satisfied: anyio>=3.1.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (4.13.0)\n", "Requirement already satisfied: jupyter-events>=0.9.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.12.1)\n", "Requirement already satisfied: jupyter-server-terminals>=0.4.4 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.5.4)\n", "Requirement already satisfied: overrides>=5.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (7.7.0)\n", "Requirement already satisfied: websocket-client>=1.7 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.9.0)\n", "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.12/dist-packages (from anyio>=3.1.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (3.15)\n", "Requirement already satisfied: python-json-logger>=2.0.4 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (4.1.0)\n", "Requirement already satisfied: pyyaml>=5.3 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (6.0.3)\n", "Requirement already satisfied: rfc3339-validator in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.1.4)\n", "Requirement already satisfied: rfc3986-validator>=0.1.1 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (0.1.1)\n", "Requirement already satisfied: fqdn in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.5.1)\n", "Requirement already satisfied: isoduration in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (20.11.0)\n", "Requirement already satisfied: jsonpointer>1.13 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (3.1.1)\n", "Requirement already satisfied: rfc3987-syntax>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.1.0)\n", "Requirement already satisfied: uri-template in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.3.0)\n", "Requirement already satisfied: webcolors>=24.6.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (25.10.0)\n", "Requirement already satisfied: lark>=1.2.2 in /usr/local/lib/python3.12/dist-packages (from rfc3987-syntax>=1.1.0->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.3.1)\n", "Requirement already satisfied: arrow>=0.15.0 in /usr/local/lib/python3.12/dist-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (1.4.0)\n", "Requirement already satisfied: tzdata in /usr/local/lib/python3.12/dist-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets) (2026.2)\n", "Downloading jedi-0.20.0-py2.py3-none-any.whl (4.9 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m4.9/4.9 MB\u001b[0m \u001b[31m36.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: jedi\n", "Successfully installed jedi-0.20.0\n" ] } ], "source": [ "!pip install rdflib\n", "!pip install --upgrade gradio\n", "!pip install ipywidgets" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "nBOgCak400yg" }, "outputs": [], "source": [ "#!pip install pythreejs ipywidgets\n", "from google.colab import output\n", "output.enable_custom_widget_manager()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "V54DmOWJ-8eC", "outputId": "9d5db769-1674-4606-cb44-9d92b150dbc6" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Collecting smolagents\n", " Downloading smolagents-1.25.0-py3-none-any.whl.metadata (17 kB)\n", "Requirement already satisfied: huggingface-hub>=0.31.2 in /usr/local/lib/python3.12/dist-packages (from smolagents) (1.16.1)\n", "Requirement already satisfied: requests>=2.32.3 in /usr/local/lib/python3.12/dist-packages (from smolagents) (2.32.4)\n", "Requirement already satisfied: rich>=13.9.4 in /usr/local/lib/python3.12/dist-packages (from smolagents) (13.9.4)\n", "Requirement already satisfied: jinja2>=3.1.4 in /usr/local/lib/python3.12/dist-packages (from smolagents) (3.1.6)\n", "Requirement already satisfied: pillow>=10.0.1 in /usr/local/lib/python3.12/dist-packages (from smolagents) (11.3.0)\n", "Requirement already satisfied: python-dotenv in /usr/local/lib/python3.12/dist-packages (from smolagents) (1.2.2)\n", "Requirement already satisfied: filelock>=3.10.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (3.29.0)\n", "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (2025.3.0)\n", "Requirement already satisfied: hf-xet<2.0.0,>=1.4.3 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (1.5.0)\n", "Requirement already satisfied: httpx<1,>=0.23.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (0.28.1)\n", "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (26.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (6.0.3)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (4.67.3)\n", "Requirement already satisfied: typer>=0.20.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (0.25.1)\n", "Requirement already satisfied: typing-extensions>=4.1.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents) (4.15.0)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.12/dist-packages (from jinja2>=3.1.4->smolagents) (3.0.3)\n", "Requirement already satisfied: charset_normalizer<4,>=2 in /usr/local/lib/python3.12/dist-packages (from requests>=2.32.3->smolagents) (3.4.7)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.12/dist-packages (from requests>=2.32.3->smolagents) (3.15)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.12/dist-packages (from requests>=2.32.3->smolagents) (2.5.0)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.12/dist-packages (from requests>=2.32.3->smolagents) (2026.5.20)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.12/dist-packages (from rich>=13.9.4->smolagents) (4.2.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.12/dist-packages (from rich>=13.9.4->smolagents) (2.20.0)\n", "Requirement already satisfied: anyio in /usr/local/lib/python3.12/dist-packages (from httpx<1,>=0.23.0->huggingface-hub>=0.31.2->smolagents) (4.13.0)\n", "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.12/dist-packages (from httpx<1,>=0.23.0->huggingface-hub>=0.31.2->smolagents) (1.0.9)\n", "Requirement already satisfied: h11>=0.16 in /usr/local/lib/python3.12/dist-packages (from httpcore==1.*->httpx<1,>=0.23.0->huggingface-hub>=0.31.2->smolagents) (0.16.0)\n", "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.12/dist-packages (from markdown-it-py>=2.2.0->rich>=13.9.4->smolagents) (0.1.2)\n", "Requirement already satisfied: click>=8.2.1 in /usr/local/lib/python3.12/dist-packages (from typer>=0.20.0->huggingface-hub>=0.31.2->smolagents) (8.4.0)\n", "Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.12/dist-packages (from typer>=0.20.0->huggingface-hub>=0.31.2->smolagents) (1.5.4)\n", "Requirement already satisfied: annotated-doc>=0.0.2 in /usr/local/lib/python3.12/dist-packages (from typer>=0.20.0->huggingface-hub>=0.31.2->smolagents) (0.0.4)\n", "Downloading smolagents-1.25.0-py3-none-any.whl (164 kB)\n", "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/164.7 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m164.7/164.7 kB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: smolagents\n", "Successfully installed smolagents-1.25.0\n", "Requirement already satisfied: smolagents[transformers] in /usr/local/lib/python3.12/dist-packages (1.25.0)\n", "Requirement already satisfied: huggingface-hub>=0.31.2 in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (1.16.1)\n", "Requirement already satisfied: requests>=2.32.3 in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (2.32.4)\n", "Requirement already satisfied: rich>=13.9.4 in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (13.9.4)\n", "Requirement already satisfied: jinja2>=3.1.4 in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (3.1.6)\n", "Requirement already satisfied: pillow>=10.0.1 in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (11.3.0)\n", "Requirement already satisfied: python-dotenv in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (1.2.2)\n", "Requirement already satisfied: accelerate in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (1.13.0)\n", "Requirement already satisfied: transformers>=4.0.0 in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (5.0.0)\n", "Requirement already satisfied: filelock>=3.10.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (3.29.0)\n", "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (2025.3.0)\n", "Requirement already satisfied: hf-xet<2.0.0,>=1.4.3 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (1.5.0)\n", "Requirement already satisfied: httpx<1,>=0.23.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (0.28.1)\n", "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (26.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (6.0.3)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (4.67.3)\n", "Requirement already satisfied: typer>=0.20.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (0.25.1)\n", "Requirement already satisfied: typing-extensions>=4.1.0 in /usr/local/lib/python3.12/dist-packages (from huggingface-hub>=0.31.2->smolagents[transformers]) (4.15.0)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.12/dist-packages (from jinja2>=3.1.4->smolagents[transformers]) (3.0.3)\n", "Requirement already satisfied: charset_normalizer<4,>=2 in /usr/local/lib/python3.12/dist-packages (from requests>=2.32.3->smolagents[transformers]) (3.4.7)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.12/dist-packages (from requests>=2.32.3->smolagents[transformers]) (3.15)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.12/dist-packages (from requests>=2.32.3->smolagents[transformers]) (2.5.0)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.12/dist-packages (from requests>=2.32.3->smolagents[transformers]) (2026.5.20)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.12/dist-packages (from rich>=13.9.4->smolagents[transformers]) (4.2.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.12/dist-packages (from rich>=13.9.4->smolagents[transformers]) (2.20.0)\n", "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.12/dist-packages (from transformers>=4.0.0->smolagents[transformers]) (2.0.2)\n", "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.12/dist-packages (from transformers>=4.0.0->smolagents[transformers]) (2025.11.3)\n", "Requirement already satisfied: tokenizers<=0.23.0,>=0.22.0 in /usr/local/lib/python3.12/dist-packages (from transformers>=4.0.0->smolagents[transformers]) (0.22.2)\n", "Requirement already satisfied: typer-slim in /usr/local/lib/python3.12/dist-packages (from transformers>=4.0.0->smolagents[transformers]) (0.24.0)\n", "Requirement already satisfied: safetensors>=0.4.3 in /usr/local/lib/python3.12/dist-packages (from transformers>=4.0.0->smolagents[transformers]) (0.7.0)\n", "Requirement already satisfied: psutil in /usr/local/lib/python3.12/dist-packages (from accelerate->smolagents[transformers]) (5.9.5)\n", "Requirement already satisfied: torch>=2.0.0 in /usr/local/lib/python3.12/dist-packages (from accelerate->smolagents[transformers]) (2.11.0+cu128)\n", "Requirement already satisfied: torchvision in /usr/local/lib/python3.12/dist-packages (from smolagents[transformers]) (0.26.0+cu128)\n", "Requirement already satisfied: anyio in /usr/local/lib/python3.12/dist-packages (from httpx<1,>=0.23.0->huggingface-hub>=0.31.2->smolagents[transformers]) (4.13.0)\n", "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.12/dist-packages (from httpx<1,>=0.23.0->huggingface-hub>=0.31.2->smolagents[transformers]) (1.0.9)\n", "Requirement already satisfied: h11>=0.16 in /usr/local/lib/python3.12/dist-packages (from httpcore==1.*->httpx<1,>=0.23.0->huggingface-hub>=0.31.2->smolagents[transformers]) (0.16.0)\n", "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.12/dist-packages (from markdown-it-py>=2.2.0->rich>=13.9.4->smolagents[transformers]) (0.1.2)\n", "Requirement already satisfied: setuptools<82 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (75.2.0)\n", "Requirement already satisfied: sympy>=1.13.3 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (1.14.0)\n", "Requirement already satisfied: networkx>=2.5.1 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (3.6.1)\n", "Requirement already satisfied: cuda-toolkit==12.8.1 in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (12.8.1)\n", "Requirement already satisfied: cuda-bindings<13,>=12.9.4 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (12.9.6)\n", "Requirement already satisfied: nvidia-cudnn-cu12==9.19.0.56 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (9.19.0.56)\n", "Requirement already satisfied: nvidia-cusparselt-cu12==0.7.1 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (0.7.1)\n", "Requirement already satisfied: nvidia-nccl-cu12==2.28.9 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (2.28.9)\n", "Requirement already satisfied: nvidia-nvshmem-cu12==3.4.5 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (3.4.5)\n", "Requirement already satisfied: triton==3.6.0 in /usr/local/lib/python3.12/dist-packages (from torch>=2.0.0->accelerate->smolagents[transformers]) (3.6.0)\n", "Requirement already satisfied: nvidia-cublas-cu12==12.8.4.1.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (12.8.4.1)\n", "Requirement already satisfied: nvidia-cuda-runtime-cu12==12.8.90.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (12.8.90)\n", "Requirement already satisfied: nvidia-cufft-cu12==11.3.3.83.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (11.3.3.83)\n", "Requirement already satisfied: nvidia-cufile-cu12==1.13.1.3.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (1.13.1.3)\n", "Requirement already satisfied: nvidia-cuda-cupti-cu12==12.8.90.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (12.8.90)\n", "Requirement already satisfied: nvidia-curand-cu12==10.3.9.90.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (10.3.9.90)\n", "Requirement already satisfied: nvidia-cusolver-cu12==11.7.3.90.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (11.7.3.90)\n", "Requirement already satisfied: nvidia-cusparse-cu12==12.5.8.93.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (12.5.8.93)\n", "Requirement already satisfied: nvidia-nvjitlink-cu12==12.8.93.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (12.8.93)\n", "Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.8.93.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (12.8.93)\n", "Requirement already satisfied: nvidia-nvtx-cu12==12.8.90.* in /usr/local/lib/python3.12/dist-packages (from cuda-toolkit[cublas,cudart,cufft,cufile,cupti,curand,cusolver,cusparse,nvjitlink,nvrtc,nvtx]==12.8.1; platform_system == \"Linux\"->torch>=2.0.0->accelerate->smolagents[transformers]) (12.8.90)\n", "Requirement already satisfied: click>=8.2.1 in /usr/local/lib/python3.12/dist-packages (from typer>=0.20.0->huggingface-hub>=0.31.2->smolagents[transformers]) (8.4.0)\n", "Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.12/dist-packages (from typer>=0.20.0->huggingface-hub>=0.31.2->smolagents[transformers]) (1.5.4)\n", "Requirement already satisfied: annotated-doc>=0.0.2 in /usr/local/lib/python3.12/dist-packages (from typer>=0.20.0->huggingface-hub>=0.31.2->smolagents[transformers]) (0.0.4)\n", "Requirement already satisfied: cuda-pathfinder~=1.1 in /usr/local/lib/python3.12/dist-packages (from cuda-bindings<13,>=12.9.4->torch>=2.0.0->accelerate->smolagents[transformers]) (1.5.4)\n", "Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from sympy>=1.13.3->torch>=2.0.0->accelerate->smolagents[transformers]) (1.3.0)\n" ] } ], "source": [ "!pip install smolagents\n", "!pip install smolagents[transformers]\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "l80tGkCMuhCv" }, "outputs": [], "source": [ "%%capture\n", "import os, re\n", "if \"COLAB_\" not in \"\".join(os.environ.keys()):\n", " !pip install unsloth\n", "else:\n", " # Do this only in Colab notebooks! Otherwise use pip install unsloth\n", " import torch; v = re.match(r\"[0-9\\.]{3,}\", str(torch.__version__)).group(0)\n", " xformers = \"xformers==\" + (\"0.0.32.post2\" if v == \"2.8.0\" else \"0.0.29.post3\")\n", " !pip install --no-deps bitsandbytes accelerate {xformers} peft trl triton cut_cross_entropy unsloth_zoo\n", " !pip install sentencepiece protobuf \"datasets>=3.4.1,<4.0.0\" \"huggingface_hub>=0.34.0\" hf_transfer\n", " !pip install --no-deps unsloth\n", "!pip install transformers==4.55.4\n", "import torch; torch._dynamo.config.recompile_limit = 64;\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true, "id": "EJpm2SBa5YyS" }, "outputs": [], "source": [ "#import unsloth\n", "import torch\n", "from smolagents import CodeAgent, TransformersModel, ToolCallingAgent" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "CoSof7XRcK5r" }, "outputs": [], "source": [ "import torch\n", "from datasets import load_dataset, DatasetDict, Dataset\n", "from peft import get_peft_model, LoraConfig, TaskType, PeftModel\n", "from peft import prepare_model_for_kbit_training\n", "from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "KmzC9JPb4Zlv" }, "outputs": [], "source": [ "import networkx as nx\n", "import matplotlib.pyplot as plt\n", "from rdflib import Graph, URIRef, Literal\n", "from rdflib.namespace import RDFS, XSD\n", "from rdflib.plugins.sparql import prepareQuery\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "MRXU3Duh0s_X" }, "outputs": [], "source": [ "class Matter:\n", " def __init__(self, name, category):\n", " self.name = name\n", " self.category = category" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 87 }, "id": "BaaBZvEnwko-", "outputId": "f496da94-b94b-4d42-8dd4-870f1d11d5a2" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nfrom transformers import AutoModelForCausalLM, TextStreamer, GenerationConfig\\n\\nclass MyTextStreamer(TextStreamer):\\n def __init__(self, tokenizer, skip_prompt=True, skip_special_tokens=True, stopToken = \"STOP\"):\\n super().__init__(tokenizer)\\n self.stopToken = stopToken\\n\\n def put(self, value):\\n super().put(value)\\n tokensSoFar = self.token_cache\\n current = self.tokenizer.decode(tokensSoFar, **self.decode_kwargs)\\n #print(current)\\n if self.stopToken in current:\\n print(\"commencing stop\")\\n self.end()\\n '" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 10 } ], "source": [ "'''\n", "from transformers import AutoModelForCausalLM, TextStreamer, GenerationConfig\n", "\n", "class MyTextStreamer(TextStreamer):\n", " def __init__(self, tokenizer, skip_prompt=True, skip_special_tokens=True, stopToken = \"STOP\"):\n", " super().__init__(tokenizer)\n", " self.stopToken = stopToken\n", "\n", " def put(self, value):\n", " super().put(value)\n", " tokensSoFar = self.token_cache\n", " current = self.tokenizer.decode(tokensSoFar, **self.decode_kwargs)\n", " #print(current)\n", " if self.stopToken in current:\n", " print(\"commencing stop\")\n", " self.end()\n", " '''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "IYYLn1kvjZvx" }, "outputs": [], "source": [ "#print(model.config.eos_token_id)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 122 }, "id": "qSuvnJxCApmX", "outputId": "cd266b37-4efd-4aec-cb67-8dd2338fb359" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\n#@title Custom Loop\\nwhile(True):\\n prompt = input(\"Please enter a prompt.\")\\n execute = False\\n while(functionGo):\\n conversation = []\\n\\n prompt = \"Reason out your plan of action and response for the prompt: \"+prompt+\". Use this space as your visiospatial sketchpad to reason out a plan, not to answer. Say STOP when you feel your plan is finished, input {EXECUTION} if tool use is advised.\"\\n conversation.append(\"Prompt:\" +prompt) #conversation = [prompt xyz]\\n\\n inputs = tokenizer(conversation , return_tensors=\"pt\").to(\"cuda\")\\n\\n\\n re = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\\n print(\"Finished initial prompt\")\\n re_outputs = tokenizer.batch_decode(re, skip_special_tokens=True)\\n\\n if \"{EXECUTION}\" in re_outputs:\\n execute = True\\n #print(re_outputs)\\n re_outputs = re_outputs[0]\\n split = re_outputs.split(prompt)\\n re_outputs = split[1]\\n\\n #print(type(re_outputs))\\n conversation[0] += \"Think:\" +re_outputs\\n print(\"\\n\\n\\n\\n\"+conversation[0]+\"\\n\\n\\n\\n\\n\\n\\n\")\\n\\n #conversation = [prompt xyz, think outputs]\\n\\n extend = \"Execute the plans laid out in your thinking by outputing function calls in your answer if tool use is advised.\"\\n print(\"Beginning execution\")\\n conversation[0] += \"Action Prompt:\" +extend\\n #conversation = [prompt xyz, think outputs, action prompt extend]\\n\\n inputs = tokenizer(conversation, return_tensors=\"pt\", padding = True).to(\"cuda\")\\n act = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, tokenizer = tokenizer, streamer=streamer, stop_strings = \"STOP\")\\n act_outputs = tokenizer.batch_decode(act, skip_special_tokens=True)\\n #print(act_outputs)\\n act_outputs = act_outputs[0]\\n act_outputs = act_outputs.split(prompt)\\n act_outputs = act_outputs[1]\\n\\n conversation[0]+=(\"Action: \"+act_outputs)\\n\\n deliverer = \"Synthesize the information thus far into a comprehensive answer for the user\"\\n conversation[0]+=(\"Final Answer Prompt:\" +deliverer)\\n\\n inputs = tokenizer(conversation, return_tensors=\"pt\", padding = True).to(\"cuda\")\\n fin = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\\n fin_outputs = tokenizer.batch_decode(fin, skip_special_tokens=True)\\n fin_outputs = fin_outputs[0]\\n fin_outputs = fin_outputs.split(prompt)\\n fin_outputs = fin_outputs[1]\\n\\n conversation[0]+=(\"Final Answer: \"+fin_outputs)\\n '" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 12 } ], "source": [ "'''\n", "#@title Custom Loop\n", "while(True):\n", " prompt = input(\"Please enter a prompt.\")\n", " execute = False\n", " while(functionGo):\n", " conversation = []\n", "\n", " prompt = \"Reason out your plan of action and response for the prompt: \"+prompt+\". Use this space as your visiospatial sketchpad to reason out a plan, not to answer. Say STOP when you feel your plan is finished, input {EXECUTION} if tool use is advised.\"\n", " conversation.append(\"Prompt:\" +prompt) #conversation = [prompt xyz]\n", "\n", " inputs = tokenizer(conversation , return_tensors=\"pt\").to(\"cuda\")\n", "\n", "\n", " re = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " print(\"Finished initial prompt\")\n", " re_outputs = tokenizer.batch_decode(re, skip_special_tokens=True)\n", "\n", " if \"{EXECUTION}\" in re_outputs:\n", " execute = True\n", " #print(re_outputs)\n", " re_outputs = re_outputs[0]\n", " split = re_outputs.split(prompt)\n", " re_outputs = split[1]\n", "\n", " #print(type(re_outputs))\n", " conversation[0] += \"Think:\" +re_outputs\n", " print(\"\\n\\n\\n\\n\"+conversation[0]+\"\\n\\n\\n\\n\\n\\n\\n\")\n", "\n", " #conversation = [prompt xyz, think outputs]\n", "\n", " extend = \"Execute the plans laid out in your thinking by outputing function calls in your answer if tool use is advised.\"\n", " print(\"Beginning execution\")\n", " conversation[0] += \"Action Prompt:\" +extend\n", " #conversation = [prompt xyz, think outputs, action prompt extend]\n", "\n", " inputs = tokenizer(conversation, return_tensors=\"pt\", padding = True).to(\"cuda\")\n", " act = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, tokenizer = tokenizer, streamer=streamer, stop_strings = \"STOP\")\n", " act_outputs = tokenizer.batch_decode(act, skip_special_tokens=True)\n", " #print(act_outputs)\n", " act_outputs = act_outputs[0]\n", " act_outputs = act_outputs.split(prompt)\n", " act_outputs = act_outputs[1]\n", "\n", " conversation[0]+=(\"Action: \"+act_outputs)\n", "\n", " deliverer = \"Synthesize the information thus far into a comprehensive answer for the user\"\n", " conversation[0]+=(\"Final Answer Prompt:\" +deliverer)\n", "\n", " inputs = tokenizer(conversation, return_tensors=\"pt\", padding = True).to(\"cuda\")\n", " fin = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " fin_outputs = tokenizer.batch_decode(fin, skip_special_tokens=True)\n", " fin_outputs = fin_outputs[0]\n", " fin_outputs = fin_outputs.split(prompt)\n", " fin_outputs = fin_outputs[1]\n", "\n", " conversation[0]+=(\"Final Answer: \"+fin_outputs)\n", " '''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "nx9_xaQoT1fx" }, "outputs": [], "source": [ "def call_evaluator(s):\n", " answer = \"\"\n", " if \"def\" in s:\n", " start_index = s.find(\"<\")\n", " end_index = s.find(\">\")\n", " try:\n", " function_call = s[start_index+1, end_index]\n", " x = eval(string)\n", " answer += str(x)\n", " s = s[end_index+1:]\n", " except:\n", " return answer\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cellView": "form", "id": "2MD_8UUvUbia" }, "outputs": [], "source": [ "# @title Datamaker\n", "def dataMaker2():\n", " heads = [\n", " # ========== META-LEVEL PROBLEM SOLVING & HEURISTICS ==========\n", " \"Problem Solving Start\", \"Problem Solving Start\", \"Problem Solving Start\", \"Problem Solving Start\",\n", " \"Understand the Problem Deeply\", \"Understand the Problem Deeply\", \"Understand the Problem Deeply\", \"Understand the Problem Deeply\",\n", " \"Devise a Plan\", \"Devise a Plan\", \"Devise a Plan\", \"Devise a Plan\", \"Devise a Plan\", \"Devise a Plan\",\n", " \"Carry Out the Plan\", \"Carry Out the Plan\",\n", " \"Look Back and Verify\", \"Look Back and Verify\", \"Look Back and Verify\", \"Look Back and Verify\",\n", " \"Problem Solving Blockage\", \"Problem Solving Blockage\", \"Problem Solving Blockage\", \"Problem Solving Blockage\", \"Problem Solving Blockage\",\n", "\n", " # ========== INITIAL PROBLEM RECOGNITION & CLASSIFICATION ==========\n", " \"Problem Statement Analysis\", \"Problem Statement Analysis\", \"Problem Statement Analysis\", \"Problem Statement Analysis\",\n", " \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\",\n", " \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\",\n", " \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\", \"Classify Problem Type\",\n", " \"Classify Problem Type\", # For \"Prove that...\" statements\n", "\n", " # ========== ALGEBRAIC PROBLEM STRATEGIES (General) ===========\n", " \"Algebraic Problem\", \"Algebraic Problem\",\n", " \"Algebraic Equation Solving\", \"Algebraic Equation Solving\", \"Algebraic Equation Solving\",\n", " \"Algebraic Expression Simplification\", \"Algebraic Expression Simplification\",\n", "\n", " # ========== QUADRATIC EQUATION STRATEGIES ==========\n", " \"Consider Quadratic Equation Strategies\", \"Consider Quadratic Equation Strategies\", \"Consider Quadratic Equation Strategies\", \"Consider Quadratic Equation Strategies\", \"Consider Quadratic Equation Strategies\",\n", " \"Discriminant (b²-4ac)\",\n", " \"Nature and Number of Roots (Quadratic)\", \"Nature and Number of Roots (Quadratic)\", \"Nature and Number of Roots (Quadratic)\",\n", " \"Factoring Quadratic Expression\", \"Factoring Quadratic Expression\", \"Factoring Quadratic Expression\",\n", " \"Completing the Square (Quadratic)\", \"Completing the Square (Quadratic)\",\n", " \"Parabola Properties\", \"Parabola Properties\", \"Parabola Properties\", \"Parabola Properties\",\n", "\n", " # ========== LINEAR EQUATION & SYSTEMS STRATEGIES ==========\n", " \"Consider Linear Equation Strategies (Single)\",\n", " \"Consider System of Linear Equations Strategies\", \"Consider System of Linear Equations Strategies\", \"Consider System of Linear Equations Strategies\",\n", " \"Augmented Matrix [A|b]\", \"Augmented Matrix [A|b]\",\n", " \"Gaussian Elimination (REF)\",\n", " \"Gauss-Jordan Elimination (RREF)\", \"Gauss-Jordan Elimination (RREF)\",\n", " \"Determinant of Coefficient Matrix A (Systems)\", \"Determinant of Coefficient Matrix A (Systems)\",\n", " \"Matrix A is Invertible (Systems)\",\n", "\n", " # ========== POLYNOMIAL EQUATION STRATEGIES (Degree > 2) ==========\n", " \"Consider Polynomial Equation Strategies (Degree > 2)\", \"Consider Polynomial Equation Strategies (Degree > 2)\", \"Consider Polynomial Equation Strategies (Degree > 2)\", \"Consider Polynomial Equation Strategies (Degree > 2)\",\n", " \"Rational Root Theorem\", \"Rational Root Theorem\",\n", " \"Factor Theorem (Polynomials)\",\n", " \"Synthetic Division / Polynomial Long Division\", \"Synthetic Division / Polynomial Long Division\",\n", " \"Descartes' Rule of Signs (Polynomials)\",\n", " \"Graphing Polynomials (for roots)\", \"Graphing Polynomials (for roots)\",\n", " \"Factoring Polynomials (General)\", \"Factoring Polynomials (General)\",\n", "\n", " # ========== RADICAL & RATIONAL EQUATION STRATEGIES ==========\n", " \"Consider Radical Equation Strategies\", \"Consider Radical Equation Strategies\",\n", " \"Consider Rational Equation Strategies\", \"Consider Rational Equation Strategies\", \"Consider Rational Equation Strategies\",\n", "\n", " # ========== INEQUALITY STRATEGIES ==========\n", " \"Consider Inequality Solving Strategies\", \"Consider Inequality Solving Strategies\", \"Consider Inequality Solving Strategies\",\n", " \"Linear Inequality\",\n", " \"Quadratic Inequality\", \"Quadratic Inequality\",\n", " \"Polynomial Inequality (Degree > 2)\", \"Polynomial Inequality (Degree > 2)\",\n", " \"Rational Inequality\", \"Rational Inequality\",\n", " \"Absolute Value Inequality\", \"Absolute Value Inequality\",\n", " \"Critical Points Method (Inequalities)\", \"Critical Points Method (Inequalities)\",\n", " \"Sign Analysis Chart (Inequalities)\",\n", "\n", " # ========== CALCULUS: LIMITS ==========\n", " \"Consider Limit Strategies\", \"Consider Limit Strategies\", \"Consider Limit Strategies\",\n", " \"Direct Substitution (Limits)\", \"Direct Substitution (Limits)\",\n", " \"Indeterminate Forms (Limits)\", \"Indeterminate Forms (Limits)\", \"Indeterminate Forms (Limits)\",\n", " \"0/0 or ∞/∞ (Indeterminate Form)\", \"0/0 or ∞/∞ (Indeterminate Form)\",\n", " \"0 * ∞ or ∞ - ∞ (Indeterminate Form)\",\n", " \"1^∞, 0^0, ∞^0 (Indeterminate Form)\",\n", " \"Squeeze Theorem (Limits)\",\n", " \"One-Sided Limits\", \"One-Sided Limits\",\n", "\n", " # ========== CALCULUS: DERIVATIVES ==========\n", " \"Consider Derivative Strategies\", \"Consider Derivative Strategies\", \"Consider Derivative Strategies\",\n", " \"Differentiation Rules\", \"Differentiation Rules\", \"Differentiation Rules\", \"Differentiation Rules\", \"Differentiation Rules\",\n", " \"Applications of Derivatives\", \"Applications of Derivatives\", \"Applications of Derivatives\", \"Applications of Derivatives\", \"Applications of Derivatives\",\n", " \"Optimization using Derivatives\", \"Optimization using Derivatives\",\n", " \"Analyzing Function Behavior (Derivatives)\", \"Analyzing Function Behavior (Derivatives)\",\n", "\n", " # ========== CALCULUS: INTEGRALS ==========\n", " \"Consider Integral Strategies\", \"Consider Integral Strategies\", \"Consider Integral Strategies\",\n", " \"Fundamental Theorem of Calculus\",\n", " \"Integration Techniques\", \"Integration Techniques\", \"Integration Techniques\", \"Integration Techniques\", \"Integration Techniques\",\n", " \"Improper Integrals\", \"Improper Integrals\",\n", " \"Applications of Integrals\", \"Applications of Integrals\", \"Applications of Integrals\", \"Applications of Integrals\",\n", "\n", " # ========== DIFFERENTIAL EQUATION STRATEGIES ==========\n", " \"Consider Differential Equation Strategies\", \"Consider Differential Equation Strategies\", \"Consider Differential Equation Strategies\",\n", " \"Classify Differential Equation\", \"Classify Differential Equation\",\n", " \"First-Order Differential Equations\", \"First-Order Differential Equations\", \"First-Order Differential Equations\", \"First-Order Differential Equations\",\n", " \"Separable Differential Equation\",\n", " \"Linear First-Order Differential Equation\", \"Linear First-Order Differential Equation\",\n", " \"Exact Differential Equation\",\n", " \"Homogeneous Differential Equation (DE)\",\n", " \"Second-Order Linear DE with Constant Coefficients\", \"Second-Order Linear DE with Constant Coefficients\",\n", " \"Characteristic Equation (DE)\", \"Characteristic Equation (DE)\", \"Characteristic Equation (DE)\",\n", " \"Non-Homogeneous Linear DEs\", \"Non-Homogeneous Linear DEs\",\n", "\n", " # ========== LINEAR ALGEBRA: VECTORS ==========\n", " \"Consider Vector Algebra Strategies\", \"Consider Vector Algebra Strategies\", \"Consider Vector Algebra Strategies\", \"Consider Vector Algebra Strategies\",\n", " \"Dot Product Applications\", \"Dot Product Applications\",\n", " \"Cross Product Applications (3D)\", \"Cross Product Applications (3D)\",\n", " \"Vector Projections\",\n", " \"Lines and Planes in Space (Vectors)\", \"Lines and Planes in Space (Vectors)\",\n", "\n", " # ========== LINEAR ALGEBRA: MATRICES ==========\n", " \"Consider Matrix Algebra Strategies\", \"Consider Matrix Algebra Strategies\", \"Consider Matrix Algebra Strategies\", \"Consider Matrix Algebra Strategies\",\n", " \"Determinants (Matrices)\", \"Determinants (Matrices)\",\n", " \"Matrix Inverses\", \"Matrix Inverses\",\n", " \"Solving Systems Ax=b using Matrices\",\n", " \"Eigenvalues and Eigenvectors\", \"Eigenvalues and Eigenvectors\", \"Eigenvalues and Eigenvectors\",\n", " \"Diagonalization of Matrices\",\n", "\n", " # ========== PROOF STRATEGIES ==========\n", " \"Consider Proof Writing Strategies\", \"Consider Proof Writing Strategies\", \"Consider Proof Writing Strategies\", \"Consider Proof Writing Strategies\", \"Consider Proof Writing Strategies\",\n", " \"Direct Proof Structure\",\n", " \"Proof by Contradiction Structure\",\n", " \"Proof by Contrapositive Structure\",\n", " \"Proof by Cases Structure\",\n", " \"Proof by Induction Structure\", \"Proof by Induction Structure\", \"Proof by Induction Structure\",\n", " \"Proving Biconditionals (P⇔Q)\",\n", " \"Proving Existence (∃x P(x))\",\n", " \"Proving Uniqueness (∃!x P(x))\",\n", " \"Common Pitfalls in Proofs\",\n", "\n", " # ========== COMBINATORICS STRATEGIES ==========\n", " \"Consider Combinatorics Techniques\", \"Consider Combinatorics Techniques\", \"Consider Combinatorics Techniques\", \"Consider Combinatorics Techniques\",\n", " \"Permutations vs. Combinations\", \"Permutations vs. Combinations\",\n", " \"Advanced Combinatorial Techniques\", \"Advanced Combinatorial Techniques\", \"Advanced Combinatorial Techniques\", \"Advanced Combinatorial Techniques\",\n", " \"Common Combinatorial Strategies\", \"Common Combinatorial Strategies\", \"Common Combinatorial Strategies\",\n", "\n", " # ========== PROBABILITY STRATEGIES ==========\n", " \"Consider Probability Theory Strategies\", \"Consider Probability Theory Strategies\", \"Consider Probability Theory Strategies\", \"Consider Probability Theory Strategies\",\n", " \"Conditional Probability & Independence\", \"Conditional Probability & Independence\",\n", " \"Bayes' Theorem Applications\",\n", " \"Random Variables & Distributions\", \"Random Variables & Distributions\", \"Random Variables & Distributions\",\n", " \"Expected Value and Variance Calculations\",\n", "\n", " # ========== NUMBER THEORY STRATEGIES ==========\n", " \"Consider Number Theory Strategies\", \"Consider Number Theory Strategies\", \"Consider Number Theory Strategies\", \"Consider Number Theory Strategies\",\n", " \"Divisibility and Prime Factorization\", \"Divisibility and Prime Factorization\",\n", " \"Modular Arithmetic Applications\", \"Modular Arithmetic Applications\", \"Modular Arithmetic Applications\",\n", " \"GCD, LCM, and Euclidean Algorithm\", \"GCD, LCM, and Euclidean Algorithm\",\n", " \"Diophantine Equation Solving\",\n", "\n", " # ========== GEOMETRY STRATEGIES ==========\n", " \"Consider Geometry Problem Strategies\", \"Consider Geometry Problem Strategies\", \"Consider Geometry Problem Strategies\", \"Consider Geometry Problem Strategies\", \"Consider Geometry Problem Strategies\",\n", " \"Triangle Properties and Theorems\", \"Triangle Properties and Theorems\", \"Triangle Properties and Theorems\",\n", " \"Circle Properties and Theorems\", \"Circle Properties and Theorems\",\n", " \"Polygon Properties\",\n", " \"Coordinate Geometry Approach\",\n", " \"Solid Geometry Concepts\",\n", "\n", " # ========== OPTIMIZATION STRATEGIES ==========\n", " \"Consider Optimization Strategies\", \"Consider Optimization Strategies\", \"Consider Optimization Strategies\",\n", " \"Single-Variable Optimization (Calculus)\", \"Single-Variable Optimization (Calculus)\",\n", " \"Multi-Variable Optimization (Calculus)\", \"Multi-Variable Optimization (Calculus)\",\n", " \"Constrained Optimization\", \"Constrained Optimization\",\n", " \"Linear Programming Basics\",\n", "\n", " # ========== COMPLEX NUMBERS STRATEGIES ==========\n", " \"Consider Complex Number Strategies\", \"Consider Complex Number Strategies\", \"Consider Complex Number Strategies\", \"Consider Complex Number Strategies\",\n", " \"Rectangular vs. Polar Form (Complex)\", \"Rectangular vs. Polar Form (Complex)\",\n", " \"Operations with Complex Numbers\", \"Operations with Complex Numbers\",\n", " \"De Moivre's Theorem Applications\",\n", " \"Euler's Formula Applications\",\n", " \"Roots of Complex Numbers\",\n", " \"Geometric Interpretation of Complex Operations\",\n", "\n", " # ========== SEQUENCES AND SERIES STRATEGIES ==========\n", " \"Consider Sequence Strategies\", \"Consider Sequence Strategies\", \"Consider Sequence Strategies\",\n", " \"Identifying Sequence Type (Arithmetic, Geometric, etc.)\", \"Identifying Sequence Type (Arithmetic, Geometric, etc.)\",\n", " \"Finding Explicit or Recursive Formulas (Sequences)\",\n", " \"Consider Series Strategies\", \"Consider Series Strategies\", \"Consider Series Strategies\",\n", " \"Identifying Series Type (Arithmetic, Geometric, etc.)\",\n", " \"Summation Formulas for Finite Series\",\n", " \"Convergence/Divergence of Infinite Series\", \"Convergence/Divergence of Infinite Series\",\n", " \"Common Series Convergence Tests\", \"Common Series Convergence Tests\", \"Common Series Convergence Tests\", \"Common Series Convergence Tests\",\n", " \"Power Series\", \"Power Series\", \"Consider Distribution\",\n", "\n", " # ========== FUNCTIONAL EQUATIONS STRATEGIES ==========\n", " \"Consider Functional Equation Strategies\", \"Consider Functional Equation Strategies\", \"Consider Functional Equation Strategies\", \"Consider Functional Equation Strategies\",\n", " \"Testing Special Values (Functional Eq.)\",\n", " \"Checking for Standard Forms (Cauchy, etc.)\",\n", " \"Using Properties (Injectivity, Surjectivity, Parity, Periodicity)\",\n", " \"Strategic Substitutions (Functional Eq.)\",\n", "\n", " # ========== GRAPH THEORY STRATEGIES ==========\n", " \"Consider Graph Theory Strategies\", \"Consider Graph Theory Strategies\", \"Consider Graph Theory Strategies\", \"Consider Graph Theory Strategies\",\n", " \"Basic Graph Properties (Vertices, Edges, Degree, Connectivity)\",\n", " \"Paths, Cycles, and Traversals (Eulerian, Hamiltonian)\",\n", " \"Shortest Path Algorithms (BFS, Dijkstra)\",\n", " \"Spanning Tree Algorithms (Kruskal, Prim)\",\n", " \"Graph Representations (Adjacency Matrix/List)\",\n", " \"Special Graph Types (Bipartite, Planar, Trees)\",\n", "\n", " # ========== SET THEORY STRATEGIES ==========\n", " \"Consider Set Theory Strategies\", \"Consider Set Theory Strategies\", \"Consider Set Theory Strategies\", \"Consider Set Theory Strategies\",\n", " \"Set Operations and Identities\",\n", " \"Venn Diagrams for Visualization\",\n", " \"Cardinality and Counting Arguments (Sets)\",\n", " \"Proving Set Equality or Subset Relations\",\n", " \"Power Sets and Cartesian Products\",\n", "\n", " # ========== ADVANCED PROBLEM PATTERNS / HEURISTICS (Reiteration/Emphasis) ==========\n", " \"Recognize Advanced Problem Patterns\", \"Recognize Advanced Problem Patterns\", \"Recognize Advanced Problem Patterns\", \"Recognize Advanced Problem Patterns\",\n", " \"Recognize Advanced Problem Patterns\", \"Recognize Advanced Problem Patterns\", \"Recognize Advanced Problem Patterns\", \"Recognize Advanced Problem Patterns\",\n", " \"Recognize Advanced Problem Patterns\"\n", " ]\n", "\n", " relations = [\n", " # ========== META-LEVEL PROBLEM SOLVING & HEURISTICS ==========\n", " \"initial_phase\", \"strategic_phase\", \"execution_phase\", \"review_phase\",\n", " \"action\", \"action\", \"action\", \"consider\",\n", " \"action\", \"action\", \"action\", \"heuristic\", \"heuristic\", \"heuristic\",\n", " \"action\", \"monitor\",\n", " \"action\", \"action\", \"action\", \"consider\",\n", " \"heuristic\", \"heuristic\", \"heuristic\", \"heuristic\", \"heuristic\",\n", "\n", " # ========== INITIAL PROBLEM RECOGNITION & CLASSIFICATION ==========\n", " \"primary_goal\", \"look_for_keywords\", \"analyze_structure\", \"identify_objects\",\n", " \"if_algebraic_equation_with_x^2\", \"if_rate_of_change_or_slope\", \"if_accumulation_or_area_under_curve\", \"if_system_of_equations\", \"if_proving_a_statement_about_integers\",\n", " \"if_counting_arrangements_or_selections\", \"if_likelihood_of_events\", \"if_maximization_or_minimization_task\", \"if_ordered_list_of_numbers\", \"if_sum_of_terms_in_a_sequence\",\n", " \"if_numbers_of_form_a+bi\", \"if_equation_defining_a_function\", \"if_nodes_and_edges_problem\", \"if_collections_and_elements_problem\", \"if_statistical_data_analysis\",\n", " \"if_abstract_structures_like_groups_rings_fields\",\n", "\n", " # ========== ALGEBRAIC PROBLEM STRATEGIES (General) ===========\n", " \"general_approach\", \"initial_step\",\n", " \"goal\", \"common_pitfall\", \"key_principle\",\n", " \"goal\", \"common_technique\",\n", "\n", " # ========== QUADRATIC EQUATION STRATEGIES ==========\n", " \"key_property_to_analyze\", \"standard_solution_method\", \"alternative_solution_method\", \"alternative_solution_method\", \"graphical_interpretation\",\n", " \"determines\",\n", " \"if_D_gt_0\", \"if_D_eq_0\", \"if_D_lt_0\",\n", " \"look_for_pattern\", \"look_for_pattern\", \"general_technique\",\n", " \"reveals\", \"useful_for_deriving\",\n", " \"determined_by_coefficient_a\", \"related_to_roots\", \"key_feature\", \"check_for\",\n", "\n", " # ========== LINEAR EQUATION & SYSTEMS STRATEGIES ==========\n", " \"strategy_is\",\n", " \"core_concept\", \"matrix_representation\", \"alternative_methods\",\n", " \"solution_via_reduction\", \"solution_via_reduction\",\n", " \"allows_solution_by\",\n", " \"interpretation_of_RREF\", \"interpretation_of_RREF_indicates\",\n", " \"if_det(A)_neq_0\", \"if_det(A)_eq_0\",\n", " \"allows_solution_method\",\n", "\n", " # ========== POLYNOMIAL EQUATION STRATEGIES (Degree > 2) ==========\n", " \"determine\", \"strategy\", \"strategy\", \"strategy\",\n", " \"provides_list_of\", \"test_by_substituting_into\",\n", " \"states_if_P(r)=0\",\n", " \"efficiently_divides_P(x)_by\", \"yields\",\n", " \"estimates_number_of\",\n", " \"shows_real_roots_as\", \"indicates\",\n", " \"if_special_form\", \"look_for_specific_pattern\",\n", "\n", " # ========== RADICAL & RATIONAL EQUATION STRATEGIES ==========\n", " \"primary_step\", \"caution\",\n", " \"primary_step\", \"identify_and_exclude\", \"common_technique\",\n", "\n", " # ========== INEQUALITY STRATEGIES ==========\n", " \"determine_type\", \"general_method\", \"important_consideration\",\n", " \"solve_as_equation_first\",\n", " \"find_roots_then_test_intervals_or_graph\", \"related_to_parabola_shape\",\n", " \"find_all_real_roots_then_sign_chart\", \"use_polynomial_graph_intuition\",\n", " \"combine_to_single_fraction_find_zeros_and_asymptotes\", \"use_sign_chart_with_all_critical_points\",\n", " \"split_into_cases_based_on_absolute_value_definition\", \"solve_compound_inequalities\",\n", " \"identify_zeros_and_undefined_points\", \"these_define_test_intervals\",\n", " \"systematically_determines_solution_intervals\",\n", "\n", " # ========== CALCULUS: LIMITS ==========\n", " \"initial_approach\", \"alternative_if_indeterminate\", \"related_concept\",\n", " \"if_results_in_defined_number\", \"if_results_in_indeterminate_form\",\n", " \"common_type\", \"common_type\", \"common_type\",\n", " \"consider_method\", \"consider_method\",\n", " \"strategy\",\n", " \"strategy\",\n", " \"comparison_tool\",\n", " \"evaluate_for_existence\", \"if_LHL_eq_RHL_limit_exists\",\n", "\n", " # ========== CALCULUS: DERIVATIVES ==========\n", " \"core_concept\", \"fundamental_definition\", \"primary_tool\",\n", " \"for_products\", \"for_quotients\", \"for_compositions\", \"for_implicit_functions\", \"for_complex_products_powers\",\n", " \"category\", \"category\", \"category\", \"category\", \"category\",\n", " \"find\", \"classify_using\",\n", " \"use_sign_of_f'\", \"use_sign_of_f''\",\n", "\n", " # ========== CALCULUS: INTEGRALS ==========\n", " \"core_concept_indefinite\", \"core_concept_definite\", \"fundamental_theorem\",\n", " \"links_derivatives_and_integrals\",\n", " \"basic_method\", \"for_products_of_functions\", \"for_rational_functions\", \"for_sqrt_of_quadratics\", \"for_powers_of_trig_functions\",\n", " \"evaluate_using_limits\", \"check_convergence_divergence\",\n", " \"category\", \"category\", \"category\", \"category\",\n", "\n", " # ========== DIFFERENTIAL EQUATION STRATEGIES ==========\n", " \"initial_step\", \"key_information_needed\", \"general_approach\",\n", " \"by_order_linearity_homogeneity_coeffs\", \"guides_method_selection\",\n", " \"common_type\", \"common_type\", \"common_type\", \"common_type\",\n", " \"method_is\",\n", " \"standard_form_is\", \"use_integrating_factor\",\n", " \"check_condition_for\",\n", " \"substitution_type\",\n", " \"form_auxiliary_equation\", \"solve_for_roots_of\",\n", " \"roots_determine_form_of_y_c\", \"if_real_distinct_roots\", \"if_real_repeated_roots\", \"if_complex_conjugate_roots\",\n", " \"solve_for_y_h_then_y_p\", \"method_for_y_p\",\n", "\n", " # ========== LINEAR ALGEBRA: VECTORS ==========\n", " \"common_operation\", \"common_operation\", \"calculate_for\", \"geometric_application\",\n", " \"geometric_interpretation\", \"application\",\n", " \"geometric_interpretation\", \"application\",\n", " \"calculate_using_dot_product\",\n", " \"represent_using_vector_equations\", \"represent_using_normal_vector_and_point\",\n", "\n", " # ========== LINEAR ALGEBRA: MATRICES ==========\n", " \"common_operation\", \"key_property\", \"application\", \"advanced_analysis\",\n", " \"scalar_value_for_square_matrix\", \"implications_for_invertibility_and_systems\",\n", " \"exists_if_det_neq_0\", \"used_to_solve_Ax=b\",\n", " \"use_Gaussian_Elimination_or_Inverse\",\n", " \"solve_Av_eq_lambda_v\", \"application\", \"application\",\n", " \"requires_sufficient_eigenvectors\",\n", "\n", " # ========== PROOF STRATEGIES ==========\n", " \"understand_statement\", \"choose_method\", \"choose_method\", \"choose_method\", \"choose_method\",\n", " \"logic_flow\",\n", " \"logic_flow\",\n", " \"logic_flow\",\n", " \"requirement\",\n", " \"component\", \"component\", \"component\",\n", " \"prove_P_implies_Q_and_Q_implies_P\",\n", " \"construct_example_or_use_intermediate_value_theorem_etc\",\n", " \"prove_existence_then_assume_two_and_show_equality\",\n", " \"avoid_circular_reasoning_or_affirming_consequent\",\n", "\n", " # ========== COMBINATORICS STRATEGIES ==========\n", " \"fundamental_principle\", \"fundamental_principle\", \"distinguish_between\", \"distinguish_between\",\n", " \"consider_repetition_allowed\", \"consider_repetition_allowed\",\n", " \"advanced_technique\", \"advanced_technique\", \"advanced_technique\", \"advanced_technique\",\n", " \"strategy\", \"strategy\", \"strategy\",\n", "\n", " # ========== PROBABILITY STRATEGIES ==========\n", " \"first_step\", \"basic_formula_if_equally_likely\", \"use_tool_for_counting_outcomes\", \"key_concept\",\n", " \"related_to\", \"test_for_independence\",\n", " \"application\",\n", " \"characteristic\", \"characteristic\", \"characteristic\",\n", " \"calculate_using_PMF_or_PDF\",\n", "\n", " # ========== NUMBER THEORY STRATEGIES ==========\n", " \"common_topic\", \"common_tool\", \"common_topic\", \"type_of_equation\",\n", " \"fundamental_theorem\", \"related_concepts\",\n", " \"key_operation\", \"important_theorem\", \"important_theorem\",\n", " \"algorithm\", \"extension\",\n", " \"integer_solution_focus\",\n", "\n", " # ========== GEOMETRY STRATEGIES ==========\n", " \"initial_step\", \"look_for_relationships\", \"look_for_relationships\", \"apply_theorem_if_right_angled\", \"use_tool\",\n", " \"key_properties_angles_sides_special_lines\", \"criteria_for_similarity_AA_SAS_SSS\", \"criteria_for_congruence_SSS_SAS_ASA_AAS_HL\",\n", " \"key_properties_tangents_chords_angles_arcs\", \"related_theorems_inscribed_angle_power_of_point\",\n", " \"angle_sum_side_properties_diagonals\",\n", " \"assign_coordinates_use_algebraic_formulas\",\n", " \"surface_area_volume_polyhedra_spheres_etc\",\n", "\n", " # ========== OPTIMIZATION STRATEGIES ==========\n", " \"identify_objective_and_constraints\", \"categorize_by_variables_and_constraints\", \"core_calculus_method\",\n", " \"use_derivatives_to_find_critical_points\", \"test_critical_points_and_endpoints\",\n", " \"use_partial_derivatives_for_critical_points\", \"apply_second_partials_test_or_Hessian\",\n", " \"method_is_Lagrange_Multipliers\", \"form_Lagrangian_function_solve_system\",\n", " \"graphical_method_or_Simplex_algorithm\",\n", "\n", " # ========== COMPLEX NUMBERS STRATEGIES ==========\n", " \"choose_appropriate_representation\", \"perform_arithmetic\", \"tool_for_powers_and_roots\", \"connection_to_trig_exp\",\n", " \"modulus_and_argument_are_key\", \"addition_subtraction_easier_in_rect\", \"multiplication_division_easier_in_polar\",\n", " \"(re^(iθ))^n = r^n e^(inθ)\",\n", " \"e^(iθ) = cosθ + isinθ\",\n", " \"use_De_Moivres_or_polar_form_for_nth_roots\",\n", " \"addition_as_vector_sum_multiplication_as_rotation_scaling\",\n", "\n", " # ========== SEQUENCES AND SERIES STRATEGIES ==========\n", " \"analyze_terms_for_pattern\", \"determine_if_finite_or_infinite_list\", \"common_types\",\n", " \"look_for_common_difference_d\", \"look_for_common_ratio_r\",\n", " \"goal_is_a_n_formula\",\n", " \"distinguish_from_sequence\", \"determine_if_finite_or_infinite_sum\", \"check_for_known_types\",\n", " \"e.g_Arithmetic_Geometric\",\n", " \"use_summation_formulas_if_applicable\",\n", " \"first_test_is_nth_Term_Test_for_Divergence\", \"apply_specific_convergence_test\",\n", " \"Integral_Test_Comparison_Tests_Ratio_Test_Root_Test_Alternating_Series_Test\", \"Positive_terms_only_for_some_tests\", \"Factorials_suggest_Ratio_Test\", \"nth_powers_suggest_Root_Test\",\n", " \"form_is_sum_c_n*(x-a)^n\", \"find_Radius_and_Interval_of_Convergence\", \"The number of ways to distribute n distinguishable objects into k groups of sizes n₁, n₂, ..., nₖ\"\n", "\n", " # ========== FUNCTIONAL EQUATIONS STRATEGIES ==========\n", " \"initial_exploration_method\", \"look_for_known_patterns\", \"deduce_function_properties\", \"iterative_approach\",\n", " \"substitute_x=0_y=0_x=1_y=x_y=-x_etc\",\n", " \"e_g_f(x+y)=f(x)+f(y)_implies_f(x)=cx\",\n", " \"helps_simplify_or_constrain_solutions\",\n", " \"substitute_f(x)_or_variables_with_expressions_involving_f\",\n", "\n", " # ========== GRAPH THEORY STRATEGIES ==========\n", " \"understand_graph_structure\", \"investigate_connectivity_and_paths\", \"specific_algorithmic_problems\", \"representation_method\",\n", " \"V_E_degree_connected_components_acyclic_etc\",\n", " \"Eulerian_Hamiltonian_cycles_paths\",\n", " \"BFS_Dijkstra_Bellman_Ford_Floyd_Warshall\",\n", " \"Kruskal_Prim_algorithms\",\n", " \"matrix_or_list_of_neighbors\",\n", " \"bipartite_planar_trees_complete_graphs_cycles\",\n", "\n", " # ========== SET THEORY STRATEGIES ==========\n", " \"manipulate_set_expressions\", \"visual_aid_for_simple_cases\", \"counting_elements\", \"proving_relationships\",\n", " \"De_Morgan_Distributive_Associative_laws\",\n", " \"for_2_or_3_sets_typically\",\n", " \"Principle_of_Inclusion_Exclusion_for_unions\",\n", " \"show_A_subset_B_and_B_subset_A_for_equality\",\n", " \"definition_and_properties\",\n", "\n", " # ========== ADVANCED PROBLEM PATTERNS / HEURISTICS (Reiteration/Emphasis) ==========\n", " \"consider_if_terms_cancel_out\", \"encode_problem_as_coefficients\", \"establish_one_to_one_mapping\", \"find_quantity_that_is_constant\",\n", " \"find_quantity_that_always_increases_or_decreases\", \"focus_on_max_min_or_boundary_elements\", \"apply_when_items_exceed_categories\", \"use_for_existence_proofs_in_naturals_by_contradiction\",\n", " \"map_to_a_familiar_problem_structure\"\n", " ]\n", "\n", " tails = [\n", " # ========== META-LEVEL PROBLEM SOLVING & HEURISTICS ==========\n", " \"Understand the Problem Deeply\", \"Devise a Plan\", \"Carry Out the Plan\", \"Look Back and Verify\",\n", " \"Identify Knowns, Unknowns, and Constraints\", \"Clarify Terminology and Notation\", \"Rephrase Problem in Own Words\", \"Implicit Assumptions\",\n", " \"Recall Relevant Concepts and Theorems\", \"Look for Similar Solved Problems\", \"Break Down into Sub-Problems\", \"Consider Working Backwards\", \"Try a Simpler Case or Analogy\", \"Draw a Diagram or Visualize\",\n", " \"Perform Steps Systematically\", \"Check Each Step for Validity\",\n", " \"Check Solution for Reasonableness\", \"Verify all Constraints are Met\", \"Substitute Solution into Original Problem\", \"Alternative Solutions or Generalizations\",\n", " \"Re-evaluate Understanding of Problem\", \"Identify and Question Assumptions\", \"Try a Different Strategy or Perspective\", \"Take a Break\", \"Focus on a Specific Part or Sub-goal\",\n", "\n", " # ========== INITIAL PROBLEM RECOGNITION & CLASSIFICATION ==========\n", " \"Classify Problem Type\", \"Mathematical Domain Keywords (e.g., 'integral', 'matrix', 'proof')\", \"Equation, Expression, Inequality, Statement to Prove, etc.\", \"Numbers, Variables, Functions, Geometric Shapes, Sets, etc.\",\n", " \"Consider Quadratic Equation Strategies\", \"Consider Derivative Strategies\", \"Consider Integral Strategies\", \"Consider Linear Algebra Methods\", \"Consider Number Theory Proof Techniques\",\n", " \"Consider Combinatorics Techniques\", \"Consider Probability Theory\", \"Consider Optimization Strategies\", \"Consider Sequence Strategies\", \"Consider Series Strategies\",\n", " \"Consider Complex Number Strategies\", \"Consider Functional Equation Strategies\", \"Consider Graph Theory Strategies\", \"Consider Set Theory Strategies\", \"Consider Statistical Analysis Methods\",\n", " \"Consider Proof Writing Strategies\", # Tail for \"Prove that...\"\n", "\n", " # ========== ALGEBRAIC PROBLEM STRATEGIES (General) ===========\n", " \"Algebraic Equation Solving\", \"Algebraic Expression Simplification\",\n", " \"Isolate Variable or Factor\", \"Check for Extraneous Solutions\", \"Maintain Equivalence Through Operations\",\n", " \"Combine Like Terms and Apply Properties\", \"Factorization Techniques\",\n", "\n", " # ========== QUADRATIC EQUATION STRATEGIES ==========\n", " \"Discriminant (b²-4ac)\", \"Quadratic Formula\", \"Factoring Quadratic Expression\", \"Completing the Square (Quadratic)\", \"Parabola Properties\",\n", " \"Nature and Number of Roots (Quadratic)\",\n", " \"Two Distinct Real Roots\", \"One Repeated Real Root\", \"Two Complex Conjugate Roots\",\n", " \"Difference of Squares\", \"Perfect Square Trinomial\", \"AC Method or Trial-and-Error\",\n", " \"Vertex Form of Parabola\", \"Quadratic Formula\", # Derivation\n", " \"Direction of Opening (Up/Down)\", \"X-intercepts\", \"Vertex (Max/Min Point)\", \"Axis of Symmetry\",\n", "\n", " # ========== LINEAR EQUATION & SYSTEMS STRATEGIES ==========\n", " \"Basic Algebraic Manipulation to Isolate Variable\",\n", " \"Consistency of System (Solutions Exist?)\", \"Augmented Matrix [A|b]\", \"Substitution or Elimination Method (Systems)\",\n", " \"Gaussian Elimination (REF)\", \"Gauss-Jordan Elimination (RREF)\",\n", " \"Back Substitution\",\n", " \"Determine Unique, Infinite, or No Solution\", \"Identify Free Variables\",\n", " \"System has Unique Solution (if consistent)\", \"System has No Unique Solution (Infinite or None)\",\n", " \"x = A⁻¹b\",\n", "\n", " # ========== POLYNOMIAL EQUATION STRATEGIES (Degree > 2) ==========\n", " \"Degree of Polynomial n\", \"Rational Root Theorem\", \"Factor Theorem (Polynomials)\", \"Synthetic Division / Polynomial Long Division\",\n", " \"Candidate Rational Roots p/q\", \"P(x) to see if P(p/q) = 0\",\n", " \"If P(r)=0, then (x-r) is a factor\",\n", " \"Reduce Degree of Polynomial\", \"Depressed Polynomial (quotient) and Remainder\",\n", " \"Estimate Number of Positive/Negative Real Roots\",\n", " \"X-intercepts of y=P(x)\", \"End Behavior of Polynomial\",\n", " \"Factor by Grouping (Polynomials)\", \"Sum/Difference of Cubes\",\n", "\n", " # ========== RADICAL & RATIONAL EQUATION STRATEGIES ==========\n", " \"Isolate Radical and Square Both Sides\", \"Check for Extraneous Solutions (Radical Eq.)\",\n", " \"Multiply by LCD to Clear Denominators\", \"Values that make original denominators zero\", \"Solve Resulting Polynomial/Linear Equation\",\n", "\n", " # ========== INEQUALITY STRATEGIES ==========\n", " \"Linear Inequality\", \"Quadratic Inequality\", \"Absolute Value Inequality\", # etc.\n", " \"Solve as equation, then test intervals/sign\",\n", " \"Find roots of ax²+bx+c=0, then use parabola/sign chart\", \"Interpret solution as interval(s)\",\n", " \"Find roots of P(x)=0, use sign chart with all roots\", \"Solution as union of intervals\",\n", " \"Set to P(x)/Q(x) > 0 (or <, ≥, ≤), find zeros of P(x) and Q(x)\", \"Use sign chart with all critical points (zeros and undefined)\",\n", " \"Split into cases: expression inside abs is positive or negative\", \"Solve each case, combine valid solutions\",\n", " \"Zeros and undefined points of the expression\", \"Test points in intervals on number line\",\n", " \"Determine sign of expression in each interval to find solution set\",\n", "\n", " # ========== CALCULUS: LIMITS ==========\n", " \"Direct Substitution (Limits)\", \"Algebraic Manipulation (Limits)\", \"L'Hôpital's Rule (Limits)\",\n", " \"Limit is that number (if defined)\", \"Apply Advanced Limit Techniques\",\n", " \"0/0 or ∞/∞\", \"0 * ∞ or ∞ - ∞\", \"1^∞, 0^0, ∞^0\", # Types of Indeterminate Forms\n", " \"L'Hôpital's Rule (if conditions met)\", \"Algebraic Manipulation (Factor/Cancel, Conjugate)\",\n", " \"Rewrite to 0/0 or ∞/∞ form\",\n", " \"Use Logarithmic Transformation then L'Hôpital's\",\n", " \"Bound function between two others with known equal limits\",\n", " \"Limit from Left (LHL)\", \"Limit from Right (RHL), Limit exists if LHL=RHL\",\n", "\n", " # ========== CALCULUS: DERIVATIVES ==========\n", " \"Rate of Change / Slope of Tangent\", \"Limit Definition of Derivative\", \"Differentiation Rules\",\n", " \"Product Rule\", \"Quotient Rule\", \"Chain Rule\", \"Implicit Differentiation\", \"Logarithmic Differentiation\",\n", " \"Optimization (Finding Extrema)\", \"Analyzing Function Behavior (Derivatives)\", \"Related Rates\", \"Motion Analysis (Velocity, Acceleration)\", \"Tangent Line Approximation\",\n", " \"Critical Points (where f'=0 or DNE)\", \"First Derivative Test or Second Derivative Test\",\n", " \"Increasing/Decreasing Intervals (from f')\", \"Concavity/Inflection Points (from f'')\",\n", "\n", " # ========== CALCULUS: INTEGRALS ==========\n", " \"Antidifferentiation (+C)\", \"Net Accumulation / Area Under Curve\", \"Fundamental Theorem of Calculus\",\n", " \"Links derivatives and integrals\",\n", " \"u-Substitution\", \"Integration by Parts\", \"Partial Fraction Decomposition\", \"Trigonometric Substitution\", \"Trigonometric Integral Methods (Identities, Reduction)\",\n", " \"Evaluate using Limits\", \"Check Convergence/Divergence of Improper Integral\",\n", " \"Calculating Areas and Volumes\", \"Work, Average Value, Arc Length\", \"Solving Separable Differential Equations\", \"Probability Density Functions\",\n", "\n", " # ========== DIFFERENTIAL EQUATION STRATEGIES ==========\n", " \"Classify Differential Equation\", \"Choose Appropriate Solution Method (DE)\", \"Verify Solution (DE)\",\n", " \"Order, Linearity, Homogeneity, Coefficients\", \"Guides method selection\",\n", " \"Separable Differential Equation\", \"Linear First-Order Differential Equation\", \"Exact Differential Equation\", \"Homogeneous Differential Equation (DE)\", # Add Bernoulli etc. if more detail wanted\n", " \"Separate variables and integrate\",\n", " \"Standard form y'+P(x)y=Q(x)\", \"Use Integrating Factor μ(x)=exp(∫P(x)dx)\",\n", " \"Check if ∂M/∂y = ∂N/∂x, then integrate\",\n", " \"Substitute y=vx or x=vy to make separable\",\n", " \"Characteristic Equation (DE)\", \"Method of Undetermined Coefficients or Variation of Parameters (for non-homogeneous)\",\n", " \"ar²+br+c=0 (for ay''+by'+cy=0)\", \"Real & Distinct Roots\", \"Real & Repeated Roots\", \"Complex Conjugate Roots (DE)\",\n", " \"Find y_complementary and y_particular\", \"Guess y_p based on form of non-homogeneous term\",\n", "\n", " # ========== LINEAR ALGEBRA: VECTORS ==========\n", " \"Dot Product Applications\", \"Cross Product Applications (3D)\", \"Vector Projections\", \"Lines and Planes in Space (Vectors)\",\n", " \"Angle Between Vectors\", \"Orthogonality Check (Dot Product = 0)\",\n", " \"Normal Vector to a Plane\", \"Area of Parallelogram/Triangle (Vectors)\",\n", " \"Scalar or Vector Projection Formula\",\n", " \"Vector Equation of a Line (r = r₀ + tv)\", \"Equation of a Plane (n·(r-r₀)=0 or ax+by+cz=d)\",\n", "\n", " # ========== LINEAR ALGEBRA: MATRICES ==========\n", " \"Determinants (Matrices)\", \"Matrix Inverses\", \"Solving Systems Ax=b using Matrices\", \"Eigenvalues and Eigenvectors\",\n", " \"Scalar value, properties for invertibility\", \"Cofactor Expansion or Row Reduction Method\",\n", " \"Exists if det(A)≠0, A⁻¹A=I\", \"Gauss-Jordan Method for A⁻¹ or Adjoint Method\",\n", " \"Augmented Matrix and Row Operations\",\n", " \"Solve det(A - λI) = 0 for λ (eigenvalues)\", \"Solve (A - λI)v = 0 for v (eigenvectors)\", \"Applications in transformations, stability\",\n", " \"Transform matrix to A = PDP⁻¹ (if possible)\",\n", "\n", " # ========== PROOF STRATEGIES ==========\n", " \"Identify Hypothesis and Conclusion\", \"Direct Proof Structure\", \"Proof by Contradiction Structure\", \"Proof by Contrapositive Structure\", \"Proof by Cases Structure\",\n", " \"Assume Hypothesis True, Deduce Conclusion True\",\n", " \"Assume Hypothesis True AND Conclusion False, Derive Logical Contradiction\",\n", " \"Assume Conclusion False (¬Q), Deduce Hypothesis False (¬P) (for P⇒Q)\",\n", " \"Exhaustive and Mutually Exclusive Cases if possible\",\n", " \"Establish Base Case\", \"State Inductive Hypothesis (Assume P(k))\", \"Prove Inductive Step (Show P(k) ⇒ P(k+1))\",\n", " \"Prove P⇒Q AND Q⇒P\",\n", " \"Construct an example or use non-constructive argument (e.g. IVT)\",\n", " \"Prove existence, then assume two (x₁, x₂) and show x₁=x₂\",\n", " \"Undefined terms, incorrect logic, missing cases\",\n", "\n", " # ========== COMBINATORICS STRATEGIES ==========\n", " \"Multiplication Principle (Sequential Choices)\", \"Addition Principle (Disjoint Choices)\", \"Permutations vs. Combinations\", \"Consider Repetition and Order\",\n", " \"Order matters (Permutations)\", \"Order does not matter (Combinations)\",\n", " \"Principle of Inclusion-Exclusion (Overlapping Sets)\", \"Pigeonhole Principle\", \"Generating Functions (Encoding sequences as polynomials)\", \"Recurrence Relations (Defining counts recursively)\",\n", " \"Casework (Break into simpler, disjoint cases)\", \"Complementary Counting (Total - Unwanted)\", \"Bijective Proofs (Find 1-to-1 correspondence)\",\n", "\n", " # ========== PROBABILITY STRATEGIES ==========\n", " \"Define Sample Space (S) and Events (E)\", \"P(E) = |Favorable Outcomes| / |Total Outcomes| (if equally likely)\", \"Combinatorics Techniques (for counting)\", \"Conditional Probability & Independence\",\n", " \"P(A|B) vs P(A∩B)=P(A)P(B)\", \"Bayes' Theorem Applications\",\n", " \"Updating probabilities based on new evidence\",\n", " \"Probability Distribution (PMF/PDF)\", \"Expected Value E[X]\", \"Variance Var(X) and Standard Deviation\",\n", " \"Mean or average outcome\",\n", "\n", " # ========== NUMBER THEORY STRATEGIES ==========\n", " \"Divisibility and Prime Factorization\", \"Modular Arithmetic Applications\", \"GCD, LCM, and Euclidean Algorithm\", \"Diophantine Equation Solving\",\n", " \"Unique Prime Factorization (Fundamental Theorem of Arithmetic)\", \"Divisibility Rules\",\n", " \"Solving Congruences\", \"Fermat's Little Theorem / Euler's Totient Theorem\", \"Chinese Remainder Theorem\",\n", " \"Euclidean Algorithm for GCD\", \"Using GCD to find LCM or solve linear Diophantine equations\",\n", " \"Finding integer solutions to polynomial equations\",\n", "\n", " # ========== GEOMETRY STRATEGIES ==========\n", " \"Draw Accurate Diagram and Label\", \"Triangle Properties and Theorems\", \"Circle Properties and Theorems\", \"Polygon Properties\", \"Coordinate Geometry Approach\",\n", " \"Angle Sum, Exterior Angles, Special Triangles (Isosceles, Equilateral, Right)\", \"Similarity (AA, SAS, SSS)\", \"Congruence (SSS, SAS, ASA, AAS, HL)\",\n", " \"Tangents, Chords, Secants, Inscribed/Central Angles, Power of a Point\", \"Cyclic Quadrilaterals\",\n", " \"Angle Sums, Diagonals, Regular Polygons\",\n", " \"Assign coordinates, use distance/slope/midpoint/line formulas\",\n", " \"Volumes, Surface Areas of 3D shapes\",\n", "\n", " # ========== OPTIMIZATION STRATEGIES ==========\n", " \"Identify Objective Function and Constraints\", \"Single-Variable Optimization (Calculus)\", \"Multi-Variable Optimization (Calculus)\",\n", " \"Use derivatives to find critical points (f'=0 or DNE)\", \"Test critical points and endpoints (1st/2nd Derivative Test)\",\n", " \"Use partial derivatives for critical points (∇f=0)\", \"Apply Second Partials Test (Hessian) or analyze boundary\",\n", " \"Lagrange Multipliers\", \"Linear Programming Basics\",\n", " \"Setup L(x,y,λ) = f(x,y) - λg(x,y), solve system ∇L=0\",\n", "\n", " # ========== COMPLEX NUMBERS STRATEGIES ==========\n", " \"Rectangular vs. Polar Form (Complex)\", \"Operations with Complex Numbers\", \"De Moivre's Theorem Applications\", \"Euler's Formula Applications\",\n", " \"a+bi vs re^(iθ)\", \"Choose form based on operation\",\n", " \"Addition, Subtraction, Multiplication, Division, Conjugate\", \"Modulus and Argument properties\",\n", " \"Powers of complex numbers: (re^(iθ))^n = r^n e^(inθ)\",\n", " \"e^(iθ) = cosθ + isinθ for connections to trig\",\n", " \"Finding nth roots using polar form\",\n", " \"Visualize as vectors or points in Argand plane\",\n", "\n", " # ========== SEQUENCES AND SERIES STRATEGIES ==========\n", " \"Identifying Sequence Type (Arithmetic, Geometric, etc.)\", \"Finding Explicit or Recursive Formulas (Sequences)\", \"Convergence/Divergence of Sequences\",\n", " \"Arithmetic: a_n = a₁+(n-1)d\", \"Geometric: a_n = a₁r^(n-1)\",\n", " \"a_n in terms of n, or a_n in terms of previous terms\",\n", " \"Identifying Series Type (Arithmetic, Geometric, etc.)\", \"Summation Formulas for Finite Series\", \"Convergence/Divergence of Infinite Series\",\n", " \"Arithmetic sum, Geometric sum\",\n", " \"Key is |r|<1 for geometric series sum S=a₁/(1-r)\",\n", " \"nth Term Test for Divergence\", \"Common Series Convergence Tests\",\n", " \"Integral, Comparison, Limit Comparison, Ratio, Root, Alternating Series\", \"Conditions for each test\", \"Choosing appropriate test\", \"Absolute vs. Conditional Convergence\",\n", " \"Radius of Convergence\", \"Interval of Convergence (check endpoints)\",\n", "\n", " # ========== FUNCTIONAL EQUATIONS STRATEGIES ==========\n", " \"Testing Special Values (Functional Eq.)\", \"Checking for Standard Forms (Cauchy, etc.)\", \"Using Properties (Injectivity, Surjectivity, Parity, Periodicity)\", \"Strategic Substitutions (Functional Eq.)\",\n", " \"Substitute x=0, y=0, x=1, y=x, y=-x, etc.\",\n", " \"e.g., f(x+y)=f(x)+f(y) (linear), f(xy)=f(x)f(y) (multiplicative)\",\n", " \"If f is injective/surjective/odd/even/periodic, use these facts\",\n", " \"Replace variables with expressions involving f or other variables\",\n", "\n", " # ========== GRAPH THEORY STRATEGIES ==========\n", " \"Basic Graph Properties (Vertices, Edges, Degree, Connectivity)\", \"Paths, Cycles, and Traversals (Eulerian, Hamiltonian)\", \"Shortest Path Algorithms (BFS, Dijkstra)\", \"Special Graph Types (Bipartite, Planar, Trees)\",\n", " \"Order, size, degree sequence, connected components, acyclic\",\n", " \"Eulerian (all edges once), Hamiltonian (all vertices once)\",\n", " \"BFS for unweighted, Dijkstra for non-negative weighted\",\n", " \"Kruskal's or Prim's algorithm\",\n", " \"Adjacency matrix (computation), Adjacency list (sparse graphs)\",\n", " \"Bipartite (2-colorable, no odd cycles), Planar (no edge crossings), Trees (connected, acyclic)\",\n", "\n", " # ========== SET THEORY STRATEGIES ==========\n", " \"Set Operations and Identities\", \"Venn Diagrams for Visualization\", \"Cardinality and Counting Arguments (Sets)\", \"Proving Set Equality or Subset Relations\",\n", " \"Union, Intersection, Complement, Difference, De Morgan's Laws\",\n", " \"Useful for 2-3 sets, illustrates relationships\",\n", " \"|A|, Principle of Inclusion-Exclusion\",\n", " \"A=B ⇔ (A⊆B and B⊆A); Element-chasing proofs\",\n", " \"|P(A)|=2^|A|, |A×B|=|A||B|\",\n", "\n", " # ========== ADVANCED PROBLEM PATTERNS / HEURISTICS (Reiteration/Emphasis) ==========\n", " \"Telescoping Sums/Products\", \"Generating Functions in Combinatorics\", \"Bijective Proofs in Combinatorics\", \"Invariants in Processes\",\n", " \"Monovariants (Strictly Increasing/Decreasing Quantities)\", \"Extremal Principle (Consider Max/Min Cases)\", \"Pigeonhole Principle Applications\", \"Well-Ordering Principle in Number Theory Proofs\",\n", " \"Problem Transformation to a Known Structure\"\n", " ]\n", "\n", " tails = [\n", " # ========== META-LEVEL PROBLEM SOLVING & HEURISTICS ==========\n", " \"Understand the Problem Deeply\", \"Devise a Plan\", \"Carry Out the Plan\", \"Look Back and Verify\",\n", " \"Identify Knowns, Unknowns, and Constraints\", \"Clarify Terminology and Notation\", \"Rephrase Problem in Own Words\", \"Implicit Assumptions\",\n", " \"Recall Relevant Concepts and Theorems\", \"Look for Similar Solved Problems\", \"Break Down into Sub-Problems\", \"Consider Working Backwards\", \"Try a Simpler Case or Analogy\", \"Draw a Diagram or Visualize\",\n", " \"Perform Steps Systematically\", \"Check Each Step for Validity\",\n", " \"Check Solution for Reasonableness\", \"Verify all Constraints are Met\", \"Substitute Solution into Original Problem\", \"Alternative Solutions or Generalizations\",\n", " \"Re-evaluate Understanding of Problem\", \"Identify and Question Assumptions\", \"Try a Different Strategy or Perspective\", \"Take a Break\", \"Focus on a Specific Part or Sub-goal\",\n", "\n", " # ========== INITIAL PROBLEM RECOGNITION & CLASSIFICATION ==========\n", " \"Classify Problem Type\", \"Mathematical Domain Keywords (e.g., 'integral', 'matrix', 'proof')\", \"Equation, Expression, Inequality, Statement to Prove, etc.\", \"Numbers, Variables, Functions, Geometric Shapes, Sets, etc.\",\n", " \"Consider Quadratic Equation Strategies\", \"Consider Derivative Strategies\", \"Consider Integral Strategies\", \"Consider Linear Algebra Methods\", \"Consider Number Theory Strategies\", # Changed from \"Proof Techniques\" to general strategies\n", " \"Consider Combinatorics Techniques\", \"Consider Probability Theory Strategies\", \"Consider Optimization Strategies\", \"Consider Sequence Strategies\", \"Consider Series Strategies\",\n", " \"Consider Complex Number Strategies\", \"Consider Functional Equation Strategies\", \"Consider Graph Theory Strategies\", \"Consider Set Theory Strategies\", \"Consider Statistical Analysis Methods\",\n", " \"Consider Proof Writing Strategies\",\n", "\n", " # ========== ALGEBRAIC PROBLEM STRATEGIES (General) ===========\n", " \"Algebraic Equation Solving\", \"Algebraic Expression Simplification\",\n", " \"Isolate Variable or Factorization Strategies\", \"Verify Solutions (especially with radicals, rationals)\", \"Properties of Equality and Operations\",\n", " \"Standard Algebraic Manipulations\", \"Common Factoring Patterns\",\n", "\n", " # ========== QUADRATIC EQUATION STRATEGIES ==========\n", " \"Discriminant (b²-4ac)\", \"Quadratic Formula\", \"Factoring Quadratic Expression\", \"Completing the Square (Quadratic)\", \"Parabola Properties\",\n", " \"Nature and Number of Roots (Quadratic)\",\n", " \"Two Distinct Real Roots\", \"One Repeated Real Root\", \"Two Complex Conjugate Roots\",\n", " \"Difference of Squares (a²-b²)\", \"Perfect Square Trinomial (a²±2ab+b²)\", \"Techniques for ax²+bx+c\",\n", " \"Vertex Form of Parabola (y=a(x-h)²+k)\", \"Derivation of Quadratic Formula\",\n", " \"Direction of Opening (a>0 up, a<0 down)\", \"Roots of ax²+bx+c=0\", \"Vertex (-b/2a, f(-b/2a)) or (h,k)\", \"Axis of Symmetry (x=-b/2a or x=h)\",\n", "\n", " # ========== LINEAR EQUATION & SYSTEMS STRATEGIES ==========\n", " \"Standard Algebraic Manipulation to Isolate Variable\",\n", " \"Consistency (Unique, Infinite, No Solution)\", \"Augmented Matrix [A|b]\", \"Substitution Method (System) or Elimination Method (System)\",\n", " \"Gaussian Elimination (REF)\", \"Gauss-Jordan Elimination (RREF)\",\n", " \"Back Substitution to find variables\",\n", " \"Interpret RREF for solution type\", \"Identify Basic vs. Free Variables from RREF\",\n", " \"System has Unique Solution (for square system)\", \"System has No Unique Solution (Infinite or None - analyze RREF)\",\n", " \"Solve Ax=b as x = A⁻¹b\",\n", "\n", " # ========== POLYNOMIAL EQUATION STRATEGIES (Degree > 2) ==========\n", " \"Degree of Polynomial n (Max n roots)\", \"Rational Root Theorem\", \"Factor Theorem (Polynomials)\", \"Synthetic Division / Polynomial Long Division\",\n", " \"Candidate Rational Roots p/q (p|const, q|leading_coeff)\", \"Test candidates in P(x)\",\n", " \"(x-r) is factor iff P(r)=0\",\n", " \"Reduce Degree of Polynomial if root is found\", \"Depressed Polynomial and Remainder\",\n", " \"Count sign changes in P(x) and P(-x) for positive/negative real root estimates\",\n", " \"X-intercepts are real roots\", \"End behavior (leading term test)\",\n", " \"Factor by Grouping (Polynomials)\", \"Sum/Difference of Cubes Formulas\",\n", "\n", " # ========== RADICAL & RATIONAL EQUATION STRATEGIES ==========\n", " \"Isolate radical, raise both sides to power of index\", \"Check for Extraneous Solutions after solving\",\n", " \"Multiply all terms by LCD to eliminate denominators\", \"Excluded values (where original denominators are zero)\", \"Solve resulting equation (often polynomial/linear)\",\n", "\n", " # ========== INEQUALITY STRATEGIES ==========\n", " \"Type of Inequality (Linear, Quadratic, Polynomial, Rational, Absolute Value)\", \"Critical Points Method (Inequalities)\", \"Flip inequality sign if multiplying/dividing by negative\",\n", " \"Isolate variable, maintain direction of inequality\",\n", " \"Find roots of quadratic, use parabola graph or sign chart for intervals\", \"Solution as interval(s)\",\n", " \"Find all real roots of P(x)=0, use sign chart for intervals\", \"Solution as union of intervals\",\n", " \"Set P(x)/Q(x) > 0 (etc.), find zeros of P(x) AND Q(x) (critical points)\", \"Use sign chart with all critical points (zeros and undefined points)\",\n", " \"Split into cases (e.g., X ≥ 0 and X < 0 for |X|)\", \"Combine solutions from valid cases\",\n", " \"Values where expression is zero or undefined\", \"These points define intervals for testing\",\n", " \"Test a point in each interval to determine if it satisfies the inequality\",\n", "\n", " # ========== CALCULUS: LIMITS ==========\n", " \"Direct Substitution (Limits)\", \"Algebraic Manipulation (Limits)\", \"L'Hôpital's Rule (Limits)\",\n", " \"Limit value (if defined)\", \"Apply Advanced Limit Techniques if Indeterminate\",\n", " \"0/0 or ∞/∞\", \"0 * ∞ or ∞ - ∞\", \"1^∞, 0^0, ∞^0\", # Types\n", " \"Apply if form is 0/0 or ∞/∞ and functions are differentiable\", \"Factor/Cancel, Multiply by Conjugate, Use Trig Identities, Divide by Highest Power (at ∞)\",\n", " \"Rewrite as 0/0 or ∞/∞ for L'Hôpital's or other manipulation\",\n", " \"Use y=f(x)^g(x) -> ln y = g(x)ln f(x), find lim (ln y), then exponentiate\",\n", " \"Bound function between two others with known, equal limits\",\n", " \"Limit from Left (LHL)\", \"Limit from Right (RHL); Limit exists if LHL=RHL\",\n", "\n", " # ========== CALCULUS: DERIVATIVES ==========\n", " \"Rate of Change / Slope of Tangent\", \"Limit Definition of Derivative\", \"Differentiation Rules\",\n", " \"Product Rule (uv)' = u'v+uv'\", \"Quotient Rule (u/v)' = (u'v-uv')/v²\", \"Chain Rule (f(g(x)))' = f'(g(x))g'(x)\", \"Implicit Differentiation Technique\", \"Logarithmic Differentiation Technique\",\n", " \"Optimization (Finding Extrema)\", \"Analyzing Function Behavior (Derivatives)\", \"Related Rates Problems\", \"Motion Analysis (Velocity, Acceleration from position)\", \"Tangent Line Approximations (Linearization)\",\n", " \"Critical Points (f'=0 or DNE)\", \"First/Second Derivative Test for Extrema Classification\",\n", " \"Increasing/Decreasing from f' sign\", \"Concavity/Inflection Points from f'' sign\",\n", "\n", " # ========== CALCULUS: INTEGRALS ==========\n", " \"Antidifferentiation (+C)\", \"Net Accumulation / Area Under Curve\", \"Fundamental Theorem of Calculus (FTC)\",\n", " \"FTC Part 1: d/dx ∫[a,x] f(t)dt = f(x); FTC Part 2: ∫[a,b] f(x)dx = F(b)-F(a)\",\n", " \"u-Substitution (Integrals)\", \"Integration by Parts (∫udv=uv-∫vdu)\", \"Partial Fraction Decomposition (Integrals)\", \"Trigonometric Substitution (Integrals)\", \"Methods for Trigonometric Integrals\",\n", " \"Evaluate using Limits (e.g., lim ∫[a,t] as t→∞)\", \"Determine Convergence or Divergence\",\n", " \"Area Between Curves (∫(top-bottom) or ∫(right-left))\", \"Volumes (Disk/Washer, Shells)\", \"Arc Length (∫√(1+(f')²))\", \"Work (∫F(x)dx), Average Value (1/(b-a)∫f(x)dx)\",\n", "\n", " # ========== DIFFERENTIAL EQUATION STRATEGIES ==========\n", " \"Classify Differential Equation\", \"Choose Appropriate Solution Method (DE)\", \"Verify Solution by Substitution (DE)\",\n", " \"Order, Linearity, Homogeneity, Coefficient Type (Constant/Variable)\", \"Guides method selection\",\n", " \"Separable DE\", \"Linear First-Order DE\", \"Exact DE\", \"Homogeneous DE (y/x or x/y sub)\", # Add Bernoulli, Riccati if desired\n", " \"Separate f(y)dy = g(x)dx and integrate\",\n", " \"Standard Form y'+P(x)y=Q(x)\", \"Integrating Factor μ(x)=exp(∫P(x)dx)\",\n", " \"Check M_y = N_x, then find potential function\",\n", " \"Substitute y=vx or x=vy to make separable\",\n", " \"Characteristic Equation (DE) (ar²+br+c=0)\", \"Method of Undetermined Coefficients or Variation of Parameters\",\n", " \"Roots determine form of y_c (complementary solution)\", \"y_c = c₁e^(r₁x)+c₂e^(r₂x)\", \"y_c = (c₁+c₂x)e^(rx)\", \"y_c = e^(αx)(c₁cosβx+c₂sinβx)\",\n", " \"y_general = y_complementary + y_particular\", \"Guess y_p based on G(x) form, or use Variation of Parameters\",\n", "\n", " # ========== LINEAR ALGEBRA: VECTORS ==========\n", " \"Dot Product Applications\", \"Cross Product Applications (3D)\", \"Vector Projections\", \"Lines and Planes in Space (Vectors)\",\n", " \"Angle Between Vectors (cosθ = a·b / ||a||||b||)\", \"Orthogonality (a·b = 0)\",\n", " \"Normal Vector to a Plane (from two vectors in plane)\", \"Area of Parallelogram (||a×b||)\",\n", " \"proj_b a = (a·b / ||b||²) b\",\n", " \"Vector form r=r₀+tv; Parametric equations\", \"Scalar form ax+by+cz=d; Normal vector \",\n", "\n", " # ========== LINEAR ALGEBRA: MATRICES ==========\n", " \"Determinants (Matrices)\", \"Matrix Inverses\", \"Solving Systems Ax=b using Matrices\", \"Eigenvalues and Eigenvectors\",\n", " \"Scalar value, det(A)≠0 ⇔ Invertible\", \"Properties: det(AB)=det(A)det(B), det(A^T)=det(A)\",\n", " \"A⁻¹ such that AA⁻¹=I\", \"Methods: [A|I]→[I|A⁻¹], Adjoint formula\",\n", " \"Augmented Matrix [A|b] and row reduction (REF/RREF)\",\n", " \"Solve det(A-λI)=0 for eigenvalues λ\", \"Solve (A-λI)v=0 for eigenvectors v\", \"Applications: stability, principal axes, Markov chains\",\n", " \"A = PDP⁻¹ (P cols are eigenvectors, D diagonal of eigenvalues)\",\n", "\n", " # ========== PROOF STRATEGIES ==========\n", " \"Identify Hypothesis and Conclusion\", \"Direct Proof Structure\", \"Proof by Contradiction Structure\", \"Proof by Contrapositive Structure\", \"Proof by Cases Structure\",\n", " \"Assume H, deduce C\",\n", " \"Assume H and ¬C, derive contradiction\",\n", " \"Assume ¬C, deduce ¬H (for H⇒C)\",\n", " \"Exhaustive cases covering all possibilities\",\n", " \"Base Case (P(n₀) is true)\", \"Inductive Hypothesis (Assume P(k) for k≥n₀)\", \"Inductive Step (Prove P(k)⇒P(k+1))\",\n", " \"Prove (P⇒Q) AND (Q⇒P)\",\n", " \"Construct example or use non-constructive argument\",\n", " \"Prove existence, then assume x₁ and x₂ both satisfy, show x₁=x₂\",\n", " \"Assuming the conclusion, circular reasoning, misusing definitions, quantifier errors\",\n", "\n", " # ========== COMBINATORICS STRATEGIES ==========\n", " \"Multiplication Principle\", \"Addition Principle\", \"Permutations vs. Combinations\", \"Repetition/Replacement consideration\",\n", " \"P(n,r) if order matters, C(n,r) if order doesn't (no repetition)\", \"Consider variations with repetition\",\n", " \"Principle of Inclusion-Exclusion\", \"Pigeonhole Principle\", \"Generating Functions\", \"Recurrence Relations\",\n", " \"Casework\", \"Complementary Counting\", \"Bijective Proofs\",\n", "\n", " # ========== PROBABILITY STRATEGIES ==========\n", " \"Define Sample Space (S) and Events (E)\", \"P(E) = |Favorable|/|Total| (equally likely)\", \"Combinatorics for counting\", \"Conditional Probability & Independence\",\n", " \"P(A|B) and P(A∩B)=P(A)P(B) test\", \"Bayes' Theorem Applications\",\n", " \"Update P(A_i|B) from P(B|A_i)\",\n", " \"Probability Distribution (PMF/PDF)\", \"Expected Value E[X]\", \"Variance Var(X)\",\n", " \"ΣxP(X=x) or ∫xf(x)dx\",\n", "\n", " # ========== NUMBER THEORY STRATEGIES ==========\n", " \"Divisibility and Prime Factorization\", \"Modular Arithmetic Applications\", \"GCD, LCM, and Euclidean Algorithm\", \"Diophantine Equation Solving\",\n", " \"Fundamental Theorem of Arithmetic\", \"Divisibility rules, properties of primes\",\n", " \"Solving Congruences (ax≡b mod m)\", \"Fermat's/Euler's Theorems\", \"Chinese Remainder Thm (systems of congruences)\",\n", " \"Euclidean Algorithm for gcd(a,b)\", \"ax+by=gcd(a,b) using Extended Euclidean Alg.\",\n", " \"Linear Diophantine eq: ax+by=c has solutions iff gcd(a,b)|c\",\n", "\n", " # ========== GEOMETRY STRATEGIES ==========\n", " \"Draw Accurate Diagram and Label\", \"Triangle Properties and Theorems\", \"Circle Properties and Theorems\", \"Polygon Properties\", \"Coordinate Geometry Approach\",\n", " \"Angle sums, side-angle relationships (Sine/Cosine Law), similarity, congruence, special triangles\", \"Pythagorean Theorem\",\n", " \"Tangents, secants, chords, inscribed/central angles, power of a point\", \"Cyclic polys, Ptolemy's Thm\",\n", " \"Angle sums, diagonals, regular polygon properties, area formulas\",\n", " \"Assign coordinates, use distance, slope, midpoint, line/circle equations\",\n", " \"Volumes, surface areas, cross-sections, Cavalieri's principle\",\n", "\n", " # ========== OPTIMIZATION STRATEGIES ==========\n", " \"Objective Function, Constraint Equations/Inequalities\", \"Single-Variable Optimization (Calculus)\", \"Multi-Variable Optimization (Calculus)\",\n", " \"Find critical points (f'=0 or DNE), test endpoints\", \"1st/2nd Derivative Tests for local extrema\",\n", " \"Find critical points (∇f=0), use Hessian/Second Partials Test\", \"Check boundary of feasible region\",\n", " \"Lagrange Multipliers for equality constraints\", \"KKT conditions for inequality constraints (advanced)\",\n", " \"Graphical method (2D), Simplex method (higher-D)\",\n", "\n", " # ========== COMPLEX NUMBERS STRATEGIES ==========\n", " \"Rectangular (a+bi) vs. Polar (re^(iθ)) Form\", \"Arithmetic Operations (Complex)\", \"De Moivre's Theorem\", \"Euler's Formula (e^(iθ)=cosθ+isinθ)\",\n", " \"Choose based on operation (add/sub vs mult/div/power/root)\",\n", " \"Addition/subtraction (component-wise), Multiplication (FOIL or polar), Division (conjugate or polar)\",\n", " \"(cosθ + isinθ)^n = cos(nθ) + isin(nθ) (for powers/roots)\",\n", " \"Link complex exponentials to trig functions\",\n", " \"Find n distinct nth roots using polar form\",\n", " \"Vector representation, geometric effect of multiplication (rotation/scaling)\",\n", "\n", " # ========== SEQUENCES AND SERIES STRATEGIES ==========\n", " \"Identify Sequence Type (Arithmetic, Geometric, etc.)\", \"Finding Explicit or Recursive Formulas (Sequences)\", \"Limit of a Sequence (Convergence/Divergence)\",\n", " \"Common difference 'd'\", \"Common ratio 'r'\",\n", " \"a_n = f(n) or a_n based on a_(n-1), etc.\",\n", " \"Identifying Series Type (Arithmetic, Geometric, etc.)\", \"Summation Formulas for Finite Series\", \"Convergence/Divergence of Infinite Series\",\n", " \"Arithmetic: S_n=n/2(a₁+a_n), Geometric: S_n=a₁(1-r^n)/(1-r)\",\n", " \"S_∞ = a₁/(1-r) if |r|<1 (Geometric)\",\n", " \"nth Term Test (if lim a_n ≠ 0, diverges)\", \"Common Series Convergence Tests\",\n", " \"Integral, Comparison (Direct/Limit), Ratio, Root, Alternating Series Tests\", \"Applicability conditions for each\", \"Strategy for choosing test\", \"Absolute vs. Conditional Convergence\",\n", " \"Radius of Convergence R\", \"Interval of Convergence (check endpoints x=a±R)\", \"**Multinomial Coefficient Theorem**: The number of ways to distribute n distinct objects into k groups of sizes n₁, n₂, ..., nₖ is:C(n; n₁, n₂, ..., nₖ) = n!/(n₁! × n₂! × ... × nₖ!)\",\n", "\n", " # ========== FUNCTIONAL EQUATIONS STRATEGIES ==========\n", " \"Testing Special Values (f(0), f(1), f(x), f(-x))\", \"Checking for Standard Forms (Cauchy, Jensen, etc.)\", \"Using Properties (Injectivity, Surjectivity, Parity, Periodicity, Monotonicity)\", \"Strategic Substitutions and Manipulations\",\n", " \"Yields initial conditions or relations\",\n", " \"f(x+y)=f(x)+f(y) => f(x)=cx, etc.\",\n", " \"Constrains possible solutions\",\n", " \"e.g., replace y with x, -x, 1/x, f(x), etc. to get new equations\",\n", "\n", " # ========== GRAPH THEORY STRATEGIES ==========\n", " \"Basic Graph Properties\", \"Paths, Cycles, and Traversals\", \"Shortest Path Algorithms\", \"Special Graph Types\",\n", " \"Vertices (V), Edges (E), Degree, Connectivity, Acyclicity\",\n", " \"Eulerian (all edges once), Hamiltonian (all vertices once), DFS, BFS\",\n", " \"BFS (unweighted), Dijkstra (non-negative weights), Bellman-Ford (negative weights)\",\n", " \"Spanning Tree Algorithms (Kruskal, Prim)\",\n", " \"Adjacency Matrix (dense graphs), Adjacency List (sparse graphs)\",\n", " \"Bipartite, Planar, Trees, Complete, Cycle graphs and their properties\",\n", "\n", " # ========== SET THEORY STRATEGIES ==========\n", " \"Set Operations and Identities\", \"Venn Diagrams for Visualization\", \"Cardinality and Counting Arguments (Sets)\", \"Proving Set Equality or Subset Relations\",\n", " \"Union, Intersection, Complement, Difference, De Morgan's, Distributive\",\n", " \"Useful for 2-3 sets, helps build intuition\",\n", " \"|A|, Inclusion-Exclusion Principle\",\n", " \"A=B iff (A⊆B and B⊆A); Element Chasing proof method\",\n", " \"|P(A)|=2^|A|; |A×B|=|A|·|B|\",\n", "\n", " # ========== ADVANCED PROBLEM PATTERNS / HEURISTICS (Reiteration/Emphasis) ==========\n", " \"Telescoping Sums/Products (cancellation)\", \"Generating Functions (combinatorial counting)\", \"Bijective Proofs (1-to-1 correspondence for counting)\", \"Invariants (quantities unchanged by operations)\",\n", " \"Monovariants (quantities strictly changing, implies termination)\", \"Extremal Principle (consider max/min/boundary cases)\", \"Pigeonhole Principle (items > categories)\", \"Well-Ordering Principle (least element proofs)\",\n", " \"Transform to a Known Problem (analogy, isomorphism)\"\n", " ]\n", "\n", " entry = []\n", " for x, y, z in zip(heads, relations, tails):\n", " entry.append({\"Head\":x, \"Relation\":y, \"Tail\":z})\n", "\n", " return entry" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cellView": "form", "id": "-sfHY_JEaPQk" }, "outputs": [], "source": [ "# @title Meta Academic Knowledge Graphs\n", "\n", "def axiomData():\n", " heads = [\n", " # ========== LOGICAL & RATIONAL AXIOMS ==========\n", " \"A Proposition\", \"A Proposition\", \"A Valid Deductive Argument\", \"An Inductive Argument\", \"A Statement 'A'\",\n", " \"A Contradiction (A and not-A)\", \"Any Statement\", \"If 'A implies B' and 'B implies C'\", \"For any property P\", \"Universal Quantifier (For all x...)\",\n", " \"Existential Quantifier (There exists an x...)\", \"A Definition\", \"An Argument's Soundness\", \"Circular Reasoning\",\n", "\n", " # ========== METAPHYSICAL/ONTOLOGICAL AXIOMS ==========\n", " \"Existence\", \"An Object\", \"An Object\", \"An Abstract Object (e.g., a number)\", \"A Concrete Object (e.g., a rock)\",\n", " \"Identity (X is Y)\", \"The Whole\", \"A Property (e.g., 'redness')\", \"Change\", \"An Event\",\n", " \"Potentiality\", \"Actuality\", \"Possibility\", \"Necessity\", \"Contingency\",\n", " \"Nothingness\",\n", "\n", " # ========== CAUSAL & PHYSICAL AXIOMS ==========\n", " \"Every Event\", \"A Cause\", \"A Causal Chain\", \"Physical Objects\", \"Physical Objects\",\n", " \"Energy/Matter\", \"An Unforced Object in Motion\", \"For Every Action\", \"The Universe\", \"The Laws of Physics\",\n", " \"An Effect\", \"Simultaneous Events for one observer\", \"A Closed System\", \"Entropy in a Closed System\", \"Information\",\n", " \"A Measurement\",\n", "\n", " # ========== TEMPORAL LOGIC AXIOMS ==========\n", " \"Time\", \"The Present Moment\", \"The Past\", \"The Future\", \"An Event in Time\",\n", " \"If Event A is before Event B\", \"Duration\", \"A Moment in Time\",\n", "\n", " # ========== SPATIAL REASONING AXIOMS ==========\n", " \"Space\", \"A Location\", \"An Object with Mass\", \"Two solid objects\", \"A Boundary\",\n", " \"An Object 'inside' a container\", \"An unobstructed path\", \"Distance\", \"Direction\", \"Containment\",\n", "\n", " # ========== EPISTEMOLOGICAL AXIOMS ==========\n", " \"Knowledge\", \"Knowledge\", \"A Belief\", \"Justification\", \"Empirical Evidence\",\n", " \"A Model or Theory\", \"A simpler explanation (Occam's Razor)\", \"Memory\", \"Perception\", \"Doubt\",\n", " \"Certainty\", \"An Anonymous Claim\",\n", "\n", " # ========== LINGUISTIC & SEMANTIC AXIOMS ==========\n", " \"A Symbol or Word\", \"The Meaning of a sentence\", \"A Literal Statement\", \"A Metaphorical Statement\", \"A Question\",\n", " \"A Command\", \"Context\", \"Ambiguity\",\n", "\n", " # ========== AGENT & INTENTIONALITY AXIOMS ==========\n", " \"An Agent\", \"An Agent's Action\", \"A Goal\", \"A Plan\", \"A Belief held by an agent\",\n", " \"A Desire held by an agent\", \"Rationality (in an agent)\", \"Perception (by an agent)\", \"Communication\", \"Cooperation\",\n", " \"An Inanimate Object\", \"An Agent's Prediction\",\n", "\n", " # ========== ETHICAL & VALUATIVE AXIOMS ==========\n", " \"An 'Is' Statement\", \"An 'Ought' Statement\", \"Sentient Beings capable of suffering\", \"Justice\", \"Beneficence\",\n", " \"Non-maleficence\", \"Autonomy\", \"A Right\", \"A Duty\", \"Intent\",\n", " \"Consequences\", \"A Virtuous Character Trait\",\n", "\n", " # ========== SYSTEMIC & COMPLEXITY AXIOMS ==========\n", " \"A System\", \"A System's Boundary\", \"An Open System\", \"A Complex System\", \"A Feedback Loop (Negative)\",\n", " \"A Feedback Loop (Positive)\", \"Emergence\", \"Homeostasis\",\n", "\n", " # ========== MATHEMATICAL AXIOMS (Examples) ==========\n", " \"Two distinct points\", \"A number plus zero\", \"If x=y and y=z\", \"The empty set\", \"A set and its powerset\",\n", " \"Parallel lines (in Euclidean geometry)\", \"The Whole\", \"A Natural Number\",\n", "\n", " # ========== COMMON SENSE/FOLK PHYSICS AXIOMS ==========\n", " \"An unsupported physical object\", \"Solid objects\", \"Liquids\", \"Fire\", \"A heavy object\",\n", " \"A sharp object\", \"A living organism\", \"A sleeping creature\", \"A tool\", \"A path\",\n", " \"A closed door\", \"A sound\", \"Darkness\"\n", " ]\n", "\n", " relations = [\n", " # ========== LOGICAL & RATIONAL AXIOMS ==========\n", " \"is_either\", \"cannot_be_both\", \"if_premises_are_true_then\", \"if_premises_are_true_makes\", \"implies\",\n", " \"is_always\", \"can_be_proven_from\", \"'A implies C' holds (Transitivity)\", \"if 'P(x)' is true for an arbitrary x, then\", \"can_be_instantiated_with\",\n", " \"asserts_the_existence_of_at_least_one\", \"equates_a_term_with\", \"requires\", \"is_a_fallacy_that\",\n", "\n", " # ========== METAPHYSICAL/ONTOLOGICAL AXIOMS ==========\n", " \"is_not\", \"is_composed_of\", \"has\", \"lacks\", \"has\",\n", " \"implies_that_X_and_Y_share_all\", \"is_greater_than_or_equal_to\", \"can_be_instantiated_by\", \"requires\", \"is_a_transition_between\",\n", " \"is_the_capacity_to\", \"is_the_realization_of\", \"is_a_state_that\", \"is_a_state_that\", \"is_a_state_that\",\n", " \"cannot_be_the_source_of\",\n", "\n", " # ========== CAUSAL & PHYSICAL AXIOMS ==========\n", " \"has_a\", \"must_precede\", \"cannot_be\", \"cannot_be_in_two_places\", \"interact_through\",\n", " \"cannot_be\", \"tends_to_maintain\", \"has_an_equal_and_opposite\", \"is_assumed_to_be\", \"are_assumed_to_be\",\n", " \"cannot_precede\", \"may_not_be\", \"tends_toward\", \"tends_to\", \"cannot_be\",\n", " \"affects_the_state_of\",\n", "\n", " # ========== TEMPORAL LOGIC AXIOMS ==========\n", " \"is_perceived_as\", \"separates\", \"is_immutable_and\", \"is_undetermined_and\", \"has_a\",\n", " \"then_Event_B_is_not_before\", \"is_the_measure_of\", \"has_no\",\n", "\n", " # ========== SPATIAL REASONING AXIOMS ==========\n", " \"is_the_three-dimensional_extent_in_which\", \"is_a_point_in\", \"occupies\", \"cannot_occupy\", \"separates\",\n", " \"is_spatially_constrained_by\", \"allows_for\", \"is_a_measure_of\", \"is_a_vector_from_a_point_to\", \"implies_one_object_is\",\n", "\n", " # ========== EPISTEMOLOGICAL AXIOMS ==========\n", " \"requires\", \"is_falsifiable_and\", \"is_not_necessarily\", \"is_a_necessary_condition_for\", \"is_a_primary_source_of\",\n", " \"is_useful_if_it\", \"is_generally_preferable_to\", \"is_a_reconstruction_of_the_past_and_is\", \"is_an_interpretation_of\", \"is_a_prerequisite_for\",\n", " \"is_the_absence_of\", \"requires\",\n", "\n", " # ========== LINGUISTIC & SEMANTIC AXIOMS ==========\n", " \"stands_for\", \"is_derived_from\", \"has_a_meaning_based_on\", \"has_a_meaning_based_on\", \"seeks\",\n", " \"expresses\", \"influences\", \"leads_to_multiple\",\n", "\n", " # ========== AGENT & INTENTIONALITY AXIOMS ==========\n", " \"can_possess\", \"is_typically_caused_by\", \"is_a_desired_future\", \"is_a_sequence_of_actions_to\", \"can_be_true_or_false_and_guides\",\n", " \"is_a_motivational_state_that\", \"is_choosing_actions_to\", \"is_the_agent's_process_of\", \"is_the_transfer_of\", \"involves_multiple_agents_working_towards\",\n", " \"lacks\", \"is_based_on_its\",\n", "\n", " # ========== ETHICAL & VALUATIVE AXIOMS ==========\n", " \"does_not_solely_determine\", \"prescribes\", \"are_objects_of\", \"involves_the_fair\", \"is_the_act_of\",\n", " \"is_the_avoidance_of\", \"is_the_capacity_of_an_agent_to\", \"is_an_entitlement_that_implies\", \"is_a_moral_obligation_to\", \"is_a_key_factor_in\",\n", " \"are_a_key_factor_in\", \"is_a_disposition_to\",\n", "\n", " # ========== SYSTEMIC & COMPLEXITY AXIOMS ==========\n", " \"is_a_set_of_interconnected\", \"separates_a_system_from\", \"exchanges_matter_or_energy_with\", \"has_properties_that_are_not_apparent_from\", \"tends_to_stabilize\",\n", " \"tends_to_amplify\", \"is_when_the_whole_system_exhibits_properties\", \"is_the_tendency_of_a_system_to\",\n", "\n", " # ========== MATHEMATICAL AXIOMS (Examples) ==========\n", " \"determine\", \"equals\", \"then\", \"is_a_subset_of\", \"have_different_cardinalities_unless\",\n", " \"never_intersect\", \"is_greater_than_or_equal_to\", \"has_a_successor\",\n", "\n", " # ========== COMMON SENSE/FOLK PHYSICS AXIOMS ==========\n", " \"will\", \"cannot_pass_through\", \"take_the_shape_of\", \"consumes_fuel_and_produces\", \"requires_more_force_to\",\n", " \"can_be_used_to\", \"requires_energy_to\", \"is_typically_not\", \"is_used_to\", \"connects\",\n", " \"acts_as_a\", \"originates_from\", \"is_the_absence_of\"\n", " ]\n", "\n", " tails = [\n", " # ========== LOGICAL & RATIONAL AXIOMS ==========\n", " \"True or False (Law of Excluded Middle)\", \"True and False simultaneously (Law of Non-Contradiction)\", \"the conclusion must be true\", \"the conclusion probable, but not certain\", \"itself (Law of Identity)\",\n", " \"False\", \"a contradiction (Principle of Explosion)\", \"holds (Transitivity)\", \"it is true 'for all x' (Universal Generalization)\", \"any specific object from the domain\",\n", " \"instance satisfying a property\", \"its properties or components\", \"True Premises and a Valid Structure\", \"assumes the conclusion in its premises\",\n", "\n", " # ========== METAPHYSICAL/ONTOLOGICAL AXIOMS ==========\n", " \"Non-existence (Something exists)\", \"Its constituent parts (Mereology)\", \"Properties\", \"a physical location\", \"a physical location and properties\",\n", " \"properties (Leibniz's Law)\", \"any of its proper parts\", \"multiple objects\", \"a transition from one state to another\", \"states of affairs\",\n", " \"become\", \"a potentiality\", \"could be true (is not impossible)\", \"must be true (could not be otherwise)\", \"is true, but could have been false\",\n", " \"Something\",\n", "\n", " # ========== CAUSAL & PHYSICAL AXIOMS ==========\n", " \"Cause\", \"Its Effect\", \"Circular in time\", \"at once\", \"Forces or fields\",\n", " \"Created or destroyed\", \"its state of motion (Inertia)\", \"Reaction\", \"governed by physical laws\", \"uniform across space and time\",\n", " \"its cause\", \"simultaneous for another observer\", \"a state of maximum entropy\", \"Increase or stay the same\", \"created from nothing\",\n", " \"the system being measured\",\n", "\n", " # ========== TEMPORAL LOGIC AXIOMS ==========\n", " \"moving in one direction\", \"the Past and the Future\", \"fixed\", \"open\", \"specific duration and location in time\",\n", " \"A\", \"change over an interval\", \"duration\",\n", "\n", " # ========== SPATIAL REASONING AXIOMS ==========\n", " \"objects exist and move\", \"space\", \"a volume of space\", \"the same volume of space at the same time\", \"an inside from an outside\",\n", " \"the container's boundaries\", \"movement between two points\", \"separation between two points\", \"another point\", \"within the other\",\n", "\n", " # ========== EPISTEMOLOGICAL AXIOMS ==========\n", " \"Justified True Belief\", \"supported by evidence\", \"the truth\", \"knowledge\", \"justification for beliefs about the world\",\n", " \"makes accurate and novel predictions\", \"a more complex one with the same explanatory power\", \"fallible\", \"sensory data\", \"rigorous inquiry\",\n", " \"reasonable doubt\", \"independent verification\",\n", "\n", " # ========== LINGUISTIC & SEMANTIC AXIOMS ==========\n", " \"a concept or object\", \"the meaning of its words and its grammatical structure\", \"its defined word meanings\", \"analogy and cultural context\", \"information\",\n", " \"an order\", \"the interpretation of a statement\", \"possible interpretations\",\n", "\n", " # ========== AGENT & INTENTIONALITY AXIOMS ==========\n", " \"Beliefs, Desires, and Intentions\", \"the agent's beliefs and desires\", \"state of the world\", \"achieve a goal\", \"an agent's actions\",\n", " \"motivates an agent's actions\", \"best satisfy its desires given its beliefs\", \"gathering information about the world\", \"meaning between agents\", \"a shared goal\",\n", " \"Intentions or Beliefs\", \"model of the world and its goals\",\n", "\n", " # ========== ETHICAL & VALUATIVE AXIOMS ==========\n", " \"an 'Ought' Statement (Is-Ought Gap)\", \"an action or state of affairs\", \"moral consideration\", \"distribution of goods, rights, and responsibilities\", \"promoting the well-being of others\",\n", " \"harming others\", \"make one's own choices\", \"a corresponding duty on others\", \"perform or refrain from an action\", \"evaluating the morality of an action\",\n", " \"evaluating the morality of an action\", \"act in a certain way (e.g., honesty, courage)\",\n", "\n", " # ========== SYSTEMIC & COMPLEXITY AXIOMS ==========\n", " \"parts that form a complex whole\", \"its environment\", \"its environment\", \"its individual components\", \"a system\",\n", " \"change in a system\", \"their parts alone do not have\", \"maintain a stable, constant condition\",\n", "\n", " # ========== MATHEMATICAL AXIOMS (Examples) ==========\n", " \"a unique straight line\", \"the original number\", \"x=z (Transitivity)\", \"every other set\", \"the set is empty\",\n", " \"in that plane\", \"any of its parts\", \"by adding one\",\n", "\n", " # ========== COMMON SENSE/FOLK PHYSICS AXIOMS ==========\n", " \"fall toward the ground\", \"each other\", \"their container\", \"heat and light\", \"move or lift\",\n", " \"cut or pierce other objects\", \"maintain homeostasis and reproduce\", \"conscious or aware\", \"achieve a specific purpose\", \"two locations\",\n", " \"barrier to entry\", \"a vibrating object\", \"light\"\n", " ]\n", "\n", " entry = []\n", " for x, y, z in zip(heads, relations, tails):\n", " entry.append({\"Head\":x, \"Relation\":y, \"Tail\":z})\n", "\n", " return entry\n", "\n", "def studyStrategiesDataMaker(entry):\n", " \"\"\"Study Strategies and Learning Methodology Knowledge Graph\"\"\"\n", " heads = [\n", " # ========== META-LEARNING & STUDY APPROACH ==========\n", " \"Learning Assessment Start\", \"Learning Assessment Start\", \"Learning Assessment Start\", \"Learning Assessment Start\",\n", " \"Identify Learning Style\", \"Identify Learning Style\", \"Identify Learning Style\", \"Identify Learning Style\",\n", " \"Set Learning Goals\", \"Set Learning Goals\", \"Set Learning Goals\", \"Set Learning Goals\", \"Set Learning Goals\",\n", " \"Choose Study Method\", \"Choose Study Method\", \"Choose Study Method\", \"Choose Study Method\",\n", " \"Monitor Learning Progress\", \"Monitor Learning Progress\", \"Monitor Learning Progress\",\n", " \"Adjust Study Strategy\", \"Adjust Study Strategy\", \"Adjust Study Strategy\", \"Adjust Study Strategy\",\n", "\n", " # ========== LEARNING STYLE IDENTIFICATION ==========\n", " \"Visual Learning Preference\", \"Visual Learning Preference\", \"Visual Learning Preference\", \"Visual Learning Preference\",\n", " \"Auditory Learning Preference\", \"Auditory Learning Preference\", \"Auditory Learning Preference\", \"Auditory Learning Preference\",\n", " \"Kinesthetic Learning Preference\", \"Kinesthetic Learning Preference\", \"Kinesthetic Learning Preference\", \"Kinesthetic Learning Preference\",\n", " \"Reading/Writing Learning Preference\", \"Reading/Writing Learning Preference\", \"Reading/Writing Learning Preference\",\n", " \"Sequential Learning Preference\", \"Sequential Learning Preference\", \"Sequential Learning Preference\",\n", " \"Global Learning Preference\", \"Global Learning Preference\", \"Global Learning Preference\",\n", "\n", " # ========== ACTIVE LEARNING STRATEGIES ==========\n", " \"Active Recall Techniques\", \"Active Recall Techniques\", \"Active Recall Techniques\", \"Active Recall Techniques\", \"Active Recall Techniques\",\n", " \"Spaced Repetition System\", \"Spaced Repetition System\", \"Spaced Repetition System\", \"Spaced Repetition System\", \"Spaced Repetition System\",\n", " \"Retrieval Practice\", \"Retrieval Practice\", \"Retrieval Practice\", \"Retrieval Practice\",\n", " \"Elaborative Interrogation\", \"Elaborative Interrogation\", \"Elaborative Interrogation\", \"Elaborative Interrogation\",\n", " \"Self-Explanation\", \"Self-Explanation\", \"Self-Explanation\", \"Self-Explanation\",\n", " \"Distributed Practice\", \"Distributed Practice\", \"Distributed Practice\", \"Distributed Practice\",\n", "\n", " # ========== COMPREHENSION STRATEGIES ==========\n", " \"Preview and Predict Strategy\", \"Preview and Predict Strategy\", \"Preview and Predict Strategy\",\n", " \"SQ3R Reading Method\", \"SQ3R Reading Method\", \"SQ3R Reading Method\", \"SQ3R Reading Method\",\n", " \"Cornell Note-Taking System\", \"Cornell Note-Taking System\", \"Cornell Note-Taking System\", \"Cornell Note-Taking System\",\n", " \"Mind Mapping Technique\", \"Mind Mapping Technique\", \"Mind Mapping Technique\", \"Mind Mapping Technique\",\n", " \"Concept Mapping\", \"Concept Mapping\", \"Concept Mapping\", \"Concept Mapping\",\n", " \"Summarization Strategies\", \"Summarization Strategies\", \"Summarization Strategies\", \"Summarization Strategies\",\n", "\n", " # ========== MEMORY ENHANCEMENT TECHNIQUES ==========\n", " \"Mnemonic Device Construction\", \"Mnemonic Device Construction\", \"Mnemonic Device Construction\", \"Mnemonic Device Construction\",\n", " \"Method of Loci\", \"Method of Loci\", \"Method of Loci\",\n", " \"Chunking Strategy\", \"Chunking Strategy\", \"Chunking Strategy\", \"Chunking Strategy\",\n", " \"Dual Coding Theory Application\", \"Dual Coding Theory Application\", \"Dual Coding Theory Application\",\n", " \"Keyword Method\", \"Keyword Method\", \"Keyword Method\",\n", " \"Pegword System\", \"Pegword System\", \"Pegword System\",\n", "\n", " # ========== TIME MANAGEMENT & SCHEDULING ==========\n", " \"Pomodoro Technique\", \"Pomodoro Technique\", \"Pomodoro Technique\", \"Pomodoro Technique\", \"Pomodoro Technique\",\n", " \"Time Blocking Method\", \"Time Blocking Method\", \"Time Blocking Method\", \"Time Blocking Method\",\n", " \"Priority Matrix (Eisenhower)\", \"Priority Matrix (Eisenhower)\", \"Priority Matrix (Eisenhower)\", \"Priority Matrix (Eisenhower)\",\n", " \"Backward Planning\", \"Backward Planning\", \"Backward Planning\", \"Backward Planning\",\n", " \"Buffer Time Allocation\", \"Buffer Time Allocation\", \"Buffer Time Allocation\",\n", " \"Energy Management\", \"Energy Management\", \"Energy Management\", \"Energy Management\",\n", "\n", " # ========== METACOGNITIVE STRATEGIES ==========\n", " \"Self-Monitoring Techniques\", \"Self-Monitoring Techniques\", \"Self-Monitoring Techniques\", \"Self-Monitoring Techniques\",\n", " \"Learning Strategy Evaluation\", \"Learning Strategy Evaluation\", \"Learning Strategy Evaluation\", \"Learning Strategy Evaluation\",\n", " \"Cognitive Load Management\", \"Cognitive Load Management\", \"Cognitive Load Management\", \"Cognitive Load Management\",\n", " \"Transfer of Learning\", \"Transfer of Learning\", \"Transfer of Learning\", \"Transfer of Learning\",\n", " \"Learning Reflection Protocol\", \"Learning Reflection Protocol\", \"Learning Reflection Protocol\",\n", " \"Error Analysis Methods\", \"Error Analysis Methods\", \"Error Analysis Methods\", \"Error Analysis Methods\",\n", "\n", " # ========== COLLABORATIVE LEARNING ==========\n", " \"Study Group Formation\", \"Study Group Formation\", \"Study Group Formation\", \"Study Group Formation\",\n", " \"Peer Teaching Strategies\", \"Peer Teaching Strategies\", \"Peer Teaching Strategies\", \"Peer Teaching Strategies\",\n", " \"Collaborative Note Sharing\", \"Collaborative Note Sharing\", \"Collaborative Note Sharing\",\n", " \"Group Problem Solving\", \"Group Problem Solving\", \"Group Problem Solving\", \"Group Problem Solving\",\n", " \"Peer Feedback Systems\", \"Peer Feedback Systems\", \"Peer Feedback Systems\",\n", " \"Academic Accountability Partners\", \"Academic Accountability Partners\", \"Academic Accountability Partners\",\n", "\n", " # ========== TECHNOLOGY-ENHANCED LEARNING ==========\n", " \"Digital Flashcard Systems\", \"Digital Flashcard Systems\", \"Digital Flashcard Systems\", \"Digital Flashcard Systems\",\n", " \"Learning Management Systems\", \"Learning Management Systems\", \"Learning Management Systems\",\n", " \"Educational Apps Integration\", \"Educational Apps Integration\", \"Educational Apps Integration\", \"Educational Apps Integration\",\n", " \"Online Research Strategies\", \"Online Research Strategies\", \"Online Research Strategies\", \"Online Research Strategies\",\n", " \"Digital Note Organization\", \"Digital Note Organization\", \"Digital Note Organization\", \"Digital Note Organization\",\n", " \"Virtual Study Environments\", \"Virtual Study Environments\", \"Virtual Study Environments\",\n", "\n", " # ========== STRESS MANAGEMENT & WELLNESS ==========\n", " \"Academic Stress Recognition\", \"Academic Stress Recognition\", \"Academic Stress Recognition\", \"Academic Stress Recognition\",\n", " \"Stress Reduction Techniques\", \"Stress Reduction Techniques\", \"Stress Reduction Techniques\", \"Stress Reduction Techniques\",\n", " \"Sleep Optimization for Learning\", \"Sleep Optimization for Learning\", \"Sleep Optimization for Learning\", \"Sleep Optimization for Learning\",\n", " \"Exercise and Cognitive Function\", \"Exercise and Cognitive Function\", \"Exercise and Cognitive Function\",\n", " \"Nutrition for Brain Health\", \"Nutrition for Brain Health\", \"Nutrition for Brain Health\",\n", " \"Mindfulness in Academic Settings\", \"Mindfulness in Academic Settings\", \"Mindfulness in Academic Settings\",\n", "\n", " # ========== TEST PREPARATION STRATEGIES ==========\n", " \"Exam Format Analysis\", \"Exam Format Analysis\", \"Exam Format Analysis\", \"Exam Format Analysis\",\n", " \"Practice Test Implementation\", \"Practice Test Implementation\", \"Practice Test Implementation\", \"Practice Test Implementation\",\n", " \"Test Anxiety Management\", \"Test Anxiety Management\", \"Test Anxiety Management\", \"Test Anxiety Management\",\n", " \"Strategic Guessing Techniques\", \"Strategic Guessing Techniques\", \"Strategic Guessing Techniques\",\n", " \"Time Management During Exams\", \"Time Management During Exams\", \"Time Management During Exams\", \"Time Management During Exams\",\n", " \"Post-Exam Analysis\", \"Post-Exam Analysis\", \"Post-Exam Analysis\", \"Post-Exam Analysis\"\n", " ]\n", "\n", " relations = [\n", " # ========== META-LEARNING & STUDY APPROACH ==========\n", " \"initial_step\", \"foundational_phase\", \"planning_phase\", \"implementation_phase\",\n", " \"action\", \"action\", \"determines\", \"guides\",\n", " \"action\", \"action\", \"action\", \"requires\", \"influences\",\n", " \"action\", \"action\", \"based_on\", \"guided_by\",\n", " \"action\", \"action\", \"continuous_process\",\n", " \"action\", \"action\", \"based_on_feedback\", \"iterative_process\",\n", "\n", " # ========== LEARNING STYLE IDENTIFICATION ==========\n", " \"prefers\", \"benefits_from\", \"optimal_for\", \"enhanced_by\",\n", " \"prefers\", \"benefits_from\", \"optimal_for\", \"enhanced_by\",\n", " \"prefers\", \"benefits_from\", \"optimal_for\", \"enhanced_by\",\n", " \"prefers\", \"benefits_from\", \"optimal_for\",\n", " \"prefers\", \"benefits_from\", \"optimal_for\",\n", " \"prefers\", \"benefits_from\", \"optimal_for\",\n", "\n", " # ========== ACTIVE LEARNING STRATEGIES ==========\n", " \"core_principle\", \"implementation_method\", \"effectiveness_factor\", \"memory_enhancement\", \"long_term_retention\",\n", " \"algorithm_for\", \"schedule_based_on\", \"optimizes\", \"prevents\", \"maximizes\",\n", " \"method_of\", \"improves\", \"strengthens\", \"application\",\n", " \"technique_for\", \"enhances\", \"promotes\", \"develops\",\n", " \"process_of\", \"improves\", \"facilitates\", \"strengthens\",\n", " \"principle_of\", \"combats\", \"optimizes\", \"enhances\",\n", "\n", " # ========== COMPREHENSION STRATEGIES ==========\n", " \"preparation_method\", \"activates\", \"improves\",\n", " \"systematic_approach\", \"structure_for\", \"comprehensive_method\", \"reading_strategy\",\n", " \"note_taking_system\", \"organizes\", \"facilitates\", \"structure_for\",\n", " \"visual_method\", \"represents\", \"organizes\", \"clarifies\",\n", " \"visual_tool\", \"shows\", \"illustrates\", \"maps\",\n", " \"comprehension_strategy\", \"condenses\", \"synthesizes\", \"reinforces\",\n", "\n", " # ========== MEMORY ENHANCEMENT TECHNIQUES ==========\n", " \"memory_aid\", \"utilizes\", \"creates\", \"enhances\",\n", " \"spatial_memory_technique\", \"ancient_method\", \"visualization_strategy\",\n", " \"cognitive_strategy\", \"reduces_load\", \"organizes\", \"simplifies\",\n", " \"combines\", \"verbal_and_visual\", \"maximizes_retention\",\n", " \"association_method\", \"connects\", \"facilitates\",\n", " \"numbered_system\", \"structured_approach\", \"memorization_tool\",\n", "\n", " # ========== TIME MANAGEMENT & SCHEDULING ==========\n", " \"time_management_method\", \"breaks_into\", \"maintains_focus\", \"prevents_burnout\", \"productivity_technique\",\n", " \"scheduling_method\", \"allocates\", \"structures\", \"dedicated_time\",\n", " \"prioritization_tool\", \"categorizes\", \"focuses_effort\", \"decision_framework\",\n", " \"planning_method\", \"starts_with\", \"works_backward\", \"deadline_oriented\",\n", " \"scheduling_practice\", \"accounts_for\", \"prevents_overcommitment\",\n", " \"optimization_approach\", \"aligns_with\", \"maximizes\", \"productivity_cycles\",\n", "\n", " # ========== METACOGNITIVE STRATEGIES ==========\n", " \"self_awareness_technique\", \"tracks\", \"identifies\", \"adjusts\",\n", " \"assessment_method\", \"determines\", \"measures\", \"guides_improvement\",\n", " \"cognitive_strategy\", \"manages\", \"optimizes\", \"prevents_overload\",\n", " \"learning_principle\", \"applies\", \"connects\", \"generalizes\",\n", " \"reflection_method\", \"analyzes\", \"identifies_growth\",\n", " \"diagnostic_approach\", \"identifies\", \"corrects\", \"prevents_repetition\",\n", "\n", " # ========== COLLABORATIVE LEARNING ==========\n", " \"social_learning\", \"organizes\", \"facilitates\", \"peer_interaction\",\n", " \"instructional_method\", \"develops\", \"reinforces\", \"peer_learning\",\n", " \"collaborative_tool\", \"distributes\", \"collective_knowledge\",\n", " \"group_strategy\", \"combines\", \"leverages\", \"diverse_perspectives\",\n", " \"assessment_method\", \"provides\", \"improves_quality\",\n", " \"support_system\", \"maintains\", \"mutual_accountability\",\n", "\n", " # ========== TECHNOLOGY-ENHANCED LEARNING ==========\n", " \"digital_tool\", \"automates\", \"tracks\", \"spaced_repetition\",\n", " \"platform_for\", \"centralizes\", \"organizes\",\n", " \"technology_integration\", \"enhances\", \"provides\", \"accessibility\",\n", " \"digital_literacy\", \"efficient\", \"credible\", \"source_evaluation\",\n", " \"organization_system\", \"synchronizes\", \"cloud_based\", \"accessible\",\n", " \"learning_space\", \"simulates\", \"provides_focus\",\n", "\n", " # ========== STRESS MANAGEMENT & WELLNESS ==========\n", " \"awareness_skill\", \"identifies\", \"early_warning\", \"intervention\",\n", " \"coping_strategy\", \"manages\", \"reduces\", \"academic_pressure\",\n", " \"health_practice\", \"enhances\", \"consolidates\", \"memory_formation\",\n", " \"wellness_factor\", \"improves\", \"cognitive_performance\",\n", " \"nutritional_strategy\", \"supports\", \"brain_function\",\n", " \"mental_practice\", \"reduces\", \"academic_stress\",\n", "\n", " # ========== TEST PREPARATION STRATEGIES ==========\n", " \"preparation_step\", \"identifies\", \"guides\", \"study_focus\",\n", " \"practice_method\", \"simulates\", \"builds\", \"test_familiarity\",\n", " \"psychological_strategy\", \"reduces\", \"maintains\", \"performance\",\n", " \"test_taking_skill\", \"maximizes\", \"probability_of_success\",\n", " \"time_strategy\", \"allocates\", \"prevents\", \"incomplete_responses\",\n", " \"improvement_method\", \"identifies\", \"prevents\", \"future_errors\"\n", " ]\n", "\n", " tails = [\n", " # ========== META-LEARNING & STUDY APPROACH ==========\n", " \"Identify Learning Style\", \"Set Learning Goals\", \"Choose Study Method\", \"Monitor Learning Progress\",\n", " \"Learning Style Assessment\", \"Preference Identification\", \"Study Method Selection\", \"Strategy Alignment\",\n", " \"SMART Goals Framework\", \"Learning Objectives\", \"Milestone Definition\", \"Outcome Specification\", \"Progress Metrics\",\n", " \"Active Learning Strategies\", \"Time Management Methods\", \"Learning Style Alignment\", \"Metacognitive Approach\",\n", " \"Progress Tracking\", \"Performance Assessment\", \"Strategy Effectiveness\",\n", " \"Strategy Modification\", \"Method Refinement\", \"Approach Optimization\", \"Continuous Improvement\",\n", "\n", " # ========== LEARNING STYLE IDENTIFICATION ==========\n", " \"Visual Aids and Diagrams\", \"Graphic Organizers\", \"Color Coding Systems\", \"Spatial Learning\",\n", " \"Lectures and Discussions\", \"Audio Recordings\", \"Verbal Repetition\", \"Musical Mnemonics\",\n", " \"Hands-on Activities\", \"Movement-based Learning\", \"Tactile Experiences\", \"Physical Manipulation\",\n", " \"Text-based Learning\", \"Written Summaries\", \"Note-taking Systems\",\n", " \"Step-by-step Progression\", \"Linear Organization\", \"Structured Approach\",\n", " \"Big Picture Understanding\", \"Conceptual Frameworks\", \"Holistic Perspective\",\n", "\n", " # ========== ACTIVE LEARNING STRATEGIES ==========\n", " \"Testing Effect\", \"Retrieval Practice\", \"Memory Strengthening\", \"Long-term Retention\", \"Active Engagement\",\n", " \"Forgetting Curve\", \"Optimal Intervals\", \"Memory Consolidation\", \"Cramming\", \"Retention Efficiency\",\n", " \"Memory Retrieval\", \"Recall Strength\", \"Neural Pathways\", \"Practice Testing\",\n", " \"Deep Understanding\", \"Critical Thinking\", \"Meaningful Learning\", \"Conceptual Connections\",\n", " \"Understanding Mechanisms\", \"Knowledge Integration\", \"Mental Models\", \"Comprehension\",\n", " \"Forgetting Curve\", \"Massed Practice\", \"Learning Efficiency\", \"Retention Rates\",\n", "\n", " # ========== COMPREHENSION STRATEGIES ==========\n", " \"Prior Knowledge\", \"Reading Comprehension\", \"Anticipation Skills\",\n", " \"Survey, Question, Read, Recite, Review\", \"Organized Reading\", \"Active Reading\", \"Systematic Approach\",\n", " \"Organized Notes\", \"Review System\", \"Information Hierarchy\", \"Active Learning\",\n", " \"Knowledge Relationships\", \"Information Hierarchy\", \"Complex Concepts\", \"Visual Learning\",\n", " \"Concept Relationships\", \"Knowledge Connections\", \"System Understanding\", \"Hierarchical Structure\",\n", " \"Key Information\", \"Main Ideas\", \"Understanding\", \"Memory Consolidation\",\n", "\n", " # ========== MEMORY ENHANCEMENT TECHNIQUES ==========\n", " \"Association Techniques\", \"Pattern Recognition\", \"Memory Associations\", \"Recall Improvement\",\n", " \"Spatial Memory\", \"Memory Palace\", \"Location-based Recall\",\n", " \"Information Processing\", \"Working Memory\", \"Information Units\", \"Cognitive Load\",\n", " \"Verbal and Visual Processing\", \"Memory Encoding\", \"Retention Enhancement\",\n", " \"New Information with Known\", \"Memory Retrieval\",\n", " \"Sequential Memory\", \"Ordered Recall\", \"List Learning\",\n", "\n", " # ========== TIME MANAGEMENT & SCHEDULING ==========\n", " \"Focused Work Sessions\", \"25-minute Intervals\", \"Attention Span\", \"Mental Fatigue\", \"Sustained Concentration\",\n", " \"Time Periods\", \"Daily Schedule\", \"Deep Work\", \"Specific Activities\",\n", " \"Tasks by Urgency\", \"On Important Tasks\", \"Decision Making\", \"Resource Allocation\",\n", " \"End Goal\", \"To Beginning\", \"Milestone Planning\",\n", " \"Unexpected Delays\", \"Schedule Overruns\",\n", " \"Natural Rhythms\", \"Peak Performance\", \"Circadian Cycles\",\n", "\n", " # ========== METACOGNITIVE STRATEGIES ==========\n", " \"Learning Progress\", \"Comprehension Gaps\", \"Strategy Effectiveness\", \"Learning Behavior\",\n", " \"Strategy Effectiveness\", \"Learning Outcomes\", \"Improvement Areas\", \"Strategic Adjustments\",\n", " \"Information Processing\", \"Learning Capacity\", \"Cognitive Overload\", \"Mental Resources\",\n", " \"Knowledge to New Contexts\", \"Previous Learning\", \"Skill Generalization\",\n", " \"Learning Experiences\", \"Areas for Growth\",\n", " \"Mistake Patterns\", \"Misconceptions\", \"Error Repetition\",\n", "\n", " # ========== COLLABORATIVE LEARNING ==========\n", " \"Effective Groups\", \"Shared Learning\", \"Peer Support\", \"Collective Knowledge\",\n", " \"Teaching Skills\", \"Understanding\", \"Peer Learning\", \"Knowledge Transfer\",\n", " \"Information\", \"Knowledge Base\",\n", " \"Multiple Perspectives\", \"Diverse Expertise\", \"Complex Problems\",\n", " \"Constructive Criticism\", \"Work Quality\",\n", " \"Motivation\", \"Goal Achievement\",\n", "\n", " # ========== TECHNOLOGY-ENHANCED LEARNING ==========\n", " \"Spaced Repetition\", \"Progress\", \"Review Scheduling\",\n", " \"Course Materials\", \"Academic Resources\",\n", " \"Learning Experience\", \"Interactive Tools\", \"Learning\",\n", " \"Information Literacy\", \"Source Evaluation\", \"Digital Research Skills\",\n", " \"Notes Across Devices\", \"Storage\", \"From Anywhere\",\n", " \"Distraction-free Learning\", \"Concentration\",\n", "\n", " # ========== STRESS MANAGEMENT & WELLNESS ==========\n", " \"Stress Signals\", \"Signs\", \"Points\",\n", " \"Anxiety\", \"Academic Stress\", \"Emotional Well-being\",\n", " \"Memory Consolidation\", \"Learning\", \"Sleep-dependent\",\n", " \"Focus\", \"Mental Clarity\",\n", " \"Cognitive Function\", \"Mental Performance\",\n", " \"Anxiety\", \"Improves Focus\",\n", "\n", " # ========== TEST PREPARATION STRATEGIES ==========\n", " \"Question Types\", \"Study Strategy\", \"Content Areas\",\n", " \"Exam Conditions\", \"Confidence\", \"Time Management Skills\",\n", " \"Test Anxiety\", \"Calm Performance\", \"Optimal Performance\",\n", " \"Score\", \"Correct Answers\",\n", " \"Time Effectively\", \"Rushing\", \"Time Pressure\",\n", " \"Mistakes\", \"Weaknesses\", \"Similar Errors\"\n", " ]\n", "\n", "\n", " for x, y, z in zip(heads, relations, tails):\n", " entry.append({\"Head\": x, \"Relation\": y, \"Tail\": z})\n", " return entry\n", "\n", "\n", "def researchMethodologyDataMaker(entry):\n", " \"\"\"Research Methodology Knowledge Graph\"\"\"\n", " heads = [\n", " # ========== RESEARCH PROCESS INITIATION ==========\n", " \"Research Process Start\", \"Research Process Start\", \"Research Process Start\", \"Research Process Start\",\n", " \"Research Question Formation\", \"Research Question Formation\", \"Research Question Formation\", \"Research Question Formation\",\n", " \"Literature Review Process\", \"Literature Review Process\", \"Literature Review Process\", \"Literature Review Process\",\n", " \"Research Design Selection\", \"Research Design Selection\", \"Research Design Selection\", \"Research Design Selection\",\n", " \"Methodology Framework\", \"Methodology Framework\", \"Methodology Framework\", \"Methodology Framework\",\n", "\n", " # ========== RESEARCH QUESTION DEVELOPMENT ==========\n", " \"Problem Identification\", \"Problem Identification\", \"Problem Identification\", \"Problem Identification\",\n", " \"Research Gap Analysis\", \"Research Gap Analysis\", \"Research Gap Analysis\", \"Research Gap Analysis\",\n", " \"Hypothesis Formation\", \"Hypothesis Formation\", \"Hypothesis Formation\", \"Hypothesis Formation\",\n", " \"Variable Definition\", \"Variable Definition\", \"Variable Definition\", \"Variable Definition\",\n", " \"Operational Definition\", \"Operational Definition\", \"Operational Definition\", \"Operational Definition\",\n", " \"Research Objectives\", \"Research Objectives\", \"Research Objectives\", \"Research Objectives\",\n", "\n", " # ========== QUANTITATIVE RESEARCH METHODS ==========\n", " \"Quantitative Research Design\", \"Quantitative Research Design\", \"Quantitative Research Design\", \"Quantitative Research Design\",\n", " \"Experimental Design\", \"Experimental Design\", \"Experimental Design\", \"Experimental Design\", \"Experimental Design\",\n", " \"Survey Research Methods\", \"Survey Research Methods\", \"Survey Research Methods\", \"Survey Research Methods\",\n", " \"Sampling Techniques\", \"Sampling Techniques\", \"Sampling Techniques\", \"Sampling Techniques\", \"Sampling Techniques\",\n", " \"Statistical Analysis Planning\", \"Statistical Analysis Planning\", \"Statistical Analysis Planning\", \"Statistical Analysis Planning\",\n", " \"Data Collection Protocols\", \"Data Collection Protocols\", \"Data Collection Protocols\", \"Data Collection Protocols\",\n", "\n", " # ========== QUALITATIVE RESEARCH METHODS ==========\n", " \"Qualitative Research Design\", \"Qualitative Research Design\", \"Qualitative Research Design\", \"Qualitative Research Design\",\n", " \"Ethnographic Methods\", \"Ethnographic Methods\", \"Ethnographic Methods\", \"Ethnographic Methods\",\n", " \"Case Study Methodology\", \"Case Study Methodology\", \"Case Study Methodology\", \"Case Study Methodology\",\n", " \"Interview Techniques\", \"Interview Techniques\", \"Interview Techniques\", \"Interview Techniques\", \"Interview Techniques\",\n", " \"Focus Group Methods\", \"Focus Group Methods\", \"Focus Group Methods\", \"Focus Group Methods\",\n", " \"Observational Research\", \"Observational Research\", \"Observational Research\", \"Observational Research\",\n", "\n", " # ========== MIXED METHODS RESEARCH ==========\n", " \"Mixed Methods Design\", \"Mixed Methods Design\", \"Mixed Methods Design\", \"Mixed Methods Design\",\n", " \"Sequential Explanatory Design\", \"Sequential Explanatory Design\", \"Sequential Explanatory Design\",\n", " \"Concurrent Triangulation\", \"Concurrent Triangulation\", \"Concurrent Triangulation\", \"Concurrent Triangulation\",\n", " \"Transformative Framework\", \"Transformative Framework\", \"Transformative Framework\",\n", " \"Integration Strategies\", \"Integration Strategies\", \"Integration Strategies\", \"Integration Strategies\",\n", "\n", " # ========== DATA ANALYSIS METHODS ==========\n", " \"Descriptive Statistics\", \"Descriptive Statistics\", \"Descriptive Statistics\", \"Descriptive Statistics\",\n", " \"Inferential Statistics\", \"Inferential Statistics\", \"Inferential Statistics\", \"Inferential Statistics\",\n", " \"Correlation Analysis\", \"Correlation Analysis\", \"Correlation Analysis\", \"Correlation Analysis\",\n", " \"Regression Analysis\", \"Regression Analysis\", \"Regression Analysis\", \"Regression Analysis\",\n", " \"Content Analysis\", \"Content Analysis\", \"Content Analysis\", \"Content Analysis\",\n", " \"Thematic Analysis\", \"Thematic Analysis\", \"Thematic Analysis\", \"Thematic Analysis\",\n", "\n", " # ========== RESEARCH VALIDITY & RELIABILITY ==========\n", " \"Internal Validity\", \"Internal Validity\", \"Internal Validity\", \"Internal Validity\",\n", " \"External Validity\", \"External Validity\", \"External Validity\", \"External Validity\",\n", " \"Construct Validity\", \"Construct Validity\", \"Construct Validity\", \"Construct Validity\",\n", " \"Reliability Testing\", \"Reliability Testing\", \"Reliability Testing\", \"Reliability Testing\",\n", " \"Trustworthiness Criteria\", \"Trustworthiness Criteria\", \"Trustworthiness Criteria\", \"Trustworthiness Criteria\",\n", " \"Bias Identification\", \"Bias Identification\", \"Bias Identification\", \"Bias Identification\",\n", "\n", " # ========== ETHICAL CONSIDERATIONS ==========\n", " \"Research Ethics Protocol\", \"Research Ethics Protocol\", \"Research Ethics Protocol\", \"Research Ethics Protocol\",\n", " \"Informed Consent Process\", \"Informed Consent Process\", \"Informed Consent Process\", \"Informed Consent Process\",\n", " \"Confidentiality Protection\", \"Confidentiality Protection\", \"Confidentiality Protection\", \"Confidentiality Protection\",\n", " \"Risk Assessment\", \"Risk Assessment\", \"Risk Assessment\", \"Risk Assessment\",\n", " \"IRB Approval Process\", \"IRB Approval Process\", \"IRB Approval Process\", \"IRB Approval Process\",\n", " \"Data Privacy Measures\", \"Data Privacy Measures\", \"Data Privacy Measures\", \"Data Privacy Measures\",\n", "\n", " # ========== RESEARCH TOOLS & INSTRUMENTS ==========\n", " \"Instrument Development\", \"Instrument Development\", \"Instrument Development\", \"Instrument Development\",\n", " \"Questionnaire Design\", \"Questionnaire Design\", \"Questionnaire Design\", \"Questionnaire Design\",\n", " \"Scale Construction\", \"Scale Construction\", \"Scale Construction\", \"Scale Construction\",\n", " \"Interview Guide Creation\", \"Interview Guide Creation\", \"Interview Guide Creation\", \"Interview Guide Creation\",\n", " \"Observation Protocols\", \"Observation Protocols\", \"Observation Protocols\", \"Observation Protocols\",\n", " \"Technology Integration\", \"Technology Integration\", \"Technology Integration\", \"Technology Integration\",\n", "\n", " # ========== RESEARCH DISSEMINATION ==========\n", " \"Academic Writing Process\", \"Academic Writing Process\", \"Academic Writing Process\", \"Academic Writing Process\",\n", " \"Peer Review System\", \"Peer Review System\", \"Peer Review System\", \"Peer Review System\",\n", " \"Conference Presentation\", \"Conference Presentation\", \"Conference Presentation\", \"Conference Presentation\",\n", " \"Publication Strategy\", \"Publication Strategy\", \"Publication Strategy\", \"Publication Strategy\",\n", " \"Knowledge Translation\", \"Knowledge Translation\", \"Knowledge Translation\", \"Knowledge Translation\",\n", " \"Research Impact Assessment\", \"Research Impact Assessment\", \"Research Impact Assessment\", \"Research Impact Assessment\"\n", " ]\n", "\n", " relations = [\n", " # ========== RESEARCH PROCESS INITIATION ==========\n", " \"initial_phase\", \"foundational_step\", \"systematic_approach\", \"academic_inquiry\",\n", " \"critical_step\", \"guides\", \"defines_scope\", \"shapes_methodology\",\n", " \"systematic_process\", \"builds_foundation\", \"identifies_context\", \"informs_design\",\n", " \"methodological_choice\", \"determines_approach\", \"guides_data_collection\", \"framework_selection\",\n", " \"theoretical_framework\", \"guides_inquiry\", \"shapes_analysis\", \"structures_approach\",\n", "\n", " # ========== RESEARCH QUESTION DEVELOPMENT ==========\n", " \"starting_point\", \"drives_inquiry\", \"defines_focus\", \"research_motivation\",\n", " \"systematic_review\", \"identifies_gaps\", \"reveals_opportunities\", \"informs_questions\",\n", " \"testable_prediction\", \"guides_methodology\", \"defines_expectations\", \"research_proposition\",\n", " \"conceptual_clarity\", \"operational_specification\", \"measurement_focus\", \"clear_definitions\",\n", " \"measurement_definition\", \"concrete_specification\", \"assessment_criteria\", \"clarity_enhancement\",\n", " \"goal_setting\", \"direction_providing\", \"outcome_specification\", \"research_aims\",\n", "\n", " # ========== QUANTITATIVE RESEARCH METHODS ==========\n", " \"numerical_approach\", \"statistical_analysis\", \"measurement_focus\", \"objective_methodology\",\n", " \"causal_investigation\", \"controlled_conditions\", \"variable_manipulation\", \"cause_effect\", \"rigorous_testing\",\n", " \"data_collection_method\", \"population_study\", \"standardized_measurement\", \"large_scale_inquiry\",\n", " \"representative_selection\", \"population_inference\", \"statistical_power\", \"generalizability\", \"sample_adequacy\",\n", " \"analytical_framework\", \"statistical_testing\", \"hypothesis_testing\", \"data_interpretation\",\n", " \"systematic_collection\", \"standardized_procedures\", \"measurement_protocols\", \"data_quality\",\n", "\n", " # ========== QUALITATIVE RESEARCH METHODS ==========\n", " \"interpretive_approach\", \"depth_understanding\", \"contextual_inquiry\", \"meaning_exploration\",\n", " \"cultural_immersion\", \"naturalistic_inquiry\", \"participant_observation\", \"deep_understanding\",\n", " \"detailed_investigation\", \"bounded_system\", \"comprehensive_analysis\", \"contextual_depth\",\n", " \"data_collection_method\", \"participant_perspectives\", \"rich_data\", \"depth_exploration\", \"personal_accounts\",\n", " \"group_dynamics\", \"collective_perspectives\", \"interactive_data\", \"social_contexts\",\n", " \"naturalistic_study\", \"behavioral_patterns\", \"context_understanding\", \"systematic_watching\",\n", "\n", " # ========== MIXED METHODS RESEARCH ==========\n", " \"combined_approach\", \"quantitative_qualitative\", \"comprehensive_understanding\", \"methodological_triangulation\",\n", " \"two_phase_design\", \"quantitative_first\", \"qualitative_explanation\",\n", " \"simultaneous_collection\", \"data_convergence\", \"validation_strategy\", \"comprehensive_analysis\",\n", " \"social_justice\", \"marginalized_voices\", \"empowerment_research\",\n", " \"data_combination\", \"result_synthesis\", \"comprehensive_interpretation\", \"holistic_understanding\",\n", "\n", " # ========== DATA ANALYSIS METHODS ==========\n", " \"summary_statistics\", \"data_description\", \"central_tendency\", \"variability_measures\",\n", " \"hypothesis_testing\", \"population_inference\", \"statistical_significance\", \"probability_analysis\",\n", " \"relationship_analysis\", \"variable_association\", \"strength_direction\", \"predictive_power\",\n", " \"predictive_modeling\", \"variable_relationships\", \"outcome_prediction\", \"explanatory_analysis\",\n", " \"systematic_categorization\", \"pattern_identification\", \"meaning_extraction\", \"qualitative_coding\",\n", " \"pattern_recognition\", \"theme_development\", \"interpretive_analysis\", \"meaning_construction\",\n", "\n", " # ========== RESEARCH VALIDITY & RELIABILITY ==========\n", " \"causal_inference\", \"confounding_control\", \"alternative_explanations\", \"study_design\",\n", " \"generalizability\", \"population_inference\", \"ecological_validity\", \"setting_transferability\",\n", " \"measurement_accuracy\", \"theoretical_alignment\", \"concept_representation\", \"instrument_validity\",\n", " \"consistency_measurement\", \"repeatability\", \"stability\", \"measurement_precision\",\n", " \"qualitative_rigor\", \"credibility_dependability\", \"confirmability_transferability\", \"research_quality\",\n", " \"systematic_error\", \"researcher_bias\", \"selection_bias\", \"measurement_bias\",\n", "\n", " # ========== ETHICAL CONSIDERATIONS ==========\n", " \"ethical_guidelines\", \"participant_protection\", \"research_integrity\", \"moral_standards\",\n", " \"voluntary_participation\", \"risk_disclosure\", \"participant_autonomy\", \"ethical_protection\",\n", " \"privacy_protection\", \"anonymity_measures\", \"data_security\", \"participant_rights\",\n", " \"harm_assessment\", \"benefit_analysis\", \"ethical_evaluation\", \"safety_measures\",\n", " \"institutional_approval\", \"ethical_review\", \"compliance_verification\", \"oversight_process\",\n", " \"information_security\", \"confidentiality_maintenance\", \"data_protection\", \"privacy_safeguards\",\n", "\n", " # ========== RESEARCH TOOLS & INSTRUMENTS ==========\n", " \"measurement_tool\", \"data_collection\", \"validity_reliability\", \"systematic_development\",\n", " \"survey_construction\", \"question_development\", \"response_options\", \"measurement_strategy\",\n", " \"psychometric_development\", \"item_generation\", \"factor_analysis\", \"reliability_testing\",\n", " \"structured_conversation\", \"question_sequence\", \"topic_coverage\", \"flexible_framework\",\n", " \"systematic_observation\", \"behavior_recording\", \"structured_watching\", \"data_collection_guide\",\n", " \"digital_tools\", \"data_management\", \"analysis_software\", \"research_enhancement\",\n", "\n", " # ========== RESEARCH DISSEMINATION ==========\n", " \"scholarly_communication\", \"research_reporting\", \"academic_publication\", \"knowledge_sharing\",\n", " \"quality_control\", \"expert_evaluation\", \"publication_standards\", \"academic_rigor\",\n", " \"research_presentation\", \"academic_community\", \"knowledge_exchange\", \"scholarly_discourse\",\n", " \"publishing_plan\", \"audience_targeting\", \"impact_maximization\", \"dissemination_strategy\",\n", " \"practical_application\", \"research_utilization\", \"policy_practice\", \"real_world_impact\",\n", " \"citation_analysis\", \"research_influence\", \"academic_contribution\", \"scholarly_impact\"\n", " ]\n", "\n", " tails = [\n", " # ========== RESEARCH PROCESS INITIATION ==========\n", " \"Research Question Formation\", \"Literature Review Process\", \"Research Design Selection\", \"Methodology Framework\",\n", " \"Research Question Development\", \"Study Focus\", \"Research Scope\", \"Inquiry Direction\",\n", " \"Knowledge Base\", \"Theoretical Foundation\", \"Research Context\", \"Methodological Guidance\",\n", " \"Quantitative or Qualitative Methods\", \"Data Collection Strategy\", \"Analysis Plan\", \"Research Framework\",\n", " \"Research Structure\", \"Theoretical Perspective\", \"Data Analysis\", \"Research Approach\",\n", "\n", " # ========== RESEARCH QUESTION DEVELOPMENT ==========\n", " \"Research Focus\", \"Investigation Direction\", \"Study Purpose\", \"Academic Investigation\",\n", " \"Knowledge Gaps\", \"Research Opportunities\", \"Study Rationale\", \"Research Questions\",\n", " \"Research Hypothesis\", \"Study Design\", \"Expected Outcomes\", \"Theoretical Predictions\",\n", " \"Variable Identification\", \"Measurement Strategy\", \"Research Focus\", \"Operational Clarity\",\n", " \"Assessment Methods\", \"Research Measurement\", \"Data Collection\", \"Research Precision\",\n", " \"Research Direction\", \"Study Outcomes\", \"Research Purpose\", \"Investigation Goals\",\n", "\n", " # ========== QUANTITATIVE RESEARCH METHODS ==========\n", " \"Statistical Methods\", \"Numerical Data\", \"Measurement Instruments\", \"Objective Research\",\n", " \"Variable Control\", \"Random Assignment\", \"Independent Variable\", \"Dependent Variable\", \"Causal Conclusions\",\n", " \"Survey Instruments\", \"Population Sampling\", \"Data Collection\", \"Respondent Information\",\n", " \"Random Sampling\", \"Stratified Sampling\", \"Cluster Sampling\", \"Sample Size\", \"Population Representation\",\n", " \"Statistical Tests\", \"Data Analysis\", \"Research Conclusions\", \"Evidence-based Findings\",\n", " \"Data Gathering\", \"Measurement Procedures\", \"Research Instruments\", \"Information Collection\",\n", "\n", " # ========== QUALITATIVE RESEARCH METHODS ==========\n", " \"In-depth Understanding\", \"Contextual Knowledge\", \"Participant Perspectives\", \"Rich Description\",\n", " \"Cultural Understanding\", \"Social Context\", \"Participant Behavior\", \"Naturalistic Settings\",\n", " \"Single Case\", \"Multiple Cases\", \"Phenomenon Investigation\", \"Comprehensive Study\",\n", " \"Interview Data\", \"Personal Narratives\", \"Lived Experiences\", \"Participant Stories\", \"Detailed Accounts\",\n", " \"Group Interaction\", \"Social Dynamics\", \"Collective Views\", \"Shared Experiences\",\n", " \"Field Notes\", \"Behavior Documentation\", \"Environmental Context\", \"Natural Settings\",\n", "\n", " # ========== MIXED METHODS RESEARCH ==========\n", " \"Quantitative and Qualitative Data\", \"Research Integration\", \"Comprehensive Analysis\", \"Multiple Perspectives\",\n", " \"Quantitative Analysis\", \"Qualitative Follow-up\", \"Result Explanation\",\n", " \"Data Validation\", \"Multiple Data Sources\", \"Research Convergence\", \"Finding Confirmation\",\n", " \"Marginalized Populations\", \"Community Voices\", \"Participatory Research\",\n", " \"Quantitative-Qualitative Synthesis\", \"Meta-inferences\", \"Integrated Results\", \"Holistic Findings\",\n", "\n", " # ========== DATA ANALYSIS METHODS ==========\n", " \"Mean, Median, Mode\", \"Standard Deviation\", \"Frequency Distributions\", \"Data Summarization\",\n", " \"t-tests, ANOVA, Chi-square\", \"Confidence Intervals\", \"P-values\", \"Statistical Conclusions\",\n", " \"Pearson, Spearman Correlation\", \"Relationship Strength\", \"Variable Association\", \"Linear Relationships\",\n", " \"Linear, Multiple Regression\", \"Prediction Models\", \"Variable Influence\", \"Outcome Explanation\",\n", " \"Coding Schemes\", \"Category Development\", \"Text Analysis\", \"Meaning Units\",\n", " \"Code Development\", \"Theme Construction\", \"Data Interpretation\", \"Narrative Analysis\",\n", "\n", " # ========== RESEARCH VALIDITY & RELIABILITY ==========\n", " \"Study Design\", \"Confounding Variables\", \"Causal Claims\", \"Research Conclusions\",\n", " \"Population Validity\", \"Setting Generalization\", \"Sample Representativeness\", \"Ecological Validity\",\n", " \"Measurement Quality\", \"Test Validity\", \"Content Validity\", \"Criterion Validity\",\n", " \"Test-retest Reliability\", \"Internal Consistency\", \"Inter-rater Reliability\", \"Measurement Stability\",\n", " \"Credibility\", \"Dependability\", \"Confirmability\", \"Transferability\",\n", " \"Confounding Factors\", \"Selection Effects\", \"Measurement Error\", \"Researcher Influence\",\n", "\n", " # ========== ETHICAL CONSIDERATIONS ==========\n", " \"Participant Welfare\", \"Research Standards\", \"Professional Ethics\", \"Human Subjects Protection\",\n", " \"Informed Decision Making\", \"Risk Understanding\", \"Participant Rights\", \"Voluntary Participation\",\n", " \"Data Protection\", \"Participant Identity\", \"Information Security\", \"Ethical Data Handling\",\n", " \"Participant Safety\", \"Risk-Benefit Analysis\", \"Harm Prevention\", \"Ethical Assessment\",\n", " \"Ethics Committee Review\", \"Research Approval\", \"Regulatory Compliance\", \"Ethical Oversight\",\n", " \"Data Anonymization\", \"Secure Storage\", \"Access Control\", \"Privacy Protection\",\n", "\n", " # ========== RESEARCH TOOLS & INSTRUMENTS ==========\n", " \"Valid Measures\", \"Reliable Instruments\", \"Data Quality\", \"Measurement Development\",\n", " \"Clear Questions\", \"Response Scales\", \"Survey Layout\", \"Data Collection Efficiency\",\n", " \"Reliable Measures\", \"Valid Instruments\", \"Statistical Analysis\", \"Measurement Properties\",\n", " \"Open-ended Questions\", \"Probing Questions\", \"Interview Flow\", \"Data Collection Structure\",\n", " \"Observation Checklist\", \"Field Notes\", \"Systematic Recording\", \"Behavioral Documentation\",\n", " \"Research Software\", \"Online Surveys\", \"Data Analysis Tools\", \"Research Efficiency\",\n", "\n", " # ========== RESEARCH DISSEMINATION ==========\n", " \"Research Manuscripts\", \"Academic Papers\", \"Scholarly Publications\", \"Knowledge Contribution\",\n", " \"Publication Quality\", \"Research Standards\", \"Academic Credibility\", \"Scholar Evaluation\",\n", " \"Academic Conferences\", \"Professional Networks\", \"Research Community\", \"Knowledge Exchange\",\n", " \"Journal Selection\", \"Publication Timing\", \"Research Visibility\", \"Academic Impact\",\n", " \"Policy Applications\", \"Practical Implementation\", \"Community Benefits\", \"Social Impact\",\n", " \"Research Metrics\", \"Citation Counts\", \"Academic Influence\", \"Scholarly Contribution\"\n", " ]\n", "\n", "\n", " for x, y, z in zip(heads, relations, tails):\n", " entry.append({\"Head\": x, \"Relation\": y, \"Tail\": z})\n", " return entry\n", "\n", "\n", "def academicWritingDataMaker(entry):\n", " \"\"\"Academic Writing and Critical Thinking Knowledge Graph\"\"\"\n", " heads = [\n", " # ========== ACADEMIC WRITING PROCESS ==========\n", " \"Academic Writing Start\", \"Academic Writing Start\", \"Academic Writing Start\", \"Academic Writing Start\",\n", " \"Pre-writing Strategies\", \"Pre-writing Strategies\", \"Pre-writing Strategies\", \"Pre-writing Strategies\",\n", " \"Thesis Development\", \"Thesis Development\", \"Thesis Development\", \"Thesis Development\", \"Thesis Development\",\n", " \"Outline Construction\", \"Outline Construction\", \"Outline Construction\", \"Outline Construction\",\n", " \"Draft Writing Process\", \"Draft Writing Process\", \"Draft Writing Process\", \"Draft Writing Process\",\n", " \"Revision Strategies\", \"Revision Strategies\", \"Revision Strategies\", \"Revision Strategies\",\n", "\n", " # ========== CRITICAL THINKING FOUNDATIONS ==========\n", " \"Critical Thinking Framework\", \"Critical Thinking Framework\", \"Critical Thinking Framework\", \"Critical Thinking Framework\",\n", " \"Argument Analysis\", \"Argument Analysis\", \"Argument Analysis\", \"Argument Analysis\", \"Argument Analysis\",\n", " \"Evidence Evaluation\", \"Evidence Evaluation\", \"Evidence Evaluation\", \"Evidence Evaluation\",\n", " \"Logical Reasoning\", \"Logical Reasoning\", \"Logical Reasoning\", \"Logical Reasoning\",\n", " \"Cognitive Bias Recognition\", \"Cognitive Bias Recognition\", \"Cognitive Bias Recognition\", \"Cognitive Bias Recognition\",\n", " \"Perspective Taking\", \"Perspective Taking\", \"Perspective Taking\", \"Perspective Taking\",\n", "\n", " # ========== ARGUMENT CONSTRUCTION ==========\n", " \"Claim Formation\", \"Claim Formation\", \"Claim Formation\", \"Claim Formation\",\n", " \"Evidence Integration\", \"Evidence Integration\", \"Evidence Integration\", \"Evidence Integration\", \"Evidence Integration\",\n", " \"Warrant Establishment\", \"Warrant Establishment\", \"Warrant Establishment\", \"Warrant Establishment\",\n", " \"Counterargument Development\", \"Counterargument Development\", \"Counterargument Development\", \"Counterargument Development\",\n", " \"Rebuttal Strategies\", \"Rebuttal Strategies\", \"Rebuttal Strategies\", \"Rebuttal Strategies\",\n", " \"Logical Fallacy Avoidance\", \"Logical Fallacy Avoidance\", \"Logical Fallacy Avoidance\", \"Logical Fallacy Avoidance\",\n", "\n", " # ========== RESEARCH AND CITATION ==========\n", " \"Source Identification\", \"Source Identification\", \"Source Identification\", \"Source Identification\",\n", " \"Source Credibility Assessment\", \"Source Credibility Assessment\", \"Source Credibility Assessment\", \"Source Credibility Assessment\",\n", " \"Citation Integration\", \"Citation Integration\", \"Citation Integration\", \"Citation Integration\", \"Citation Integration\",\n", " \"Paraphrasing Techniques\", \"Paraphrasing Techniques\", \"Paraphrasing Techniques\", \"Paraphrasing Techniques\",\n", " \"Synthesis Writing\", \"Synthesis Writing\", \"Synthesis Writing\", \"Synthesis Writing\",\n", " \"Plagiarism Prevention\", \"Plagiarism Prevention\", \"Plagiarism Prevention\", \"Plagiarism Prevention\",\n", "\n", " # ========== ACADEMIC GENRES ==========\n", " \"Expository Writing\", \"Expository Writing\", \"Expository Writing\", \"Expository Writing\",\n", " \"Argumentative Essay\", \"Argumentative Essay\", \"Argumentative Essay\", \"Argumentative Essay\",\n", " \"Research Paper\", \"Research Paper\", \"Research Paper\", \"Research Paper\", \"Research Paper\",\n", " \"Literature Review\", \"Literature Review\", \"Literature Review\", \"Literature Review\",\n", " \"Case Study Analysis\", \"Case Study Analysis\", \"Case Study Analysis\", \"Case Study Analysis\",\n", " \"Reflective Writing\", \"Reflective Writing\", \"Reflective Writing\", \"Reflective Writing\",\n", "\n", " # ========== LANGUAGE AND STYLE ==========\n", " \"Academic Register\", \"Academic Register\", \"Academic Register\", \"Academic Register\",\n", " \"Clarity and Precision\", \"Clarity and Precision\", \"Clarity and Precision\", \"Clarity and Precision\",\n", " \"Conciseness Strategies\", \"Conciseness Strategies\", \"Conciseness Strategies\", \"Conciseness Strategies\",\n", " \"Coherence Development\", \"Coherence Development\", \"Coherence Development\", \"Coherence Development\",\n", " \"Cohesion Techniques\", \"Cohesion Techniques\", \"Cohesion Techniques\", \"Cohesion Techniques\",\n", " \"Voice and Tone\", \"Voice and Tone\", \"Voice and Tone\", \"Voice and Tone\",\n", "\n", " # ========== STRUCTURE AND ORGANIZATION ==========\n", " \"Introduction Strategies\", \"Introduction Strategies\", \"Introduction Strategies\", \"Introduction Strategies\",\n", " \"Body Paragraph Development\", \"Body Paragraph Development\", \"Body Paragraph Development\", \"Body Paragraph Development\",\n", " \"Transition Techniques\", \"Transition Techniques\", \"Transition Techniques\", \"Transition Techniques\",\n", " \"Conclusion Strategies\", \"Conclusion Strategies\", \"Conclusion Strategies\", \"Conclusion Strategies\",\n", " \"Paragraph Unity\", \"Paragraph Unity\", \"Paragraph Unity\", \"Paragraph Unity\",\n", " \"Essay Unity\", \"Essay Unity\", \"Essay Unity\", \"Essay Unity\",\n", "\n", " # ========== EDITING AND PROOFREADING ==========\n", " \"Content Revision\", \"Content Revision\", \"Content Revision\", \"Content Revision\",\n", " \"Structural Editing\", \"Structural Editing\", \"Structural Editing\", \"Structural Editing\",\n", " \"Line Editing\", \"Line Editing\", \"Line Editing\", \"Line Editing\",\n", " \"Copy Editing\", \"Copy Editing\", \"Copy Editing\", \"Copy Editing\",\n", " \"Proofreading Process\", \"Proofreading Process\", \"Proofreading Process\", \"Proofreading Process\",\n", " \"Peer Review Process\", \"Peer Review Process\", \"Peer Review Process\", \"Peer Review Process\",\n", "\n", " # ========== RHETORICAL STRATEGIES ==========\n", " \"Audience Analysis\", \"Audience Analysis\", \"Audience Analysis\", \"Audience Analysis\",\n", " \"Purpose Clarification\", \"Purpose Clarification\", \"Purpose Clarification\", \"Purpose Clarification\",\n", " \"Rhetorical Appeals\", \"Rhetorical Appeals\", \"Rhetorical Appeals\", \"Rhetorical Appeals\", \"Rhetorical Appeals\",\n", " \"Rhetorical Situation\", \"Rhetorical Situation\", \"Rhetorical Situation\", \"Rhetorical Situation\",\n", " \"Persuasive Strategies\", \"Persuasive Strategies\", \"Persuasive Strategies\", \"Persuasive Strategies\",\n", " \"Genre Conventions\", \"Genre Conventions\", \"Genre Conventions\", \"Genre Conventions\",\n", "\n", " # ========== METACOGNITIVE WRITING STRATEGIES ==========\n", " \"Writing Process Awareness\", \"Writing Process Awareness\", \"Writing Process Awareness\", \"Writing Process Awareness\",\n", " \"Strategy Selection\", \"Strategy Selection\", \"Strategy Selection\", \"Strategy Selection\",\n", " \"Self-Assessment\", \"Self-Assessment\", \"Self-Assessment\", \"Self-Assessment\",\n", " \"Goal Setting for Writing\", \"Goal Setting for Writing\", \"Goal Setting for Writing\", \"Goal Setting for Writing\",\n", " \"Writing Reflection\", \"Writing Reflection\", \"Writing Reflection\", \"Writing Reflection\",\n", " \"Transfer of Writing Skills\", \"Transfer of Writing Skills\", \"Transfer of Writing Skills\", \"Transfer of Writing Skills\"\n", " ]\n", "\n", " relations = [\n", " # ========== ACADEMIC WRITING PROCESS ==========\n", " \"initial_phase\", \"planning_stage\", \"systematic_approach\", \"composition_process\",\n", " \"preparation_strategy\", \"planning_technique\", \"idea_generation\", \"organization_method\",\n", " \"central_argument\", \"main_claim\", \"position_statement\", \"argumentative_focus\", \"guiding_principle\",\n", " \"organizational_tool\", \"structural_framework\", \"planning_document\", \"logical_arrangement\",\n", " \"composition_phase\", \"writing_stage\", \"content_creation\", \"text_production\",\n", " \"improvement_process\", \"refinement_strategy\", \"enhancement_technique\", \"quality_improvement\",\n", "\n", " # ========== CRITICAL THINKING FOUNDATIONS ==========\n", " \"intellectual_skill\", \"analytical_thinking\", \"evaluative_reasoning\", \"systematic_inquiry\",\n", " \"reasoning_analysis\", \"logical_evaluation\", \"claim_assessment\", \"evidence_examination\", \"validity_testing\",\n", " \"credibility_assessment\", \"reliability_testing\", \"source_evaluation\", \"quality_judgment\",\n", " \"deductive_reasoning\", \"inductive_reasoning\", \"logical_structure\", \"valid_reasoning\",\n", " \"awareness_strategy\", \"bias_identification\", \"self_reflection\", \"thinking_improvement\",\n", " \"empathy_skill\", \"viewpoint_consideration\", \"multiple_perspectives\", \"understanding_others\",\n", "\n", " # ========== ARGUMENT CONSTRUCTION ==========\n", " \"assertion_development\", \"position_statement\", \"thesis_formation\", \"central_claim\",\n", " \"support_strategy\", \"proof_incorporation\", \"data_inclusion\", \"credibility_enhancement\", \"persuasion_technique\",\n", " \"connection_building\", \"assumption_identification\", \"logical_bridge\", \"reasoning_foundation\",\n", " \"opposition_acknowledgment\", \"alternative_viewpoint\", \"balanced_argument\", \"comprehensive_analysis\",\n", " \"response_strategy\", \"counterargument_refutation\", \"defense_technique\", \"argument_strengthening\",\n", " \"error_prevention\", \"logical_accuracy\", \"reasoning_quality\", \"argument_validity\",\n", "\n", " # ========== RESEARCH AND CITATION ==========\n", " \"information_gathering\", \"resource_location\", \"evidence_collection\", \"research_strategy\",\n", " \"reliability_evaluation\", \"authority_assessment\", \"bias_detection\", \"quality_analysis\",\n", " \"source_incorporation\", \"textual_evidence\", \"supporting_material\", \"credibility_building\", \"academic_integrity\",\n", " \"rewriting_strategy\", \"source_integration\", \"plagiarism_avoidance\", \"original_expression\",\n", " \"source_combination\", \"multiple_perspective\", \"comprehensive_analysis\", \"integrated_argument\",\n", " \"academic_integrity\", \"originality_maintenance\", \"proper_attribution\", \"ethical_writing\",\n", "\n", " # ========== ACADEMIC GENRES ==========\n", " \"informative_writing\", \"explanatory_text\", \"knowledge_presentation\", \"educational_discourse\",\n", " \"persuasive_writing\", \"position_argument\", \"claim_defense\", \"opinion_support\",\n", " \"scholarly_investigation\", \"systematic_inquiry\", \"evidence_based\", \"academic_contribution\", \"original_research\",\n", " \"synthesis_writing\", \"source_analysis\", \"field_overview\", \"scholarly_conversation\",\n", " \"situational_analysis\", \"problem_examination\", \"detailed_investigation\", \"applied_research\",\n", " \"personal_analysis\", \"experiential_learning\", \"self_examination\", \"growth_documentation\",\n", "\n", " # ========== LANGUAGE AND STYLE ==========\n", " \"formal_language\", \"scholarly_discourse\", \"professional_communication\", \"academic_conventions\",\n", " \"clear_communication\", \"exact_expression\", \"unambiguous_language\", \"effective_writing\",\n", " \"efficient_expression\", \"wordiness_elimination\", \"direct_communication\", \"economy_of_language\",\n", " \"logical_flow\", \"idea_connection\", \"unified_discourse\", \"meaningful_progression\",\n", " \"textual_unity\", \"linguistic_connection\", \"smooth_transitions\", \"integrated_text\",\n", " \"authorial_presence\", \"appropriate_register\", \"consistent_perspective\", \"professional_tone\",\n", "\n", " # ========== STRUCTURE AND ORGANIZATION ==========\n", " \"opening_technique\", \"reader_engagement\", \"context_establishment\", \"thesis_presentation\",\n", " \"content_organization\", \"idea_development\", \"evidence_presentation\", \"logical_progression\",\n", " \"connection_technique\", \"flow_enhancement\", \"coherence_building\", \"smooth_progression\",\n", " \"closing_strategy\", \"synthesis_technique\", \"significance_emphasis\", \"memorable_ending\",\n", " \"focused_development\", \"single_idea\", \"coherent_content\", \"clear_purpose\",\n", " \"overall_coherence\", \"integrated_argument\", \"consistent_theme\", \"unified_purpose\",\n", "\n", " # ========== EDITING AND PROOFREADING ==========\n", " \"substantive_revision\", \"argument_improvement\", \"content_enhancement\", \"major_changes\",\n", " \"organizational_revision\", \"logical_flow\", \"coherence_improvement\", \"structure_refinement\",\n", " \"sentence_revision\", \"clarity_improvement\", \"style_enhancement\", \"readability_improvement\",\n", " \"mechanical_correction\", \"grammar_accuracy\", \"punctuation_precision\", \"format_consistency\",\n", " \"error_elimination\", \"accuracy_verification\", \"final_polish\", \"publication_readiness\",\n", " \"collaborative_improvement\", \"external_feedback\", \"quality_assurance\", \"perspective_gaining\",\n", "\n", " # ========== RHETORICAL STRATEGIES ==========\n", " \"reader_consideration\", \"audience_awareness\", \"communication_strategy\", \"targeted_writing\",\n", " \"goal_identification\", \"intention_clarification\", \"writing_objective\", \"desired_outcome\",\n", " \"persuasive_technique\", \"ethos_pathos_logos\", \"credibility_emotion_logic\", \"rhetorical_triangle\", \"influence_strategy\",\n", " \"contextual_analysis\", \"communication_context\", \"situational_awareness\", \"rhetorical_context\",\n", " \"influence_technique\", \"convincing_strategy\", \"persuasion_method\", \"audience_motivation\",\n", " \"format_expectations\", \"disciplinary_standards\", \"writing_norms\", \"academic_traditions\",\n", "\n", " # ========== METACOGNITIVE WRITING STRATEGIES ==========\n", " \"self_knowledge\", \"process_understanding\", \"strategy_awareness\", \"reflection_skill\",\n", " \"method_choice\", \"technique_selection\", \"approach_decision\", \"strategic_thinking\",\n", " \"quality_evaluation\", \"progress_monitoring\", \"performance_assessment\", \"improvement_identification\",\n", " \"objective_setting\", \"target_establishment\", \"purpose_clarification\", \"outcome_planning\",\n", " \"process_analysis\", \"learning_evaluation\", \"growth_assessment\", \"skill_development\",\n", " \"skill_application\", \"knowledge_generalization\", \"context_adaptation\", \"learning_transfer\"\n", " ]\n", "\n", " tails = [\n", " # ========== ACADEMIC WRITING PROCESS ==========\n", " \"Pre-writing Strategies\", \"Thesis Development\", \"Outline Construction\", \"Draft Writing\",\n", " \"Brainstorming\", \"Topic Analysis\", \"Research Planning\", \"Idea Organization\",\n", " \"Central Argument\", \"Position Statement\", \"Claim Formulation\", \"Research Question\", \"Writing Focus\",\n", " \"Hierarchical Structure\", \"Essay Framework\", \"Paragraph Organization\", \"Logical Sequence\",\n", " \"First Draft\", \"Content Development\", \"Idea Expression\", \"Initial Composition\",\n", " \"Content Improvement\", \"Structural Enhancement\", \"Style Refinement\", \"Quality Assurance\",\n", "\n", " # ========== CRITICAL THINKING FOUNDATIONS ==========\n", " \"Analytical Skills\", \"Evaluation Abilities\", \"Reasoning Capacity\", \"Intellectual Rigor\",\n", " \"Premise Identification\", \"Conclusion Assessment\", \"Logic Evaluation\", \"Reasoning Patterns\", \"Validity Testing\",\n", " \"Source Quality\", \"Evidence Strength\", \"Credibility Factors\", \"Reliability Indicators\",\n", " \"Valid Conclusions\", \"Sound Arguments\", \"Logical Consistency\", \"Reasoning Accuracy\",\n", " \"Confirmation Bias\", \"Availability Heuristic\", \"Anchoring Bias\", \"Critical Awareness\",\n", " \"Alternative Viewpoints\", \"Cultural Perspectives\", \"Diverse Opinions\", \"Empathetic Understanding\",\n", "\n", " # ========== ARGUMENT CONSTRUCTION ==========\n", " \"Thesis Statement\", \"Central Assertion\", \"Main Argument\", \"Position Declaration\",\n", " \"Supporting Evidence\", \"Credible Sources\", \"Statistical Data\", \"Expert Testimony\", \"Logical Support\",\n", " \"Logical Connection\", \"Underlying Assumptions\", \"Reasoning Bridge\", \"Implicit Claims\",\n", " \"Opposing Views\", \"Alternative Positions\", \"Competing Arguments\", \"Critical Perspectives\",\n", " \"Counterargument Response\", \"Refutation Strategies\", \"Defensive Arguments\", \"Position Reinforcement\",\n", " \"Ad Hominem\", \"Straw Man\", \"False Dichotomy\", \"Logical Errors\",\n", "\n", " # ========== RESEARCH AND CITATION ==========\n", " \"Primary Sources\", \"Secondary Sources\", \"Scholarly Articles\", \"Credible Information\",\n", " \"Author Expertise\", \"Publication Quality\", \"Bias Assessment\", \"Source Reliability\",\n", " \"In-text Citations\", \"Signal Phrases\", \"Quote Integration\", \"Reference Documentation\", \"Academic Honesty\",\n", " \"Original Language\", \"Author's Ideas\", \"Source Material\", \"Accurate Representation\",\n", " \"Multiple Sources\", \"Integrated Analysis\", \"Comparative Perspectives\", \"Unified Argument\",\n", " \"Original Work\", \"Proper Attribution\", \"Citation Accuracy\", \"Academic Ethics\",\n", "\n", " # ========== ACADEMIC GENRES ==========\n", " \"Clear Explanation\", \"Informative Content\", \"Knowledge Transfer\", \"Educational Writing\",\n", " \"Persuasive Position\", \"Convincing Arguments\", \"Position Defense\", \"Advocacy Writing\",\n", " \"Original Investigation\", \"Systematic Study\", \"Evidence-based Analysis\", \"Scholarly Contribution\", \"Academic Discovery\",\n", " \"Source Synthesis\", \"Literature Analysis\", \"Field Overview\", \"Research Summary\",\n", " \"Situation Analysis\", \"Problem-solving\", \"Applied Analysis\", \"Real-world Application\",\n", " \"Personal Growth\", \"Learning Analysis\", \"Self-awareness\", \"Experiential Learning\",\n", "\n", " # ========== LANGUAGE AND STYLE ==========\n", " \"Professional Language\", \"Scholarly Tone\", \"Academic Vocabulary\", \"Formal Expression\",\n", " \"Exact Meaning\", \"Unambiguous Expression\", \"Reader Understanding\", \"Communication Clarity\",\n", " \"Focused Writing\", \"Essential Information\", \"Economic Expression\", \"Direct Communication\",\n", " \"Unified Ideas\", \"Connected Thoughts\", \"Flowing Discourse\", \"Logical Progression\",\n", " \"Connected Text\", \"Smooth Flow\", \"Unified Writing\", \"Integrated Expression\",\n", " \"Appropriate Tone\", \"Consistent Style\", \"Professional Voice\", \"Academic Persona\",\n", "\n", " # ========== STRUCTURE AND ORGANIZATION ==========\n", " \"Hook Techniques\", \"Context Setting\", \"Thesis Presentation\", \"Reader Engagement\",\n", " \"Topic Sentences\", \"Supporting Details\", \"Evidence Integration\", \"Conclusion Statements\",\n", " \"Logical Connections\", \"Smooth Flow\", \"Coherent Progression\", \"Clear Relationships\",\n", " \"Synthesis Techniques\", \"Final Thoughts\", \"Lasting Impression\", \"Effective Closure\",\n", " \"Single Focus\", \"Coherent Development\", \"Clear Purpose\", \"Unified Content\",\n", " \"Consistent Theme\", \"Integrated Argument\", \"Unified Purpose\", \"Coherent Whole\",\n", "\n", " # ========== EDITING AND PROOFREADING ==========\n", " \"Argument Strength\", \"Content Quality\", \"Logical Consistency\", \"Evidence Adequacy\",\n", " \"Organization Clarity\", \"Flow Improvement\", \"Structural Coherence\", \"Logical Arrangement\",\n", " \"Sentence Clarity\", \"Style Consistency\", \"Readability Enhancement\", \"Expression Quality\",\n", " \"Grammar Accuracy\", \"Punctuation Correctness\", \"Spelling Accuracy\", \"Format Compliance\",\n", " \"Error-free Text\", \"Publication Quality\", \"Professional Presentation\", \"Final Polish\",\n", " \"External Perspective\", \"Constructive Feedback\", \"Quality Improvement\", \"Objective Assessment\",\n", "\n", " # ========== RHETORICAL STRATEGIES ==========\n", " \"Reader Needs\", \"Audience Expectations\", \"Communication Goals\", \"Targeted Approach\",\n", " \"Writing Objectives\", \"Communication Goals\", \"Intended Outcomes\", \"Clear Purpose\",\n", " \"Ethos (Credibility)\", \"Pathos (Emotion)\", \"Logos (Logic)\", \"Rhetorical Triangle\", \"Persuasive Power\",\n", " \"Communication Context\", \"Situational Factors\", \"Rhetorical Environment\", \"Writing Situation\",\n", " \"Audience Motivation\", \"Convincing Techniques\", \"Influence Methods\", \"Persuasive Power\",\n", " \"Disciplinary Expectations\", \"Format Requirements\", \"Style Guidelines\", \"Academic Standards\",\n", "\n", " # ========== METACOGNITIVE WRITING STRATEGIES ==========\n", " \"Process Knowledge\", \"Strategy Awareness\", \"Skill Recognition\", \"Writing Understanding\",\n", " \"Appropriate Methods\", \"Effective Techniques\", \"Strategic Choices\", \"Optimal Approaches\",\n", " \"Writing Quality\", \"Progress Assessment\", \"Skill Evaluation\", \"Improvement Areas\",\n", " \"Clear Objectives\", \"Achievable Targets\", \"Writing Goals\", \"Desired Outcomes\",\n", " \"Process Evaluation\", \"Learning Insights\", \"Growth Recognition\", \"Skill Development\",\n", " \"Skill Generalization\", \"Context Adaptation\", \"Knowledge Application\", \"Learning Transfer\"\n", " ]\n", "\n", "\n", " for x, y, z in zip(heads, relations, tails):\n", " entry.append({\"Head\": x, \"Relation\": y, \"Tail\": z})\n", " return entry\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "id": "bDN1y84kabs9", "outputId": "d7e1db07-dc7a-4b3c-cdac-0943f288c0f6" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\ndataset = dataMaker2()\\nstudyStrategiesDataMaker(dataset)\\nacademicWritingDataMaker(dataset)\\nresearchMethodologyDataMaker(dataset)\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 16 } ], "source": [ "'''\n", "dataset = dataMaker2()\n", "studyStrategiesDataMaker(dataset)\n", "academicWritingDataMaker(dataset)\n", "researchMethodologyDataMaker(dataset)\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cellView": "form", "id": "2L-RwKUCyCwL" }, "outputs": [], "source": [ "# @title Datamaker\n", "def dataMaker3():\n", " heads = [\n", " \"Hannah\",\n", "\n", " ]\n", " relation = [\n", " \"My creator\"\n", "\n", " ]\n", "\n", " tails = [\n", " \"You\"\n", " ]\n", " entry = []\n", " for x, y, z in zip(heads, relations, tails):\n", " entry.append({\"Head\":x, \"Relation\":y, \"Tail\":z})\n", "\n", " return entry" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "9Djf3yX5FLCN" }, "outputs": [], "source": [ "def clean(string):\n", " replacements = {\n", " \"^\": \"_power_\",\n", " \"*\": \"_multiply_\",\n", " \"/\": \"_divide_\",\n", " \"=\": \"_equals_\",\n", " \"+\": \"_plus_\",\n", " \"-\": \"_minus_\",\n", " \"(\": \"_open_\",\n", " \")\": \"_close_\",\n", " \"|\": \"_abs_\",\n", " \"[\": \"_bracket_open_\",\n", " \"]\": \"_bracket_close_\",\n", " \"{\": \"_brace_open_\",\n", " \"}\": \"_brace_close_\",\n", " \"<\": \"_less_\",\n", " \">\": \"_greater_\",\n", " \"!\": \"_factorial_\",\n", " \"?\": \"_question_\",\n", " \"#\": \"_hash_\",\n", " \"%\": \"_percent_\",\n", " \"&\": \"_and_\",\n", " \"@\": \"_at_\",\n", " \"$\": \"_dollar_\",\n", " \"\\\\\": \"_backslash_\",\n", " \":\": \"_colon_\",\n", " \";\": \"_semicolon_\",\n", " \",\": \"_comma_\",\n", " \".\": \"_dot_\"\n", " }\n", "\n", " string = string.replace(\" \",\"_\")\n", " string = string.replace(\" \", \"_\")\n", "\n", " for key, value in replacements.items():\n", " string = string.replace(key, value)\n", "\n", " return string" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 104 }, "collapsed": true, "id": "F3W08PfOzq3F", "outputId": "8036c8de-99f2-4020-9898-4be6f20fecd0" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nelyos = Graph()\\n\\n#dataset = dataMaker2()\\nfor x in dataset:\\n head = x[\"Head\"]\\n relation = x[\"Relation\"]\\n tail = x[\"Tail\"]\\n\\n headx = clean(head)\\n tailx = clean(tail)\\n relationx = clean(relation)\\n\\n headRef = URIRef(\"http://example.com/\"+headx)\\n tailRef = URIRef(\"http://example.com/\"+tailx)\\n relationRef = URIRef(\"http://example.com/\"+relationx)\\n\\n\\n elyos.add((headRef, RDFS.label, Literal(head, datatype=XSD.string)))\\n elyos.add((tailRef, RDFS.label, Literal(tail, datatype=XSD.string)))\\n #elyos.add((relationRef, RDFS.label, Literal(relation, datatype=XSD.string)))\\n\\n\\n elyos.add((headRef, relationRef, tailRef))\\n\\n\\n print(elyos.serialize(format=\"turtle\"))\\n\\nrdf_file_path = \\'math_graph.rdf\\'\\nelyos.serialize(destination=rdf_file_path, format=\\'turtle\\')\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 19 } ], "source": [ "'''\n", "elyos = Graph()\n", "\n", "#dataset = dataMaker2()\n", "for x in dataset:\n", " head = x[\"Head\"]\n", " relation = x[\"Relation\"]\n", " tail = x[\"Tail\"]\n", "\n", " headx = clean(head)\n", " tailx = clean(tail)\n", " relationx = clean(relation)\n", "\n", " headRef = URIRef(\"http://example.com/\"+headx)\n", " tailRef = URIRef(\"http://example.com/\"+tailx)\n", " relationRef = URIRef(\"http://example.com/\"+relationx)\n", "\n", "\n", " elyos.add((headRef, RDFS.label, Literal(head, datatype=XSD.string)))\n", " elyos.add((tailRef, RDFS.label, Literal(tail, datatype=XSD.string)))\n", " #elyos.add((relationRef, RDFS.label, Literal(relation, datatype=XSD.string)))\n", "\n", "\n", " elyos.add((headRef, relationRef, tailRef))\n", "\n", "\n", " print(elyos.serialize(format=\"turtle\"))\n", "\n", "rdf_file_path = 'math_graph.rdf'\n", "elyos.serialize(destination=rdf_file_path, format='turtle')\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 70 }, "id": "l2YObjPOTIFf", "outputId": "80819995-bca1-48c8-b073-053624372539" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nprint(type(elyos))\\n\\n# If it\\'s an RDFLib graph, you should be able to iterate through its triples\\nif hasattr(elyos, \\'triples\\'):\\n # Print a few triples to verify the structure\\n for s, p, o in list(elyos.triples((None, None, None)))[:5]:\\n print(f\"Subject: {s}, Predicate: {p}, Object: {o}\")\\nelse:\\n print(\"This doesn\\'t appear to be an RDFLib graph\")\\n '" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 20 } ], "source": [ "# Check the type of elyos\n", "'''\n", "print(type(elyos))\n", "\n", "# If it's an RDFLib graph, you should be able to iterate through its triples\n", "if hasattr(elyos, 'triples'):\n", " # Print a few triples to verify the structure\n", " for s, p, o in list(elyos.triples((None, None, None)))[:5]:\n", " print(f\"Subject: {s}, Predicate: {p}, Object: {o}\")\n", "else:\n", " print(\"This doesn't appear to be an RDFLib graph\")\n", " '''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "V_Q4Z_HI4poH", "outputId": "a609c6b0-45e5-4c87-f4ee-5f1a70368c35" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Collecting pythreejs\n", " Downloading pythreejs-2.4.2-py3-none-any.whl.metadata (5.4 kB)\n", "Requirement already satisfied: ipywidgets>=7.2.1 in /usr/local/lib/python3.12/dist-packages (from pythreejs) (7.7.1)\n", "Collecting ipydatawidgets>=1.1.1 (from pythreejs)\n", " Downloading ipydatawidgets-4.3.5-py2.py3-none-any.whl.metadata (1.4 kB)\n", "Requirement already satisfied: numpy in /usr/local/lib/python3.12/dist-packages (from pythreejs) (2.0.2)\n", "Requirement already satisfied: traitlets in /usr/local/lib/python3.12/dist-packages (from pythreejs) (5.7.1)\n", "Requirement already satisfied: traittypes>=0.2.0 in /usr/local/lib/python3.12/dist-packages (from ipydatawidgets>=1.1.1->pythreejs) (0.2.3)\n", "Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.2.1->pythreejs) (6.17.1)\n", "Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.2.1->pythreejs) (0.2.0)\n", "Requirement already satisfied: widgetsnbextension~=3.6.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.2.1->pythreejs) (3.6.10)\n", "Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.2.1->pythreejs) (7.34.0)\n", "Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.12/dist-packages (from ipywidgets>=7.2.1->pythreejs) (3.0.16)\n", "Requirement already satisfied: debugpy>=1.0 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (1.8.15)\n", "Requirement already satisfied: jupyter-client>=6.1.12 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (7.4.9)\n", "Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (0.2.2)\n", "Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (1.6.0)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (26.2)\n", "Requirement already satisfied: psutil in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (5.9.5)\n", "Requirement already satisfied: pyzmq>=17 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (26.2.1)\n", "Requirement already satisfied: tornado>=6.1 in /usr/local/lib/python3.12/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (6.5.1)\n", "Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (75.2.0)\n", "Requirement already satisfied: jedi>=0.16 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (0.20.0)\n", "Requirement already satisfied: decorator in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (4.4.2)\n", "Requirement already satisfied: pickleshare in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (0.7.5)\n", "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (3.0.52)\n", "Requirement already satisfied: pygments in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (2.20.0)\n", "Requirement already satisfied: backcall in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (0.2.0)\n", "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.12/dist-packages (from ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (4.9.0)\n", "Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.12/dist-packages (from widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (6.5.7)\n", "Requirement already satisfied: parso<0.9.0,>=0.8.6 in /usr/local/lib/python3.12/dist-packages (from jedi>=0.16->ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (0.8.7)\n", "Requirement already satisfied: entrypoints in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (0.4)\n", "Requirement already satisfied: jupyter-core>=4.9.2 in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (5.9.1)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.12/dist-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (2.9.0.post0)\n", "Requirement already satisfied: jinja2 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (3.1.6)\n", "Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (25.1.0)\n", "Requirement already satisfied: nbformat in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (5.10.4)\n", "Requirement already satisfied: nbconvert>=5 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (7.17.1)\n", "Requirement already satisfied: Send2Trash>=1.8.0 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (2.1.0)\n", "Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.18.1)\n", "Requirement already satisfied: prometheus-client in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.25.0)\n", "Requirement already satisfied: nbclassic>=0.4.7 in /usr/local/lib/python3.12/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.3.3)\n", "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.12/dist-packages (from pexpect>4.3->ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (0.7.0)\n", "Requirement already satisfied: wcwidth in /usr/local/lib/python3.12/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets>=7.2.1->pythreejs) (0.7.0)\n", "Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.12/dist-packages (from jupyter-core>=4.9.2->jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (4.9.6)\n", "Requirement already satisfied: notebook-shim>=0.2.3 in /usr/local/lib/python3.12/dist-packages (from nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.2.4)\n", "Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (4.13.5)\n", "Requirement already satisfied: bleach!=5.0.0 in /usr/local/lib/python3.12/dist-packages (from bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (6.3.0)\n", "Requirement already satisfied: defusedxml in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.7.1)\n", "Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.3.0)\n", "Requirement already satisfied: markupsafe>=2.0 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (3.0.3)\n", "Requirement already satisfied: mistune<4,>=2.0.3 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (3.2.1)\n", "Requirement already satisfied: nbclient>=0.5.0 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.10.4)\n", "Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.12/dist-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.5.1)\n", "Requirement already satisfied: fastjsonschema>=2.15 in /usr/local/lib/python3.12/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (2.21.2)\n", "Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.12/dist-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (4.26.0)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.12/dist-packages (from python-dateutil>=2.8.2->jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets>=7.2.1->pythreejs) (1.17.0)\n", "Requirement already satisfied: argon2-cffi-bindings in /usr/local/lib/python3.12/dist-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (25.1.0)\n", "Requirement already satisfied: webencodings in /usr/local/lib/python3.12/dist-packages (from bleach!=5.0.0->bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.5.1)\n", "Requirement already satisfied: tinycss2<1.5,>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from bleach[css]!=5.0.0->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.4.0)\n", "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (26.1.0)\n", "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (2025.9.1)\n", "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.37.0)\n", "Requirement already satisfied: rpds-py>=0.25.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema>=2.6->nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.30.0)\n", "Requirement already satisfied: jupyter-server<3,>=1.8 in /usr/local/lib/python3.12/dist-packages (from notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (2.14.0)\n", "Requirement already satisfied: cffi>=1.0.1 in /usr/local/lib/python3.12/dist-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (2.0.0)\n", "Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.12/dist-packages (from beautifulsoup4->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (2.8.3)\n", "Requirement already satisfied: typing-extensions>=4.0.0 in /usr/local/lib/python3.12/dist-packages (from beautifulsoup4->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (4.15.0)\n", "Requirement already satisfied: pycparser in /usr/local/lib/python3.12/dist-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (3.0)\n", "Requirement already satisfied: anyio>=3.1.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (4.13.0)\n", "Requirement already satisfied: jupyter-events>=0.9.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.12.1)\n", "Requirement already satisfied: jupyter-server-terminals>=0.4.4 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.5.4)\n", "Requirement already satisfied: overrides>=5.0 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (7.7.0)\n", "Requirement already satisfied: websocket-client>=1.7 in /usr/local/lib/python3.12/dist-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.9.0)\n", "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.12/dist-packages (from anyio>=3.1.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (3.15)\n", "Requirement already satisfied: python-json-logger>=2.0.4 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (4.1.0)\n", "Requirement already satisfied: pyyaml>=5.3 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (6.0.3)\n", "Requirement already satisfied: rfc3339-validator in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.1.4)\n", "Requirement already satisfied: rfc3986-validator>=0.1.1 in /usr/local/lib/python3.12/dist-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (0.1.1)\n", "Requirement already satisfied: fqdn in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.5.1)\n", "Requirement already satisfied: isoduration in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (20.11.0)\n", "Requirement already satisfied: jsonpointer>1.13 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (3.1.1)\n", "Requirement already satisfied: rfc3987-syntax>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.1.0)\n", "Requirement already satisfied: uri-template in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.3.0)\n", "Requirement already satisfied: webcolors>=24.6.0 in /usr/local/lib/python3.12/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (25.10.0)\n", "Requirement already satisfied: lark>=1.2.2 in /usr/local/lib/python3.12/dist-packages (from rfc3987-syntax>=1.1.0->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.3.1)\n", "Requirement already satisfied: arrow>=0.15.0 in /usr/local/lib/python3.12/dist-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (1.4.0)\n", "Requirement already satisfied: tzdata in /usr/local/lib/python3.12/dist-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.2.1->pythreejs) (2026.2)\n", "Downloading pythreejs-2.4.2-py3-none-any.whl (3.4 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.4/3.4 MB\u001b[0m \u001b[31m40.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading ipydatawidgets-4.3.5-py2.py3-none-any.whl (271 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m271.7/271.7 kB\u001b[0m \u001b[31m10.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: ipydatawidgets, pythreejs\n", "Successfully installed ipydatawidgets-4.3.5 pythreejs-2.4.2\n" ] } ], "source": [ "!pip install pythreejs" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "D1b1FUMm_A31", "colab": { "base_uri": "https://localhost:8080/", "height": 52 }, "outputId": "f3f1af0f-e9e8-4866-bbdf-a0ca950bb9e3" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "\"\\ndef rdflib_to_networkx_graph2(rdf_graph):\\n nx_graph = nx.MultiDiGraph() # Use MultiDiGraph to handle multiple edges\\n for subject, predicate, obj in rdf_graph:\\n if isinstance(obj, URIRef):\\n nx_graph.add_edge(str(subject), str(obj), relation=str(predicate)) # Add 'relation' attribute\\n return nx_graph\\n\\n \"" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 22 } ], "source": [ "import networkx as nx\n", "from rdflib import URIRef\n", "'''\n", "def rdflib_to_networkx_graph2(rdf_graph):\n", " nx_graph = nx.MultiDiGraph() # Use MultiDiGraph to handle multiple edges\n", " for subject, predicate, obj in rdf_graph:\n", " if isinstance(obj, URIRef):\n", " nx_graph.add_edge(str(subject), str(obj), relation=str(predicate)) # Add 'relation' attribute\n", " return nx_graph\n", "\n", " '''\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "r5UrCH-09-Ib", "colab": { "base_uri": "https://localhost:8080/", "height": 87 }, "outputId": "4837f179-5aa0-4ab9-a4da-cf942ae9d558" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nfrom rdflib.extras.external_graph_libs import rdflib_to_networkx_graph\\nimport random\\nimport pythreejs as p3j\\n\\nring = rdflib_to_networkx_graph2(elyos) #graph itself\\n\\npos=nx.spring_layout(ring) #graph layout\\nprint(type(ring))\\nringNodes = list(ring.nodes())\\n\\ng3d = {} #coordinates of each node, search by the node itself\\ng3dEdge = []\\nfor node in ring.nodes():\\n x, y = pos[node] #coordinates of this node\\n z = random.randrange(0, 100, 2)\\n g3d[node] = (x, y, z)\\nprint(type(g3dEdge))\\nfor edge in ring.edges(data=True):\\n node1 = edge[0]\\n node2 = edge[1]\\n g3dEdge.append([g3d[node1], g3d[node2]])\\n\\n\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 23 } ], "source": [ "'''\n", "from rdflib.extras.external_graph_libs import rdflib_to_networkx_graph\n", "import random\n", "import pythreejs as p3j\n", "\n", "ring = rdflib_to_networkx_graph2(elyos) #graph itself\n", "\n", "pos=nx.spring_layout(ring) #graph layout\n", "print(type(ring))\n", "ringNodes = list(ring.nodes())\n", "\n", "g3d = {} #coordinates of each node, search by the node itself\n", "g3dEdge = []\n", "for node in ring.nodes():\n", " x, y = pos[node] #coordinates of this node\n", " z = random.randrange(0, 100, 2)\n", " g3d[node] = (x, y, z)\n", "print(type(g3dEdge))\n", "for edge in ring.edges(data=True):\n", " node1 = edge[0]\n", " node2 = edge[1]\n", " g3dEdge.append([g3d[node1], g3d[node2]])\n", "\n", "\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "EgakQdz77imu" }, "outputs": [], "source": [ "from google.colab import output\n", "output.enable_custom_widget_manager()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "HTkhQibC_QAg", "colab": { "base_uri": "https://localhost:8080/", "height": 122 }, "outputId": "f1af6485-d312-448f-e65e-794314c66602" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nimport plotly.graph_objects as go\\nimport numpy as np\\n\\nx_coords = []\\ny_coords = []\\nz_coords = []\\n\\nxEdge = []\\nyEdge = []\\nzEdge = []\\n\\nnewG3d = {}\\n\\nfor node in ring.nodes():\\n x, y = pos[node]\\n z = 30 + 20 * np.sin(x * 5) * np.cos(y * 5)\\n\\n x_coords.append(x)\\n y_coords.append(y)\\n z_coords.append(z)\\n\\n newG3d[node] = (x, y, z)\\n\\nfor edge in ring.edges(data=True):\\n node1 = edge[0]\\n node2 = edge[1]\\n\\n x0, y0, z0 = newG3d[node1]\\n x1, y1, z1 = newG3d[node2]\\n\\n xEdge.extend([x0, x1, None])\\n yEdge.extend([y0, y1, None])\\n zEdge.extend([z0, z1, None])\\n\\n\\nhover_texts = []\\nfor node_uri in ringNodes:\\n name = node_uri.split(\\'.com/\\')\\n name = name[1]\\n degree = ring.degree[node_uri]\\n hover_text = f\"Node: {name}
Degree: {degree}\"\\n hover_texts.append(hover_text)\\n\\nfig = go.Figure(data=[\\n go.Scatter3d(\\n x=x_coords,\\n y=y_coords,\\n z=z_coords,\\n mode=\\'markers\\',\\n marker=dict(\\n size=8,\\n color=z_coords, # Color by z-position\\n colorscale=\\'Viridis\\',\\n opacity=0.8\\n ),\\n text=hover_texts,\\n hoverinfo=\\'text\\',\\n name=\\'Knowledge Graph Nodes\\'\\n )\\n])\\n\\nfig.add_trace(go.Scatter3d(\\n x=xEdge,\\n y=yEdge,\\n z=zEdge,\\n mode=\\'lines\\',\\n line=dict(color=\\'pink\\', width=0.5),\\n hoverinfo=\\'skip\\', # Don\\'t show hover for edges\\n showlegend=False,\\n name=\\'connections\\'\\n))\\n\\nfig.update_layout(\\n title=\"3D Knowledge Graph (500+ Nodes)\",\\n scene=dict(\\n xaxis=dict(visible=False),\\n yaxis=dict(visible=False),\\n zaxis=dict(visible=False),\\n bgcolor=\\'black\\'\\n ),\\n width=900,\\n height=900\\n)\\n\\nfig.show()\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 25 } ], "source": [ "#@title Example Graph\n", "'''\n", "import plotly.graph_objects as go\n", "import numpy as np\n", "\n", "x_coords = []\n", "y_coords = []\n", "z_coords = []\n", "\n", "xEdge = []\n", "yEdge = []\n", "zEdge = []\n", "\n", "newG3d = {}\n", "\n", "for node in ring.nodes():\n", " x, y = pos[node]\n", " z = 30 + 20 * np.sin(x * 5) * np.cos(y * 5)\n", "\n", " x_coords.append(x)\n", " y_coords.append(y)\n", " z_coords.append(z)\n", "\n", " newG3d[node] = (x, y, z)\n", "\n", "for edge in ring.edges(data=True):\n", " node1 = edge[0]\n", " node2 = edge[1]\n", "\n", " x0, y0, z0 = newG3d[node1]\n", " x1, y1, z1 = newG3d[node2]\n", "\n", " xEdge.extend([x0, x1, None])\n", " yEdge.extend([y0, y1, None])\n", " zEdge.extend([z0, z1, None])\n", "\n", "\n", "hover_texts = []\n", "for node_uri in ringNodes:\n", " name = node_uri.split('.com/')\n", " name = name[1]\n", " degree = ring.degree[node_uri]\n", " hover_text = f\"Node: {name}
Degree: {degree}\"\n", " hover_texts.append(hover_text)\n", "\n", "fig = go.Figure(data=[\n", " go.Scatter3d(\n", " x=x_coords,\n", " y=y_coords,\n", " z=z_coords,\n", " mode='markers',\n", " marker=dict(\n", " size=8,\n", " color=z_coords, # Color by z-position\n", " colorscale='Viridis',\n", " opacity=0.8\n", " ),\n", " text=hover_texts,\n", " hoverinfo='text',\n", " name='Knowledge Graph Nodes'\n", " )\n", "])\n", "\n", "fig.add_trace(go.Scatter3d(\n", " x=xEdge,\n", " y=yEdge,\n", " z=zEdge,\n", " mode='lines',\n", " line=dict(color='pink', width=0.5),\n", " hoverinfo='skip', # Don't show hover for edges\n", " showlegend=False,\n", " name='connections'\n", "))\n", "\n", "fig.update_layout(\n", " title=\"3D Knowledge Graph (500+ Nodes)\",\n", " scene=dict(\n", " xaxis=dict(visible=False),\n", " yaxis=dict(visible=False),\n", " zaxis=dict(visible=False),\n", " bgcolor='black'\n", " ),\n", " width=900,\n", " height=900\n", ")\n", "\n", "fig.show()\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "EQLbjlZ73IGo" }, "outputs": [], "source": [ "from smolagents import Tool" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "bDON-dp5PXxX", "colab": { "base_uri": "https://localhost:8080/", "height": 52 }, "outputId": "15288234-d601-4c7e-b78d-17da3baa337d" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\ndata = dataMaker2()\\nstudyStrategiesDataMaker(data)\\nacademicWritingDataMaker(data)\\nresearchMethodologyDataMaker(data)\\ngraph = GraphCreation(data)\\n\\ntype(graph)\\ngraph = graph.forward()\\n\\nprint(graph)\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 27 } ], "source": [ "'''\n", "data = dataMaker2()\n", "studyStrategiesDataMaker(data)\n", "academicWritingDataMaker(data)\n", "researchMethodologyDataMaker(data)\n", "graph = GraphCreation(data)\n", "\n", "type(graph)\n", "graph = graph.forward()\n", "\n", "print(graph)\n", "'''" ] }, { "cell_type": "markdown", "metadata": { "id": "y6GPSbCD7imy" }, "source": [ "Support for third party widgets will remain active for the duration of the session. To disable support:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "u53i9t18Ormv" }, "outputs": [], "source": [ "def query(query, graph):\n", " try:\n", " results = graph.query(query)\n", " g = results.serialize(format=\"json\")\n", " return g\n", " except Exception as e:\n", " print(e)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "gYzRanxrzw0K" }, "outputs": [], "source": [ "import json\n", "import ast\n", "\n", "def calculator(expression):\n", " try:\n", " result = ast.parse(expression, mode = \"eval\")\n", " result = _evaluate_node(result.body)\n", " except Exception as e:\n", " return json.dumps({\"Error\": str(e)})\n", "\n", " return json.dumps({\"Result\": result})" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cellView": "form", "id": "IUn3qGx3qt4w" }, "outputs": [], "source": [ "#@title Calculator\n", "import json\n", "import ast\n", "import operator\n", "import math\n", "\n", "def _evaluate_node(node):\n", " if isinstance(node, ast.Constant): # Numbers\n", " return node.value\n", " elif isinstance(node, ast.BinOp): # Binary operations\n", " left = _evaluate_node(node.left)\n", " right = _evaluate_node(node.right)\n", " return _apply_operator(node.op, left, right)\n", " elif isinstance(node, ast.UnaryOp): # Unary operations like -x\n", " operand = _evaluate_node(node.operand)\n", " return _apply_unary_operator(node.op, operand)\n", " elif isinstance(node, ast.Call): # Function calls like sqrt(4)\n", " return _evaluate_function(node)\n", " elif isinstance(node, ast.Name): # Variables like pi, e\n", " return _get_constant(node.id)\n", " else:\n", " raise ValueError(f\"Unsupported operation: {type(node)}\")\n", "\n", "def _apply_operator(op, left, right):\n", " operators = {\n", " ast.Add: operator.add,\n", " ast.Sub: operator.sub,\n", " ast.Mult: operator.mul,\n", " ast.Div: operator.truediv,\n", " ast.Pow: operator.pow,\n", " ast.Mod: operator.mod,\n", " ast.FloorDiv: operator.floordiv,\n", " }\n", " if type(op) not in operators:\n", " raise ValueError(f\"Unsupported operator: {type(op)}\")\n", " return operators[type(op)](left, right)\n", "\n", "def _apply_unary_operator(op, operand):\n", " if isinstance(op, ast.UAdd):\n", " return +operand\n", " elif isinstance(op, ast.USub):\n", " return -operand\n", " else:\n", " raise ValueError(f\"Unsupported unary operator: {type(op)}\")\n", "\n", "def _evaluate_function(node):\n", " if not isinstance(node.func, ast.Name):\n", " raise ValueError(\"Only simple function names allowed\")\n", "\n", " func_name = node.func.id\n", " args = [_evaluate_node(arg) for arg in node.args]\n", "\n", " allowed_functions = {\n", " 'sqrt': math.sqrt,\n", " 'sin': math.sin,\n", " 'cos': math.cos,\n", " 'tan': math.tan,\n", " 'log': math.log,\n", " 'log10': math.log10,\n", " 'exp': math.exp,\n", " 'abs': abs,\n", " 'round': round,\n", " 'pow': pow,\n", " 'min': min,\n", " 'max': max,\n", " }\n", "\n", " if func_name not in allowed_functions:\n", " raise ValueError(f\"Function '{func_name}' not allowed\")\n", "\n", " return allowed_functions[func_name](*args)\n", "\n", "def _get_constant(name):\n", " \"\"\"Get mathematical constants\"\"\"\n", " constants = {\n", " 'pi': math.pi,\n", " 'e': math.e,\n", " 'tau': math.tau,\n", " }\n", " if name not in constants:\n", " raise ValueError(f\"Unknown constant: {name}\")\n", " return constants[name]" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "VpHMqCcPIN1E" }, "outputs": [], "source": [ "def firstQuery():\n", " return searchAndShowPaths(\"problem solving start\")\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Y5CUU2s2BBNB" }, "outputs": [], "source": [ "from smolagents import ToolCallingAgent, TransformersModel\n", "\n", "def agentMaker(id, tools):\n", " model_id = id\n", " model = TransformersModel(model_id=id)\n", " agent = ToolCallingAgent(tools=tools, model=model)\n", " return agent" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "KIWRMP4b2J7w", "colab": { "base_uri": "https://localhost:8080/", "height": 52 }, "outputId": "baf3f16a-17d0-4a9d-bc28-68817b3f96f4" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nsimple_test = \"\"\"\\nPREFIX ns1: \\nPREFIX rdfs: \\n\\nSELECT ?concept ?label WHERE {\\n ?concept rdfs:label ?label .\\n FILTER(CONTAINS(LCASE(?label), \"problem\"))\\n}\\nLIMIT 5\\n\"\"\"\\n\\nresult = query( simple_test, elyos)\\nprint(result)\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 33 } ], "source": [ "# Basic test query\n", "'''\n", "simple_test = \"\"\"\n", "PREFIX ns1: \n", "PREFIX rdfs: \n", "\n", "SELECT ?concept ?label WHERE {\n", " ?concept rdfs:label ?label .\n", " FILTER(CONTAINS(LCASE(?label), \"problem\"))\n", "}\n", "LIMIT 5\n", "\"\"\"\n", "\n", "result = query( simple_test, elyos)\n", "print(result)\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "d-ffmdzNldd0" }, "outputs": [], "source": [ "#@title Query\n", "from smolagents import Tool\n", "\n", "class Query(Tool):\n", " name = \"KnowledgeGraphQuery\"\n", " description = \"Search the knowledge graph using key words for follow up strategies. Returns a list of strategies and follow up points for each strategy.\"\n", " inputs = {\"task\": {\"type\": \"string\", \"description\": \"Key word(s) to query the graph for strategies of. For example, inputting the word derivative will return strategies for finding derivatives.\"}}\n", " output_type = \"string\"\n", "\n", " def __init__(self, graph):\n", " super().__init__()\n", " self.graph = graph\n", "\n", " def query(query, graph):\n", " try:\n", " results = graph.query(query)\n", " print(results)\n", "\n", " return results\n", " except Exception as e:\n", " print(e)\n", "\n", " def getRelationDestinations(label):\n", " cleaned_uri = f\"http://example.com/{clean(label)}\"\n", " query = f\"\"\"\n", " SELECT ?predicate ?targetLabel WHERE {{\n", " <{cleaned_uri}> ?predicate ?target .\n", " ?target ?targetLabel .\n", " FILTER(?predicate != )\n", " }}\n", " \"\"\"\n", "\n", " result = elyos.query(query)\n", " data = json.loads(result.serialize(format=\"json\"))\n", "\n", " # Build relation → destination pairs\n", " paths = []\n", " for binding in data[\"results\"][\"bindings\"]:\n", " relation_uri = binding[\"predicate\"][\"value\"]\n", " relation_name = relation_uri.split(\"/\")[-1]\n", " destination = binding[\"targetLabel\"][\"value\"]\n", " paths.append({\n", " \"relation\": relation_name,\n", " \"destination\": destination,\n", " \"display\": f\"{relation_name} → {destination}\"\n", " })\n", "\n", " return {\n", " \"concept\": label,\n", " \"paths\": paths,\n", " \"count\": len(paths)\n", " }\n", "\n", " def choosePathAndContinue(label, chosen_relation):\n", " # Get current paths to find destination\n", " current_paths = getRelationDestinations(label)\n", "\n", " chosen_destination = None\n", " for path in current_paths[\"paths\"]:\n", " if path[\"relation\"] == chosen_relation:\n", " chosen_destination = path[\"destination\"]\n", " break\n", "\n", " if not chosen_destination:\n", " return {\"error\": f\"Relation '{chosen_relation}' not found\"}\n", "\n", " # Get next paths from destination\n", " next_paths = getRelationDestinations(chosen_destination)\n", "\n", " # Display the choice and next options\n", " print(f\"\\nAgent chose: {chosen_relation} → {chosen_destination}\")\n", "\n", " if next_paths[\"paths\"]:\n", " print(f\"\\nPaths from '{next_paths['concept']}':\")\n", " for i, path in enumerate(next_paths['paths'], 1):\n", " print(f\" {i}. {path['display']}\")\n", " else:\n", " print(f\"\\n'{chosen_destination}' has no outgoing paths (end node)\")\n", "\n", " return {\n", " \"from\": label,\n", " \"relation\": chosen_relation,\n", " \"destination\": chosen_destination,\n", " \"next_paths\": next_paths\n", " }\n", "\n", " def searchAndShowPaths(self, search_term):\n", " #print(self.graph)\n", " search_query = f\"\"\"\n", " PREFIX rdfs: \n", " SELECT ?concept ?label WHERE {{\n", " ?concept rdfs:label ?label .\n", " FILTER(CONTAINS(LCASE(?label), LCASE(\"{search_term}\")))\n", " }}\n", " \"\"\"\n", "\n", " result = query(search_query, self.graph)\n", " print(f\"Result type: {type(result)}\")\n", " print(f\"Result value (first 100 chars): {str(result)[:100]}\")\n", "\n", " if type(result) == bytes:\n", " data = result.decode('utf-8')\n", " data = json.loads(data)\n", " print(type(data))\n", "\n", " else:\n", " data = json.loads(result.serialize(format=\"json\"))\n", "\n", " matching_concepts = []\n", " print(data)\n", "\n", " for binding in data.get(\"results\").get(\"bindings\"):\n", " matching_concepts.append(binding[\"label\"][\"value\"])\n", "\n", " if not matching_concepts:\n", " return {\"error\": f\"No concepts found containing '{search_term}'\"}\n", "\n", " print(f\"=== CONCEPTS CONTAINING '{search_term.upper()}' ===\")\n", " print(f\"Found {len(matching_concepts)} matching concepts:\")\n", " for i, concept in enumerate(matching_concepts, 1):\n", " print(f\" {i}. {concept}\")\n", "\n", " all_paths = {}\n", " for concept in matching_concepts:\n", " paths = getRelationDestinations(concept)\n", " #print(paths)\n", " if paths[\"paths\"]:\n", " all_paths[concept] = paths[\"paths\"]\n", "\n", " print(f\"\\n=== BRANCHING PATHS FROM ALL '{search_term.upper()}' CONCEPTS ===\")\n", " for concept, paths in all_paths.items():\n", " print(f\"\\nFrom '{concept}':\")\n", " for i, path in enumerate(paths, 1):\n", " print(f\" {i}. {path['display']}\")\n", "\n", " object_query = f\"\"\"\n", "PREFIX rdfs: \n", "SELECT DISTINCT ?subject ?subjectLabel WHERE {{\n", " ?object rdfs:label ?objectLabel .\n", " FILTER(CONTAINS(LCASE(?objectLabel), LCASE(\"{search_term}\")))\n", " ?subject ?predicate ?object .\n", " ?subject rdfs:label ?subjectLabel .\n", "}}\n", "\"\"\"\n", "\n", " result = query(object_query, self.graph)\n", " #print(result)\n", "\n", " if type(result) == bytes:\n", " data = result.decode('utf-8')\n", " data = json.loads(data)\n", " #print(type(data))\n", "\n", " else:\n", " data = json.loads(result.serialize(format=\"json\"))\n", "\n", " branches_from = []\n", " #print(data)\n", "\n", " for binding in data.get(\"results\").get(\"bindings\"):\n", " branches_from.append(binding[\"subjectLabel\"][\"value\"])\n", "\n", "\n", " print(f\"=== CONCEPTS BRANCHING TO '{search_term.upper()}' ===\")\n", " print(f\"Found {len(branches_from)} connecting concepts:\")\n", " for i, concept in enumerate(branches_from, 1):\n", " print(f\" {i}. {concept}\")\n", "\n", " all_paths = {}\n", " for concept in branches_from:\n", " paths = getRelationDestinations(concept)\n", " if paths[\"paths\"]:\n", " all_paths[concept] = paths[\"paths\"]\n", "\n", " print(f\"\\n=== BRANCHING PATHS TO ALL '{search_term.upper()}' CONCEPTS ===\")\n", " for concept, paths in all_paths.items():\n", " print(f\"\\nFrom '{concept}':\")\n", " for i, path in enumerate(paths, 1):\n", " print(f\" {i}. {path['display']}\")\n", "\n", " return {\n", " \"search_term\": search_term,\n", " \"matching_concepts\": matching_concepts,\n", " \"subject_concepts\" : branches_from,\n", " \"concept_paths\": all_paths,\n", " \"total_concepts\": len(matching_concepts)+len(branches_from),\n", " \"concepts_with_paths\": len(all_paths)\n", " }\n", "\n", " def exploreFromSearch(self, search_term, chosen_concept, chosen_relation):\n", "\n", " return choosePathAndContinue(chosen_concept, chosen_relation)\n", "\n", " def forward(self, task):\n", " print(self.graph)\n", " return self.searchAndShowPaths(task)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "NIl3VALO9PVw", "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "outputId": "70554318-da6e-41f1-d084-a2f6ae76f8a5" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nt = Query(elyos)\\nt.forward(\"derivative\")\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 35 } ], "source": [ "'''\n", "t = Query(elyos)\n", "t.forward(\"derivative\")\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cellView": "form", "id": "IoVZPfvP90d_" }, "outputs": [], "source": [ "#@title Graph Creation\n", "class GraphCreationTool(Tool):\n", "\n", " name = \"GraphCreator\"\n", " description = \"Create a new knowledge graph using structured data\"\n", " inputs = {\"knowledgeData\" : {\"type\" : \"array\", \"description\": \"Insert data in the form of a list of dictionaries with one node name, a relation name and another node name to create a graph\"}\n", " ,\"name\": {\"type\": \"string\", \"description\": \"Name of the graph\"}}\n", " output_type = \"object\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", "\n", "\n", " def createGraph(self, listed, file_path):\n", " newGraph = Graph()\n", "\n", " graph = nx.MultiDiGraph()\n", "\n", " for x in listed:\n", " head = x[\"Head\"]\n", " relation = x[\"Relation\"]\n", " tail = x[\"Tail\"]\n", "\n", " head = clean(head)\n", " tail = clean(tail)\n", " relation = clean(relation)\n", "\n", " headRef = URIRef(\"http://example.com/\"+head)\n", " tailRef = URIRef(\"http://example.com/\"+tail)\n", " relationRef = URIRef(\"http://example.com/\"+relation)\n", " newGraph.add((headRef, RDFS.label, Literal(head, datatype=XSD.string)))\n", " newGraph.add((tailRef, RDFS.label, Literal(tail, datatype=XSD.string)))\n", "\n", "\n", " newGraph.add((headRef, relationRef, tailRef))\n", "\n", " newGraph.serialize(format = \"turtle\")\n", " rdf_file_path = file_path+ '.rdf'\n", " newGraph.serialize(destination=rdf_file_path, format='turtle')\n", "\n", " for subject, related, predicate in newGraph:\n", " if isinstance(predicate, URIRef):\n", " graph.add_edge(str(subject), str(predicate), relation=str(related))\n", "\n", " return newGraph, graph\n", "\n", " def forward(self, knowledgeData, name):\n", " dictionary = knowledgeData\n", " newGraph, graph = self.createGraph(dictionary, name)\n", " pos = nx.spring_layout(graph)\n", "\n", " g3d = {}\n", " g3dEdge = []\n", "\n", " xCoords = []\n", " yCoords = []\n", " zCoords = []\n", "\n", " xEdge = []\n", " yEdge = []\n", " zEdge = []\n", "\n", "\n", " graphNodes = list(graph.nodes())\n", " for node in graphNodes:\n", " x,y = pos[node]\n", " z = 30 + 20 * np.sin(x * 5) * np.cos(y * 5)\n", "\n", " xCoords.append(x)\n", " yCoords.append(y)\n", " zCoords.append(z)\n", " g3d[node] = (x,y,z)\n", "\n", " for edge in graph.edges(data=True):\n", " node1 = edge[0]\n", " node2 = edge[1]\n", " x0, y0, z0 = g3d[node1]\n", " x1, y1, z1 = g3d[node2]\n", " xEdge.extend([x0, x1, None])\n", " yEdge.extend([y0, y1, None])\n", " zEdge.extend([z0, z1, None])\n", "\n", " hover_texts = []\n", " for node_uri in graphNodes:\n", "\n", " name = node_uri.split('.com/')\n", " name = name[1]\n", " #print(name)\n", " degree = graph.degree[node_uri]\n", " hover_text = f\"Node: {name}
Degree: {degree}\"\n", " hover_texts.append(hover_text)\n", "\n", " fig = go.Figure(data=[\n", " go.Scatter3d(\n", " x=xCoords,\n", " y=yCoords,\n", " z=zCoords,\n", " mode='markers',\n", " marker=dict(\n", " size=8,\n", " color=zCoords, # Color by z-position\n", " colorscale='Viridis',\n", " opacity=0.8\n", " ),\n", " text=hover_texts,\n", " hoverinfo='text',\n", " name='Knowledge Graph Nodes'\n", " )\n", "])\n", "\n", " fig.add_trace(go.Scatter3d(\n", " x=xEdge,\n", " y=yEdge,\n", " z=zEdge,\n", " mode='lines',\n", " line=dict(color='pink', width=0.5),\n", " hoverinfo='skip', # Don't show hover for edges\n", " showlegend=False,\n", " name='connections'\n", "))\n", "\n", " fig.update_layout(\n", " title=\"3D Knowledge Graph (500+ Nodes)\",\n", " scene=dict(\n", " xaxis=dict(visible=False),\n", " yaxis=dict(visible=False),\n", " zaxis=dict(visible=False),\n", " bgcolor='black'\n", " ),\n", " width=900,\n", " height=900\n", ")\n", "\n", " fig.show()\n", " return newGraph, graph\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "kk3ucoW9oggX" }, "outputs": [], "source": [ "#@title Memory\n", "from pathlib import Path\n", "\n", "class Memory(Tool):\n", " name = \"Memory\"\n", " description = \"A memory system that can be continually updated. Use this to take notes to hold in context. Includes a knowledge graph and free flow notepad\"\n", " inputs = {\"knowledgeExtend\": {\"type\": \"object\", \"description\" : \"Input a list of a dictionary with one node name, a relation name and another node name to record causal relationships. Leave blank if not intended to be used.\"},\n", " \"notes\": {\"type\": \"string\", \"description\" : \"Record notes to remember into a file. Leave blank if not intended to be used.\"}\n", " , \"fileName\": {\"type\": \"string\", \"description\": \"Name of the file you wish to record notes into, or continue recording notes into. Leave blank if unused.\"}\n", " , \"knowledgeQuery\": {\"type\": \"string\", \"description\": \"Key word you wish to query the knowledge graph memory for. Leave blank if unused.\"}\n", " , \"noteQuery\": {\"type\": \"string\", \"description\": \"The file you want to retrieve within memory. Leave blank if unused, write 'all' if you want all of them.\"}}\n", " output_type = \"object\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", " self.graphMaker = GraphCreationTool()\n", " self.graph = None\n", " self.triples = []\n", "\n", " self.displayGraph = None\n", " self.notePad = []\n", " self.query = None\n", "\n", " def memoryGraph(self, knowledgeExtend):\n", " self.triples.append(knowledgeExtend)\n", " self.graph, self.displayGraph = self.graphMaker.forward(self.triples, \"graph\")\n", " self.query = Query(self.graph)\n", "\n", " def noteTaking(self, notes, fileName):\n", " if not os.path.isfile(fileName):\n", " with open(fileName+\".txt\", \"w\") as file:\n", " file.write(notes)\n", " self.notePad.append(fileName)\n", "\n", " else:\n", " with open(fileName+\".txt\", \"a\") as file:\n", " file.write(notes)\n", "\n", "\n", " def displayNotes(self, name):\n", " script = \"\"\n", " if name == \"all\":\n", " print(\"is all\")\n", " for i in self.notePad:\n", " print(type(i))\n", " print(i)\n", " with open(i+\".txt\", \"r\") as file:\n", " print(file.read())\n", " script += file.read()\n", " return script\n", "\n", "\n", " else:\n", " for i in self.notePad:\n", " if i == name:\n", " print(i)\n", "\n", " def forward(self, knowledgeExtend, notes, fileName, knowledgeQuery, noteQuery):\n", " print(knowledgeExtend)\n", " print(\"My notes\" + notes)\n", " print(\"My file name\" + fileName)\n", " print(\"My question\" + knowledgeQuery)\n", " print(\"My file im searching for\" + noteQuery)\n", "\n", " if knowledgeExtend != \"\":\n", " self.memoryGraph(knowledgeExtend)\n", "\n", " if notes != \"\":\n", " self.noteTaking(notes, fileName)\n", "\n", " if knowledgeQuery != \"\":\n", " return self.query.forward(knowledgeQuery)\n", "\n", "\n", " if noteQuery != \"\":\n", " print(\"Printing notes\")\n", " self.displayNotes(noteQuery)\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Y96n8wO-rnUk" }, "outputs": [], "source": [ "#dummy = {\"Head\": \"Creator\", \"Relation\": \"Created me\", \"Tail\": \"Hannah\"}\n", "#add = {\"Head\": \"Hannah\", \"Relation\": \"attends\", \"Tail\": \"Woodson High School\"}" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "afO24PRn-Z9P" }, "outputs": [], "source": [ "#memoryBank = Memory()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "uilXoZ5-ImhB", "colab": { "base_uri": "https://localhost:8080/", "height": 52 }, "outputId": "43038734-b738-4a58-9cfc-976bd6323363" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nmemoryBank.forward({\"Head\": \"Creator\", \"Relation\": \"Created me\", \"Tail\": \"Hannah\"}, \"My creator is high school student Hannah Fensterer.\", \"creator\", \"\",\"\")\\nmemoryBank.forward(add, \"Hannah goes to woodson high school.\", \"creator\", \"\",\"\")\\nmemoryBank.forward(\"\", \"\", \"\", \"\",\"all\")\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 40 } ], "source": [ "'''\n", "memoryBank.forward({\"Head\": \"Creator\", \"Relation\": \"Created me\", \"Tail\": \"Hannah\"}, \"My creator is high school student Hannah Fensterer.\", \"creator\", \"\",\"\")\n", "memoryBank.forward(add, \"Hannah goes to woodson high school.\", \"creator\", \"\",\"\")\n", "memoryBank.forward(\"\", \"\", \"\", \"\",\"all\")\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Gh86KqA5HNsm" }, "outputs": [], "source": [ "import requests\n", "from bs4 import BeautifulSoup\n", "import re\n", "\n", "class GoogleSearchTool(Tool):\n", " name = \"GoogleSearch\"\n", " description = \"Search the web for information.\"\n", " inputs = {\"task\": {\"type\": \"string\", \"description\": \"What you would like to search for.\"}}\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", " self.api_key = \"AIzaSyBFrFCRbwzuL8gmEyzjcBpuozK6YKO76nc\"\n", " self.cse_id = \"51381dbc2321144ac\"\n", "\n", " if not self.api_key or not self.cse_id:\n", " raise ValueError(\"Missing GOOGLE_API_KEY or GOOGLE_CSE_ID\")\n", "\n", " def forward(self, task):\n", " social_media_exclusions = [\n", " \"-site:twitter.com\"\n", " ]\n", "\n", " exclusion_string = \" \".join(social_media_exclusions)\n", " task = f\"{task} {exclusion_string}\"\n", "\n", " url = \"https://www.googleapis.com/customsearch/v1\"\n", "\n", " params = {\n", " \"key\": self.api_key,\n", " \"cx\": self.cse_id,\n", " \"q\": task,\n", " \"num\" : 3,\n", " \"fields\": \"items(title,link,snippet,htmlSnippet,formattedUrl,displayLink)\"\n", " }\n", "\n", " responses = requests.get(url, params=params)\n", " data = responses.json()\n", "\n", " try:\n", " print(\"trying\")\n", " info = \"\"\n", " count = 1\n", " for response in data[\"items\"]:\n", " pageContent = requests.get(response[\"link\"])\n", " soup = BeautifulSoup(pageContent.content, 'html.parser')\n", " text = soup.get_text(separator='\\n', strip=True)[:14822]\n", " source = f'Source {count}: {text}'\n", " info += source + \"\\n\\n\\n\"\n", " count += 1\n", "\n", " return info\n", "\n", "\n", "\n", " except:\n", " print(\"error\")\n", "\n", " if \"items\" in data:\n", " results = \"\"\n", " for item in data[\"items\"]:\n", " dummy = \"\"\n", " dummy += item[\"title\"]\n", " dummy += item[\"link\"]\n", " dummy += item[\"snippet\"]\n", "\n", " results += dummy + \"\\n\"\n", "\n", "\n", " return results\n", " else:\n", " return {\"error\": \"No results found\"}\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "K-bI4AWVbqd8" }, "outputs": [], "source": [ "import requests\n", "from bs4 import BeautifulSoup\n", "import re\n", "\n", "class GoogleSearchToolCasual(Tool):\n", " name = \"GoogleSearchCasual\"\n", " description = \"Search the web for information. Includes social media as sources. Use mainly for subjective information\"\n", " inputs = {\"task\": {\"type\": \"string\", \"description\": \"What you would like to search for.\"}}\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", " self.api_key = \"AIzaSyBFrFCRbwzuL8gmEyzjcBpuozK6YKO76nc\"\n", " self.cse_id = \"51381dbc2321144ac\"\n", "\n", " if not self.api_key or not self.cse_id:\n", " raise ValueError(\"Missing GOOGLE_API_KEY or GOOGLE_CSE_ID\")\n", "\n", " def forward(self, task):\n", "\n", " url = \"https://www.googleapis.com/customsearch/v1\"\n", "\n", " params = {\n", " \"key\": self.api_key,\n", " \"cx\": self.cse_id,\n", " \"q\": task,\n", " \"num\" : 3,\n", " \"fields\": \"items(title,link,snippet,htmlSnippet,formattedUrl,displayLink)\"\n", " }\n", "\n", " response = requests.get(url, params=params)\n", " data = response.json()\n", "\n", " try:\n", " for response in data[\"items\"]:\n", " pageContent = requests.get(response[\"link\"])\n", " soup = BeautifulSoup(pageContent.content, 'html.parser')\n", " text = soup.get_text(separator='\\n', strip=True)\n", " return text\n", "\n", " except:\n", " if \"items\" in data:\n", " results = \"\"\n", " for item in data[\"items\"]:\n", " dummy = \"\"\n", " dummy += item[\"title\"]\n", " dummy += item[\"link\"]\n", " dummy += item[\"snippet\"]\n", "\n", " results += dummy + \"\\n\"\n", "\n", " return results\n", " else:\n", " return {\"error\": \"No results found\"}\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "l2CDRM_-l1gx", "colab": { "base_uri": "https://localhost:8080/", "height": 70 }, "outputId": "1b49b494-4aa7-4bae-b7b1-287d7b029c06" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nfrom smolagents import PythonInterpreterTool\\n\\nweb_search = GoogleSearchTool()\\ncasual_search = GoogleSearchToolCasual()\\nresults = web_search.forward(\"international applications uoft\")\\nresults2 = casual_search.forward(\"Most unfair minigame in mario party 6\")\\nprint(results)\\nprint(results2)\\n\\n\\n\\npython_interpreter = PythonInterpreterTool()\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 43 } ], "source": [ "'''\n", "from smolagents import PythonInterpreterTool\n", "\n", "web_search = GoogleSearchTool()\n", "casual_search = GoogleSearchToolCasual()\n", "results = web_search.forward(\"international applications uoft\")\n", "results2 = casual_search.forward(\"Most unfair minigame in mario party 6\")\n", "print(results)\n", "print(results2)\n", "\n", "\n", "\n", "python_interpreter = PythonInterpreterTool()\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "I_fpRSFPPnqc" }, "outputs": [], "source": [ "from datetime import datetime, timezone\n", "import os\n", "\n", "class noteMaker(Tool):\n", " name = \"NoteMaker\"\n", " description = \"Create a new note.\"\n", " inputs = {\"task\": {\"type\": \"string\", \"description\": \"Name of the note you wish to create.\"},\n", " \"task2\": {\"type\": \"string\", \"description\": \"The written content of the note you wish to create.\"} }\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", "\n", "\n", " def forward(self, task, task2):\n", " fileName = task+\".txt\"\n", "\n", " if not os.path.exists(fileName):\n", " with open(fileName, \"w+\") as file:\n", " file.write(f\"# {task}\\n\")\n", " file.write(task2)\n", " else:\n", " print(\"Name the file something else!\")\n", " return \"Name the file something else!\"\n", "\n", " with open(fileName, \"r\") as file:\n", " lines = file.readlines()\n", " for line in lines:\n", " print(line)\n", "\n", " return fileName\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "rwPkvcfYLH-g", "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "outputId": "22ba91b4-8524-4b63-97cb-e291ae9cdb8e" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\ntool = noteMaker()\\nnote = tool.forward(\"test\", \"This is a test. \\nAre you having fun? \\nBecause I am :)\")\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 45 } ], "source": [ "'''\n", "tool = noteMaker()\n", "note = tool.forward(\"test\", \"This is a test. \\nAre you having fun? \\nBecause I am :)\")\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "i5XQJHIDkgO1" }, "outputs": [], "source": [ "from datetime import datetime, timezone\n", "\n", "class noteEdit(Tool):\n", " name = \"NoteEdit\"\n", " description = \"Create a new note.\"\n", " inputs = {\"task\": {\"type\": \"string\", \"description\": \"Name of the note you wish to append.\"},\n", " \"task2\": {\"type\": \"string\", \"description\": \"The written content you wish to add.\"} }\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", "\n", "\n", " def forward(self, task, task2):\n", " fileName = task\n", "\n", " with open(fileName, \"a\") as file:\n", " file.write(task2)\n", "\n", "\n", " with open(fileName, \"r\") as file:\n", " lines = file.readlines()\n", " for line in lines:\n", " print(line)\n", "\n", " return fileName\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "UFU87T-FP2XO", "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "outputId": "5ad89883-dda2-4c80-e425-387ea26e094c" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\ntool = noteEdit()\\ntool.forward(\"test\", \"\\nLittle Timmy\")\\nprint(\"\")\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 47 } ], "source": [ "'''\n", "tool = noteEdit()\n", "tool.forward(\"test\", \"\\nLittle Timmy\")\n", "print(\"\")\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "FCaaHCvKFQ1n" }, "outputs": [], "source": [ "from smolagents import Tool\n", "import requests\n", "import json\n", "\n", "class paperSearch(Tool):\n", " name = \"ArxivSearch\"\n", " description = \"Search for research papers by key words.\"\n", " inputs = {\"task\": {\"type\": \"string\", \"description\": \"What you would like to search for.\"}}\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", " self.local_host = f\"http://export.arxiv.org/api/query?search_query\"\n", "\n", "\n", "\n", "\n", " def search(self, data):\n", " info = requests.get(f'{self.local_host}={data}')\n", " return info.text\n", "\n", "\n", " def forward(self, task):\n", " return self.search(task)\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "UIp_Skzeo0E4" }, "outputs": [], "source": [ "from smolagents import Tool\n", "import requests\n", "import json\n", "import pdb\n", "\n", "class wikiSearch(Tool):\n", " name = \"wikiSearch\"\n", " description = \"Search wikipedia by key words.\"\n", " inputs = {\"query\": {\"type\": \"string\", \"description\": \"What you would like to search for.\"}}\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", " self.local_host = f\"https://en.wikipedia.org/w/api.php\"\n", "\n", " self.headers = {'User-Agent': 'HannahBot/0.0 (https://colab.research/hannahbot/; hannahfensterer@gmail.com)'}\n", "\n", "\n", " def clean_query(self, query):\n", " stops = {\"describe\", \"tell\", \"explain\", \"show\", \"give\", \"find\",\n", " \"what\", \"is\", \"are\", \"the\", \"a\", \"an\", \"me\", \"about\", \"of\"}\n", " words = query.lower().replace(\"?\", \"\").split()\n", " keywords = [w for w in words if w not in stops]\n", " return \" \".join(keywords)\n", "\n", " def search(self, query):\n", " params = {\n", " \"action\": \"query\",\n", " \"format\": \"json\",\n", " \"list\": \"search\",\n", " \"srsearch\": self.clean_query(query)\n", " }\n", " info = requests.get(url = self.local_host, params = params, headers = self.headers)\n", " return info\n", "\n", " def contents(self, titles):\n", " params = {\n", " \"action\": \"query\",\n", " \"format\": \"json\",\n", " \"prop\": \"extracts\",\n", " \"exintro\": True,\n", " \"explaintext\": True,\n", " \"titles\": \"|\".join(titles)\n", " }\n", "\n", " info = requests.get(url = self.local_host, params = params, headers = self.headers)\n", " return info.json()\n", "\n", "\n", " def forward(self, query):\n", " titles = []\n", " background = \"\"\n", "\n", " text = self.search(query)\n", " text = text.json()\n", "\n", " searches = text[\"query\"]\n", " text = searches[\"search\"] #list of searches\n", " for search in text:\n", " titles.append(search[\"title\"])\n", " print(search[\"title\"])\n", "\n", " info = self.contents(titles)\n", " info = info[\"query\"]\n", " info = info[\"pages\"]\n", " info = list(info.values())\n", "\n", " for article in info:\n", " background+=article[\"title\"]+\"\\n\"\n", " background+=article[\"extract\"]\n", "\n", " return background\n", "\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "source": [ "wikipedia = wikiSearch()\n", "search = wikipedia.forward(\"Countries in north america\")\n", "print(search)\n", "print(len(search))" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "OMxGwvQiyCUw", "outputId": "85a3ba76-7bbc-4cc5-a0d8-69edd7b66685" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "List of sovereign states and dependent territories in North America\n", "List of North American countries by area\n", "Lists of most common surnames in North American countries\n", "North America\n", "List of North American countries by population\n", "List of sovereign states and dependent territories in the Americas\n", "United States\n", "Indigenous peoples of the Americas\n", "List of transcontinental countries\n", "Latin America\n", "Indigenous peoples of the Americas\n", "The Indigenous peoples of the Americas are the peoples who are native to the Americas or the Western Hemisphere. Their ancestors are among the pre-Columbian population of South or North America, including Central America and the Caribbean. Indigenous peoples live throughout the Americas. While often minorities in their countries, Indigenous peoples are the majority in Greenland and close to a majority in Bolivia and Guatemala.\n", "There are at least 1,000 different Indigenous languages of the Americas still in use in the 21st century. Some languages, including Quechua, Arawak, Aymara, Guaraní, Nahuatl, and some Mayan languages, have millions of speakers and are recognized as official by governments in Bolivia, Peru, Paraguay, and Greenland. \n", "Indigenous peoples, whether residing in rural or urban areas, often maintain aspects of their cultural practices, including religion, social organization, and subsistence practices. Over time, these cultures have evolved, preserving traditional customs while adapting to modern needs. Some Indigenous groups remain relatively isolated from Western culture, with some still classified as uncontacted peoples.\n", "The Americas also host millions of individuals of mixed Indigenous, European, and sometimes African or Asian descent, historically referred to as mestizos in Spanish-speaking countries. In many Latin American nations, people of partial Indigenous descent constitute a majority or significant portion of the population, particularly in Central America, Mexico, Peru, Bolivia, Ecuador, Colombia, Venezuela, Chile, and Paraguay. Mestizos outnumber Indigenous peoples in most Spanish-speaking countries, according to estimates of ethnic cultural identification. However, since Indigenous communities in the Americas are defined by cultural identification and kinship rather than ancestry or race, mestizos are typically not counted among the Indigenous population unless they speak an Indigenous language or identify with a specific Indigenous culture. Additionally, many individuals of wholly Indigenous descent who do not follow Indigenous traditions or speak an Indigenous language have been classified or self-identified as mestizo due to assimilation into the dominant Hispanic culture. In recent years, the self-identified Indigenous population in many countries has increased as individuals reclaim their heritage amid rising Indigenous-led movements for self-determination and social justice.\n", "In past centuries, Indigenous peoples had diverse societal, governmental, and subsistence systems. Some Indigenous peoples were historically hunter-gatherers, while others practiced agriculture and aquaculture. Various Indigenous societies developed complex social structures, including precontact monumental architecture, organized cities, city-states, chiefdoms, states, monarchies, republics, confederacies, and empires. These societies possessed varying levels of knowledge in fields such as engineering, architecture, mathematics, astronomy, writing, physics, medicine, agriculture, irrigation, geology, mining, metallurgy, art, sculpture, and goldsmithing.\n", "\n", "Latin America\n", "Latin America (Spanish: América Latina or Latinoamérica; Portuguese: América Latina) is the cultural region of the Americas where Romance languages are predominantly spoken, primarily Spanish and Portuguese. It is defined according to cultural identity, not geography. As such, it includes countries in both North and South America. For example, countries from North America like Mexico tend to be included, while English-speaking countries in South America like Guyana or Caribbean countries like Jamaica are often not considered. Most of the countries in Central America, South America and the Caribbean are considered Latin American countries. Commonly, it refers to Hispanic America plus Brazil. Related terms are the narrower Hispanic America, which exclusively refers to Spanish-speaking nations, and the broader Ibero-America, which includes all Iberic countries in the Americas. English and Dutch-speaking countries and territories—although in the same geographical region—are often excluded (Suriname, Guyana, the Falkland Islands, Jamaica, Trinidad and Tobago, Belize, etc.).\n", "The term Latin America was first introduced in 1856 at a Paris conference called Initiative of the Americas: Idea for a Federal Congress of the Republics (Iniciativa de la América. Idea de un Congreso Federal de las Repúblicas). Chilean politician Francisco Bilbao coined the term to refer to countries sharing cultural and linguistic heritage. It gained further prominence during the 1860s under the rule of Napoleon III, whose government sought to justify France's intervention in the Second Mexican Empire.List of North American countries by area\n", "Below is a list of countries and dependencies in North America by area. The region includes Canada, the Caribbean, Saint Pierre and Miquelon, Central America, Mexico, and the United States. Canada is the largest country in North America and the Western Hemisphere. Saint Kitts and Nevis is the smallest country in North America overall, while El Salvador is the smallest country on the mainland. Greenland is a dependent territory of Denmark, and is not a territory of America.\n", "\n", "List of North American countries by population\n", "This is a list of North American countries and dependencies by population in North America, total projected population from the United Nations and the latest official figure. \n", "As of 2025 most citizens of North America live in the United States or Mexico with the two countries making up 77.6% of the population of North America.List of sovereign states and dependent territories in North America\n", "The following is a list of sovereign countries and dependent territories in North America, a continent that covers the landmass north of the Colombia-Panama border as well as the islands of the Caribbean.List of sovereign states and dependent territories in the Americas\n", "This is an alphabetical list of sovereign states and dependent territories in the Americas. It comprises three regions, Northern America (Canada and the United States), the Caribbean (cultural region of the English, French, Dutch, and Creole speaking countries located on the Caribbean Sea) and Latin America (nations that speak Spanish and Portuguese). The Americas are almost entirely located in the Western Hemisphere, with some of the north-west islands of Alaska entering the Eastern Hemisphere. The majority of islands lying in the Atlantic between the Americas and Afro-Eurasia, such as Iceland, are not normally associated with the Americas and are therefore excluded from this list.List of transcontinental countries\n", "This is a list of countries with territory that straddles more than one continent, known as transcontinental states or intercontinental states.\n", "Contiguous transcontinental countries are states that have one continuous or immediately-adjacent piece of territory that spans a continental boundary, most commonly the line that separates Asia and Europe. By contrast, non-contiguous transcontinental countries are those states that have portions of territory that are separated from one another either by a body of water or by other countries (such as in the case of France). Most non-contiguous transcontinental countries are countries with dependencies like the United Kingdom with its overseas territories, but can be countries that have fully integrated former dependencies in their central states like France with its overseas regions.\n", "For the purposes of this article, a seven-continent model is assumed based on common terms of reference by English language geographers. Combined continents like \"the Americas\" and \"Eurasia\" are not acknowledged or referenced. The boundary between Asia and Europe is largely conventional (much of it over land), and several conventions remained in use well into the 20th century. However, the now-prevalent convention—which has been in use by some cartographers since about 1850—follows the Caucasus northern chain, the Ural River and the Ural Mountains, is used for the purposes of this list. This convention results in several countries such as in the case of Azerbaijan, Kazakhstan, and Turkey finding themselves almost entirely in 'Asia', with a few small enclaves or districts technically in 'Europe'. Notwithstanding these anomalies, this list of transcontinental or intercontinental states respects the convention that Europe and Asia are full continents rather than subcontinents or component landmasses of a larger Eurasian continent.\n", "Listed further below, separately, are countries with distant non-contiguous parts (overseas territories) on separate continents.\n", "\n", "Lists of most common surnames in North American countries\n", "This article contains lists of the most common surnames in some of the countries of North America, including one transcontinental country. Countries are arranged in alphabetical order.\n", "\n", "North America\n", "North America is a continent in the Northern and Western hemispheres. It is bordered to the north by the Arctic Ocean, to the east by the Atlantic Ocean, to the southeast by South America and the Caribbean Sea, and to the south and west by the Pacific Ocean.\n", "North America covers an area of around 24,709,000 square kilometers (9,540,000 square miles), representing approximately 16.5% of Earth's land area and 4.8% of its total surface area. It is the third-largest continent by size after Asia and Africa, and the fourth-largest continent by population after Asia, Africa, and Europe. As of 2021, North America's population is estimated at over 592 million people in 23 independent states and territories, or about 7.5% of the world's population.\n", "The continent includes the subregions of Northern America (comprising Canada, Greenland, and the continental United States as well as the insular territories of Bermuda and Saint Pierre and Miquelon) and Middle America (comprising Mexico, Central America and the Caribbean). In human geography, the terms \"North America\" and \"North American\" often refer to just Northern America.\n", "It is unknown exactly how and when the first human populations reached North America. People are known to have lived in the Americas at least 20,000 years ago, but various evidence points to possibly earlier dates. The Paleo-Indian period in North America followed the Last Glacial Period, and lasted until about 10,000 years ago when the Archaic period began. The classic stage followed the Archaic period, and lasted from approximately the 6th to 13th centuries. Norse exploration and colonization began in the late 10th century; the Norse built several settlements in Greenland and at least one settlement in Newfoundland.\n", "Beginning in 1492, the voyages of Christopher Columbus led to a transatlantic exchange, including migrations of European settlers during the Age of Discovery and the early modern period. Present-day cultural and ethnic patterns reflect interactions between early European colonists, indigenous peoples, enslaved Africans, later immigrants from Europe and Asia, and descendants of these respective groups. European colonization has led to most North Americans speaking European languages (such as English, Spanish, and French) and the cultures of the region commonly reflect Western traditions. However, there remain significant indigenous populations that continue to adhere to their respective pre-colonial cultural and linguistic traditions.United States\n", "The United States of America (USA), also known as the United States (U.S.) or America, is a country primarily located in North America. It is a federal republic consisting of 50 states and a federal capital district, Washington, D.C. The 48 contiguous states border Canada to the north and Mexico to the south, with the semi-exclave of Alaska in the northwest and the archipelago of Hawaii in the Pacific Ocean. The United States also asserts sovereignty over five major island territories and various uninhabited islands in Oceania and the Caribbean. It is a megadiverse country, with the world's third-largest land area and third-largest population, exceeding 341 million.\n", "Paleo-Indians first migrated from North Asia to North America at least 15,000 years ago, and formed various civilizations. European discovery of the Americas began in 1492, and British colonization followed with the 1607 settlement of Virginia, the first of the Thirteen Colonies. Enslavement of Africans was practiced in every colony and supplied most of the labor for the Southern Colonies' plantation economy. The American Enlightenment that spread throughout the colonies in the 18th century valued republicanism and liberalism. Clashes with the British Crown over taxation without parliamentary representation and the denial of other English rights evolved into the American Revolution, which led to the July 2, 1776, Lee Resolution formally declaring independence from Great Britain. This was followed two days later by the public release of the Declaration of Independence. Victory in the 1775–1783 Revolutionary War brought international recognition of the country's sovereignty. Rapid westward territorial expansion followed the purchase, settlement, and conquest of European-held or Indigenous-controlled territory. As more states were admitted into the Union, a North–South division over slavery led 11 Southern states to declare secession and join as the Confederate States of America in order to preserve slavery there. These states fought against the Union in the American Civil War of 1861–1865 but were defeated. With the United States' victory and reunification, slavery was abolished nationally. By 1900, the country had established itself as a great power, a status solidified after its involvement during World War I. Following Japan's attack on Pearl Harbor in 1941, the U.S. entered World War II on the side of the Allies. Its aftermath left the U.S. and the Soviet Union as rival superpowers, competing for ideological dominance and international influence during the Cold War. The Soviet Union's collapse in 1991 left the U.S. the world's sole superpower, though China has recently emerged as a strong rival.\n", "The U.S. federal government is a representative democracy with a president and a constitution that creates a separation of powers among three branches: legislative, executive, and judicial. The United States Congress is a bicameral national legislature composed of the House of Representatives (a lower house based on population) and the Senate (an upper house based on equal representation for each state). Federalism grants substantial autonomy to the 50 states. In addition, 574 Native American tribes have sovereignty rights, and there are 326 Native American reservations.\n", "A developed country, the U.S. ranks high in economic competitiveness, innovation, and higher education. Accounting for over a quarter of nominal global GDP, the U.S. economy has been the world's largest since about 1890. It is the wealthiest country, with the highest disposable household income per capita among OECD members, though its wealth inequality is highly pronounced. Shaped by centuries of immigration, the culture of the U.S. is diverse and globally influential. Making up nearly a third of global military spending, the country is widely considered to have the most powerful armed forces in the world and was the first to develop and employ nuclear weapons. A member of numerous international organizations including the United Nations Security Council, it plays a major role in global political, cultural, economic, and military affairs.\n", "\n", "\n", "15641\n" ] } ] }, { "cell_type": "code", "source": [ "print(type(search))" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "TxYktmb42tRO", "outputId": "5d456e1b-ebb3-4785-c13b-8b8aaca6c203" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\n" ] } ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "_F05yDOD9s9x" }, "outputs": [], "source": [ "import os\n", "import pickle\n", "from google.auth.transport.requests import Request\n", "from google_auth_oauthlib.flow import InstalledAppFlow\n", "from googleapiclient.discovery import build" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "imDJxKLSTSei" }, "outputs": [], "source": [ "from smolagents import Tool\n", "import requests\n", "import json\n", "from google.colab import userdata\n", "from google.oauth2.credentials import Credentials\n", "from google.auth.transport.requests import Request\n", "from google_auth_oauthlib.flow import InstalledAppFlow\n", "from googleapiclient.discovery import build\n", "\n", "class gmailCallLocal(Tool):\n", " name = \"LocalEmail\"\n", " description = \"Fetch recent emails(use if running local).\"\n", " inputs = {\"task\": {\"type\": \"string\", \"description\": \"What you would like to search for. If just most recent messages, leave blank\"}}\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", " self.service = self.authenticate()\n", "\n", "\n", " def authenticate(self):\n", "\n", " SCOPES = ['https://www.googleapis.com/auth/gmail.modify']\n", " creds = {\n", " \"web\": {\n", " \"client_id\": f\"{userdata.get(\"google_id\")}.apps.googleusercontent.com\",\n", " \"project_id\": \"mayonakabot\",\n", " \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n", " \"token_uri\": \"https://oauth2.googleapis.com/token\",\n", " \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n", " \"client_secret\": userdata.get(\"google_secret\"),\n", " \"redirect_uris\": [\n", " \"http://localhost:8080\",\n", " \"https://your-domain.com/oauth2callback\"\n", " ]\n", " }\n", " }\n", " if os.path.exists(\"token.json\"):\n", " creds = Credentials.from_authorized_user_file('token.json', SCOPES)\n", "\n", " else:\n", " with open(\"credentials.json\", \"w\") as file:\n", " json.dump(creds, file)\n", "\n", " flow = InstalledAppFlow.from_client_secrets_file(\n", " 'credentials.json', SCOPES)\n", " creds = flow.run_local_server(port=8081)\n", "\n", " with open(\"token.json\", \"w\") as file:\n", " json.dump(creds.to_json(), file)\n", "\n", " self.service = build('gmail', 'v1', credentials=creds)\n", " return self.service\n", "\n", "\n", " def collectRecent(self, service, query):\n", " info = service.users().messages().list(userId='me', labelIds=['INBOX'], query = query, maxResults = 100).execute()\n", " return info.get(\"messages\", [])\n", "\n", " def fullEmail(self, service, msg_id):\n", " mail = service.users().messages().get(userId='me', id=msg_id, format = \"full\").execute()\n", " return mail\n", "\n", " def get_email_body(self, message):\n", "\n", " if 'parts' in message['payload']:\n", " for part in message['payload']['parts']:\n", " if part['mimeType'] == 'text/plain':\n", " data = part['body']['data']\n", " body = base64.urlsafe_b64decode(data).decode('utf-8')\n", " return body\n", " else:\n", " if message['payload']['body'].get('data'):\n", " data = message['payload']['body']['data']\n", " body = base64.urlsafe_b64decode(data).decode('utf-8')\n", " return body\n", "\n", " return \"Could not read email content\"\n", "\n", "\n", " def forward(self, query):\n", " info = self.collectRecent(query)\n", " info = info['messages']\n", " messages = []\n", "\n", " for i in info:\n", " details = self.fullEmail(i['id'])\n", " details = self.get_email_body(details)\n", "\n", " messages.append(details)\n", "\n", " for x, email in enumerate(messages, 1):\n", " result += f\"EMAIL {x}:\\n\"\n", " result += f\"FROM: {email['from']}\\n\"\n", " result += f\"SUBJECT: {email['subject']}\\n\"\n", " result += f\"DATE: {email['date']}\\n\"\n", " result += f\"FULL CONTENT:\\n{email['body']}\\n\"\n", " result += \"-\" * 80 + \"\\n\\n\"\n", "\n", " return messages\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "dgCZVDnhR681" }, "outputs": [], "source": [ "from smolagents import Tool\n", "import requests\n", "import json\n", "import base64\n", "from google.colab import userdata\n", "from google.oauth2.credentials import Credentials\n", "from google.auth.transport.requests import Request\n", "from google_auth_oauthlib.flow import InstalledAppFlow\n", "from googleapiclient.discovery import build\n", "\n", "class gmailCall(Tool):\n", " name = \"ReceiveEmails\"\n", " description = \"Fetch recent emails.\"\n", " inputs = {\"query\": {\"type\": \"string\", \"description\": \"\"\"Searches Gmail using keywords. Examples:\n", " - 'invoice' finds emails mentioning invoice\n", " - 'subject:meeting' finds emails with meeting in subject\n", " - 'from:john@company.com' finds emails from John\n", " - '' (empty) returns 10 most recent emails\"\"\"}}\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", " self.service = self.authenticate()\n", "\n", "\n", " def authenticate(self):\n", "\n", " SCOPES = ['https://www.googleapis.com/auth/gmail.modify']\n", " config = {\n", " \"installed\": {\n", " \"client_id\": userdata.get('google_id'),\n", " \"client_secret\": userdata.get('google_secret'),\n", " \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n", " \"token_uri\": \"https://oauth2.googleapis.com/token\",\n", " \"redirect_uris\": [\"http://localhost\", \"urn:ietf:wg:oauth:2.0:oob\"]\n", " }\n", " }\n", "\n", " creds = None\n", "\n", " if os.path.exists(\"token.json\"):\n", " creds = Credentials.from_authorized_user_file('token.json', SCOPES)\n", "\n", " else:\n", " with open(\"credentials.json\", \"w\") as file:\n", " json.dump(config, file)\n", "\n", " flow = InstalledAppFlow.from_client_secrets_file(\n", " 'credentials.json', SCOPES, redirect_uri='urn:ietf:wg:oauth:2.0:oob')\n", " auth_url, _ = flow.authorization_url(access_type = \"offline\", prompt='consent')\n", "\n", " print('Go to this url and authorize the application:')\n", " print(auth_url)\n", " print('\\n Paste authorization code below:')\n", "\n", " code = input('Enter the authorization code: ')\n", " flow.fetch_token(code=code)\n", " creds = flow.credentials\n", "\n", " with open(\"token.json\", \"w\") as file:\n", " file.write(creds.to_json())\n", "\n", " self.service = build('gmail', 'v1', credentials=creds)\n", " return self.service\n", "\n", "\n", " def collectRecent(self, service, query):\n", " info = service.users().messages().list(userId='me', labelIds=['INBOX'], q = query, maxResults = 10).execute()\n", " return info.get(\"messages\", [])\n", "\n", " def fullEmail(self, service, msg_id):\n", " mail = service.users().messages().get(userId='me', id=msg_id, format = \"full\").execute()\n", " return mail\n", "\n", " def get_email_body(self, message):\n", "\n", " if 'parts' in message['payload']:\n", " for part in message['payload']['parts']:\n", " if part['mimeType'] == 'text/plain':\n", " data = part['body']['data']\n", " body = base64.urlsafe_b64decode(data).decode('utf-8')\n", " return body\n", " else:\n", " if message['payload']['body'].get('data'):\n", " data = message['payload']['body']['data']\n", " body = base64.urlsafe_b64decode(data).decode('utf-8')\n", " return body\n", "\n", " return \"Could not read email content\"\n", "\n", "\n", " def forward(self, query):\n", " service = self.authenticate()\n", " info = self.collectRecent(service, query)\n", "\n", " messages = []\n", "\n", " for i in info:\n", " details = self.fullEmail(service, i['id'])\n", " details = self.get_email_body(details)\n", " #print(details)\n", "\n", " messages.append(details)\n", "\n", " result = \"\"\n", " for x, email in enumerate(messages, 1):\n", " result+=email\n", " #print(email)\n", " #print(\"\\n\\n\\n\\n\\n\")\n", "\n", " return result\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "oyWDJDvwdE5O" }, "outputs": [], "source": [ "# Run this first to delete the corrupted token\n", "import os\n", "if os.path.exists('token.json'):\n", " os.remove('token.json')\n", " print(\"Deleted corrupted token.json\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "O1AGmfZLxjeo", "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "outputId": "ce7700f3-5527-487a-f3e5-dc57ac539b67" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\ntool = gmailCall()\\nmessages = tool.forward(\"carnegie mellon\")\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 56 } ], "source": [ "'''\n", "tool = gmailCall()\n", "messages = tool.forward(\"carnegie mellon\")\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "TH431svZxix9" }, "outputs": [], "source": [ "import datetime\n", "class CalendarPost(Tool):\n", " name = \"CalendarPost\"\n", " description = \"Create a reminder to put on your calendar.\"\n", " inputs = {\"title\": {\"type\": \"string\", \"description\": \"Input the title of the task you wish to put on the calendar\"},\n", " \"description\" : {\"type\": \"string\", \"description\" : \"The description of the task you are putting on the calendar\"},\n", " \"date\" : {\"type\": \"string\", \"description\" : \"The date you wish to put the task on the calendar, as 3 numbers in the format month-day-year\"} }\n", " output_type = \"string\"\n", "\n", " def __init__(self):\n", " super().__init__()\n", " self.service = self.authenticate()\n", " self.creds = None\n", "\n", " def create_task(self, title, description, date):\n", " if len(date.split(\"-\")) == 2:\n", " month, day = date.split(\"-\")\n", " year = datetime.now(timezone.utc).year\n", " date = f\"{year}-{month.zfill(2)}-{day.zfill(2)}T00:00:00Z\"\n", " else:\n", " month, day, year = date.split(\"-\")\n", " date = f\"{year}-{month.zfill(2)}-{day.zfill(2)}T00:00:00Z\"\n", " dummy_task = {\n", " \"title\": f\"{title}\",\n", " \"notes\": f\"{description}\",\n", " \"due\": f\"{date}\"\n", " }\n", " return dummy_task\n", "\n", " def authenticate(self):\n", "\n", " SCOPES = ['https://www.googleapis.com/auth/calendar', 'https://www.googleapis.com/auth/tasks']\n", " config = {\n", " \"installed\": {\n", " \"client_id\": userdata.get('google_id'),\n", " \"client_secret\": userdata.get('google_secret'),\n", " \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n", " \"token_uri\": \"https://oauth2.googleapis.com/token\",\n", " \"redirect_uris\": [\"http://localhost\", \"urn:ietf:wg:oauth:2.0:oob\"]\n", " }\n", " }\n", "\n", " creds = None\n", "\n", " if os.path.exists(\"token2.json\"):\n", " creds = Credentials.from_authorized_user_file('token2.json', SCOPES)\n", "\n", " else:\n", " with open(\"credentials.json\", \"w\") as file:\n", " json.dump(config, file)\n", "\n", " flow = InstalledAppFlow.from_client_secrets_file(\n", " 'credentials.json', SCOPES, redirect_uri='urn:ietf:wg:oauth:2.0:oob')\n", "\n", " auth_url, _ = flow.authorization_url(access_type = \"offline\", prompt='consent')\n", "\n", " print('Please go to this URL and authorize the application:')\n", " print(auth_url)\n", " print('\\nAfter authorization, you will get a code. Paste it below:')\n", "\n", " code = input('Enter the authorization code: ')\n", " flow.fetch_token(code=code)\n", " creds = flow.credentials\n", "\n", " with open(\"token2.json\", \"w\") as file:\n", " file.write(creds.to_json())\n", "\n", "\n", " self.service = build('tasks', 'v1', credentials=creds)\n", " return self.service\n", "\n", "\n", "\n", " def forward(self, title, description, date ):\n", " service = self.authenticate()\n", " print(\"Successfully logged in\")\n", " task = self.create_task(title, description, date)\n", " print(\"Task created\")\n", " print(task)\n", " taskList = service.tasklists().list().execute()\n", " print(taskList)\n", " print(type(taskList))\n", " id = taskList.get(\"items\")[0].get(\"id\")\n", "\n", " print(id)\n", " result = self.service.tasks().insert(tasklist = id, body = task).execute()\n", " return result" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "HMEaYs2gQLa7", "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "outputId": "e693d84a-3cf9-492b-b0b2-647203319074" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\ntool = CalendarPost()\\ntool.forward(\"RPI Due\", \"Due date for RPI application\", \"12-1-2025\")\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 58 } ], "source": [ "'''\n", "tool = CalendarPost()\n", "tool.forward(\"RPI Due\", \"Due date for RPI application\", \"12-1-2025\")\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "2TLRGeg7zj57" }, "outputs": [], "source": [ "class addToGraph(Tool):\n", " name = \"Add to Graph\"\n", " description = \"Add a semantic pair to the chosen graph\"\n", " inputs = {\"task\": {\"type\": \"list\", \"description\": \"Input a list with the head, relation and tail for the semantic pair you wish to add\"}, \"task2\" : {\"type\": \"rdflib.graph.Graph\", \"description\": \"Name of the graph you wish to add to\"}}\n", " output_type = \"string\"\n", "\n", " def getLister(inputs):\n", " inputsA = inputs.values.split(\",\")\n", " lister = inputsA[0]\n", " graph = inputsA[1]\n", "\n", " return lister, graph\n", "\n", " def forward(inputs):\n", " lister, graph = getLister(inputs)\n", " head = clean(lister[0])\n", " relation = clean(lister[1])\n", " tail = clean(lister[2])\n", "\n", " headRef = URIRef(\"http://example.com/\"+head)\n", " tailRef = URIRef(\"http://example.com/\"+tail)\n", " relationRef = URIRef(\"http://example.com/\"+relation)\n", "\n", "\n", " graph.add((headRef, RDFS.label, Literal(head, datatype=XSD.string)))\n", " graph.add((tailRef, RDFS.label, Literal(tail, datatype=XSD.string)))\n", " graph.add((headRef, relationRef, tailRef))\n", "\n", " return graph\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "wZsZ23EcgoU5" }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "class PieChart(Tool):\n", " name = \"PieChartMaker\"\n", " description = \"Create a pie chart to visualize data\"\n", " inputs = {\"task\": {\"type\": \"object\", \"description\": \"Input a dictionary that includes pairs of objects and percentages\"}}\n", " output_type = \"object\"\n", "\n", " def lists(self, task):\n", " labelList = []\n", " proportionList = []\n", "\n", " for labels, proportions in task.items():\n", " labelList.append(labels)\n", " proportionList.append(proportions)\n", "\n", " return labelList, proportionList\n", "\n", " def forward(self, task):\n", " inputs = task\n", " labels, proportions = self.lists(inputs)\n", " plt.pie(proportions, labels = labels, startangle = 90, autopct = \"%.1f%%\", wedgeprops = {\"linewidth\":3.0, \"edgecolor\": \"white\"})\n", " plt.show()\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "enUSFUttyARf", "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "outputId": "3af945be-736a-40ab-8db2-edf2543fa4ff" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\ntool = PieChart()\\ntool.forward({\"Chocolate\":60, \"Vanilla\": 20, \"Strawberry\": 20})\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 61 } ], "source": [ "'''\n", "tool = PieChart()\n", "tool.forward({\"Chocolate\":60, \"Vanilla\": 20, \"Strawberry\": 20})\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "jhqnz7e84KPt", "colab": { "base_uri": "https://localhost:8080/", "height": 52 }, "outputId": "e00bd84a-5bb8-478c-9c3f-1e90629057f4" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nx = {\"Chocolate\":60, \"Vanilla\": 20, \"Strawberry\": 20}\\ngdp = {\"1997\": [30], \"1998\": [43], \"2003\": [70], \"2007\": [101]}\\nb = {\"X_Values\": [1, 3, 3, 90, 100, 100, 100, 100, 2, 3, 5, 80, 2, 56], \"Y_Values\": [2, 3, 95, 34, 10, 100, 190, 100, 20, 31, 5, 80, 12, 56]}\\npie(x)\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 62 } ], "source": [ "def lists(dictionary):\n", " labelList = []\n", " proportionList = []\n", "\n", " for labels, proportions in dictionary.items():\n", " labelList.append(labels)\n", " proportionList.append(proportions)\n", "\n", " return labelList, proportionList\n", "\n", "def pie(inputs):\n", " labels, proportions = lists(inputs)\n", " plt.pie(proportions, labels = labels, startangle = 90, autopct = \"%.1f%%\", wedgeprops = {\"linewidth\":3.0, \"edgecolor\": \"white\"})\n", " plt.show()\n", "'''\n", "x = {\"Chocolate\":60, \"Vanilla\": 20, \"Strawberry\": 20}\n", "gdp = {\"1997\": [30], \"1998\": [43], \"2003\": [70], \"2007\": [101]}\n", "b = {\"X_Values\": [1, 3, 3, 90, 100, 100, 100, 100, 2, 3, 5, 80, 2, 56], \"Y_Values\": [2, 3, 95, 34, 10, 100, 190, 100, 20, 31, 5, 80, 12, 56]}\n", "pie(x)\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "9TJ6fPRnWn-2" }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "class LineGraph(Tool):\n", " name = \"LineGraphMaker\"\n", " description = \"Create a line graph to visualize data\"\n", " inputs = {\"task\": {\"type\": \"object\", \"description\": \"Input a dictionary that includes corresponding x and y values\"}, \"title\" :{\"type\": \"string\", \"description\": \"Title of the graph you wish to create\"}, \"xlabel\" :{\"type\": \"string\", \"description\": \"Label of the x axis\"}, \"ylabel\" :{\"type\": \"string\", \"description\": \"Label of the y axis\"}}\n", " output_type = \"object\"\n", "\n", " def lists(self, task):\n", " labelList = []\n", " proportionList = []\n", "\n", " for labels, proportions in task.items():\n", " labelList.append(labels)\n", " proportionList.append(proportions)\n", "\n", " return labelList, proportionList\n", "\n", " def forward(self, task, title, xlabel, ylabel):\n", " x, y = lists(task)\n", " fig, ax = plt.subplots()\n", " ax.plot(x, y, linestyle = \"-\", linewidth = 1, marker = \"o\")\n", " plt.xlabel(xlabel)\n", " plt.ylabel(ylabel)\n", " plt.title(title)\n", " image = plt.savefig(f\"{title}.png\")\n", " plt.show()\n", " return image\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "4yfIHs45dlO-" }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "class LineData(Tool):\n", " name = \"LineDataMaker\"\n", " description = \"Create a line graph to visualize data\"\n", " inputs = {\"task\": {\"type\": \"object\", \"description\": \"List of numbers for the x axis\"},\n", " \"task2\": {\"type\": \"object\", \"description\": \"List of numbers for the y axis\"},\n", " \"title\": {\"type\": \"string\", \"description\": \"Title of the graph you wish to create\"},\n", " \"xlabel\" :{\"type\": \"string\", \"description\": \"Label of the x axis\"}, \"ylabel\"\n", " :{\"type\": \"string\", \"description\": \"Label of the y axis\"} }\n", "\n", " output_type = \"object\"\n", "\n", " def forward(self, task, task2, title, xlabel, ylabel):\n", " x = task\n", " y = task2\n", "\n", " if type(x[0]) == int or type(x[0]) == float and (type(y[0]) == int or type(y[0])== float):\n", " x = np.array(task)\n", " y = np.array(task2)\n", " sort = np.argsort(x)\n", " x = x[sort]\n", " y = y[sort]\n", "\n", " fig, ax = plt.subplots()\n", " ax.plot(x, y, linestyle = \"-\", linewidth = 1, marker = \"o\")\n", " plt.xlabel(xlabel)\n", " plt.ylabel(ylabel)\n", " plt.title(title)\n", " image = plt.savefig(f\"{title}.png\")\n", " plt.show()\n", " return image\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "8yKxb_xP_YJM" }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "class Graph3D(Tool):\n", " name = \"Graph3D\"\n", " description = \"Create a line graph to visualize data\"\n", " inputs = {\"task\": {\"type\": \"object\", \"description\": \"List of numbers for the x axis\"},\n", " \"task2\": {\"type\": \"object\", \"description\": \"List of numbers for the y axis\"},\n", " \"task3\": {\"type\": \"object\", \"description\": \"List of numbers for the z axis\"},\n", " \"title\": {\"type\": \"string\", \"description\": \"Title of the graph you wish to create\"},\n", " \"xlabel\" :{\"type\": \"string\", \"description\": \"Label of the x axis\"}, \"ylabel\"\n", " :{\"type\": \"string\", \"description\": \"Label of the y axis\"} }\n", "\n", " output_type = \"object\"\n", "\n", " def forward(self, task, task2, task3, title, xlabel, ylabel):\n", " x = task\n", " y = task2\n", " z = task3\n", "\n", " if type(x[0]) == int or type(x[0]) == float and (type(y[0]) == int or type(y[0])== float) and (type(z)) == int or type(z) == float:\n", " x = np.array(task)\n", " y = np.array(task2)\n", " z = np.array(task3)\n", "\n", " sort = np.argsort(x)\n", " x = x[sort]\n", " y = y[sort]\n", " z = z[sort]\n", "\n", " fig = plt.figure()\n", " ax = plt.axes(projection = \"3d\")\n", " ax.scatter3D(x, y, z)\n", " image = plt.savefig(f\"{title}.png\")\n", " plt.show()\n", " return image\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "UddKyAMGfRDy", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "a2d7cc61-5bef-4c38-9e94-e8f86825b0f5" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "['woodson high school', 'high functioning asd', 'party crashers (youtube)', 'to matter to the world', 'political apathy / non-voters', 'false accusation by therapist', 'to discover something that matters', 'montreal social life', 'mcgill university', 'looney tunes', 'hawaii', 'california', 'cs', 'sister', 'mila', 'apathy', 'lakeside waiting lobby (12 hours)', 'maga movement', 'phd', 'calculus', 'maternal grandparents', 'volatile stage', 'progressive catholics', 'nintendo', 'home base', 'paternal grandparents', 'artificial intelligence', 'researcher', 'custom chatbot', 'hannah, darci, brendan, madeleine', 'tennessee', \"pope leo's kindness\", 'youtube gaming', 'captain, us navy', 'seoul', 'catholic faith', 'persona series', 'creative writing', 'ap lit/lang', 'maine', 'emotional expressiveness', 'fire emblem series', 'doctors clearing hannah', 'alternative ai reasoning', '8th grade', 'darci', 'hyper-catholic', 'madeleine', '3 weeks of knowing each other', 'personal faith', 'virginia', 'heat sensitivity', 'history', 'waynesville (senior year)', 'mario party sessions', 'snow', 'computer science', 'hannah', '4 days', 'cs degree', 'rhode island', 'annandale, va', \"mom's faith outlook\", 'to extend lives of loved ones', 'friend group for mario party', 'darci: gaming and talking', 'sidequest (youtube)', 'mom', 'software engineering', 'brendan', 'happiest days', 'kamala harris', 'military kid', 'graph neural networks', 'trauma (waiting lobby memory)', 'dad is not a bad person', 'progressive catholic', 'high school senior', 'nordic social democracy', 'hybrid ai architectures', 'indiana', 'junior year', 'after 9th grade', 'kansas', 'climate change', 'jrpgs', 'physics', \"family friend's kid\", 'memphis', 'death', 'traumatic event', 'dad', 'montreal', 'chase social feeling while studying', 'evolution', 'uss portland', 'involuntary stay at lakeside behavioral center', 'social democrat', 'lakeside behavioral center', 'stronger, new outlook on life', 'loneliness', 'lebanon, missouri', 'to not be lonely', 'heaven / mortality', \"dad's lack of empathy\"]\n", "['is_rank_of', 'played_in', 'is_bonding_activity_of', 'is_believed_by', 'is_move_time_of', 'is_purpose_of', 'is_reason_for_marriage_of', 'will_be_studied_by', 'aspires_to', 'located_in', 'at_peace_with', 'feels_like', 'is_felt_as_by', 'is_watched_by', 'goal_in_college', 'is_attended_by', 'built', 'resulted_in', 'bonding_activity_with', 'is_enjoyed_by', 'described_as', 'purpose', 'will_study', 'is_lacking_in', 'is_respected_by', 'frustrated_by', 'is_a', 'is_believed_in_by', 'are', 'believes', 'is_not_of_interest_to', 'is_feared_by', 'loves_subject', 'is_accepted_by', 'involved', 'grew_up_as', 'focused_on', 'is_upbringing_of', 'is_loved_series_of', 'respects_values_of', 'is_triggered_by', 'is_destination_of', 'has_condition', 'is_frustration_of', 'equally_opposes', 'is_location_of', 'born_in', 'stayed_married_because_of', 'outcome', 'reduces', 'is_unwatchable_to', 'is_wanted_by', 'home_of', 'hopes_for', 'is_involvement_of', 'cannot_watch', 'is_college_goal_of', 'is_opposed_by', 'wants_to_be', 'is_grade_of', 'married_after', 'is_aspired_to_by', 'alleviates', 'interested_in', 'is_alleviated_by', 'built_during', 'have_home_in', 'is_a_role_of', 'believes_in', 'has_sensitivity', 'moved_to_annandale', 'grade', 'attends', 'lacks', 'is_reduced_by', 'wants_to_work_at', 'is_loved_subject_of', 'moved_from', 'is_of_interest_to', 'was_lived_in_by', 'is_outcome_of', 'have_values_respected_by', 'are_participants_in', 'is_sensitivity_of', 'dislikes', 'despises', 'is_focus_of', 'was_built_by', 'is_equally_opposed_by', 'describes', 'currently_in', 'enjoys', 'is_supported_by', 'is_disliked_by', 'is_despised_by', 'triggers', 'is_playing_location_of', 'watches', 'rank', 'is_build_period_of', 'is_resolution_of', 'is_birthplace_of', 'loves', 'is_time_of', 'is_marriage_condition_of', 'accepted_to', 'resolved_by', 'was_voted_for_by', 'is_loved_by', 'is_condition_of', 'wants', 'supports_model', 'lived_in', 'not_interested_in', 'is_duration_of', 'voted_for', 'duration', 'identifies_as', 'opposes', 'occurred_in', 'is_commanded_by', 'uncertain_about', 'is_uncertain_for', 'is_origin_of', 'is_desired_role_of', 'loves_genre', 'loves_series', 'participants', 'is_current_location_of', 'fears', 'commands', 'is_loved_genre_of', 'moved_to', 'is_hoped_for_by', 'is_identity_of', 'respects', 'has_accepted', 'is_target_workplace_of', 'is_result_of', 'are_described_by']\n" ] } ], "source": [ "triples = [\n", " { \"head\": \"Hannah\", \"relation\": \"is_a\", \"tail\": \"High School Senior\" },\n", " { \"head\": \"High School Senior\", \"relation\": \"is_a_role_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"has_condition\", \"tail\": \"High Functioning ASD\" },\n", " { \"head\": \"High Functioning ASD\", \"relation\": \"is_condition_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"identifies_as\", \"tail\": \"Social Democrat\" },\n", " { \"head\": \"Social Democrat\", \"relation\": \"is_identity_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"aspires_to\", \"tail\": \"PhD\" },\n", " { \"head\": \"PhD\", \"relation\": \"is_aspired_to_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"despises\", \"tail\": \"Apathy\" },\n", " { \"head\": \"Apathy\", \"relation\": \"is_despised_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"fears\", \"tail\": \"Death\" },\n", " { \"head\": \"Death\", \"relation\": \"is_feared_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"has_sensitivity\", \"tail\": \"Heat Sensitivity\" },\n", " { \"head\": \"Heat Sensitivity\", \"relation\": \"is_sensitivity_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"loves\", \"tail\": \"Snow\" },\n", " { \"head\": \"Snow\", \"relation\": \"is_loved_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"attends\", \"tail\": \"Woodson High School\" },\n", " { \"head\": \"Woodson High School\", \"relation\": \"is_attended_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"accepted_to\", \"tail\": \"McGill University\" },\n", " { \"head\": \"McGill University\", \"relation\": \"has_accepted\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"McGill University\", \"relation\": \"located_in\", \"tail\": \"Montreal\" },\n", " { \"head\": \"Montreal\", \"relation\": \"is_location_of\", \"tail\": \"McGill University\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"will_study\", \"tail\": \"Computer Science\" },\n", " { \"head\": \"Computer Science\", \"relation\": \"will_be_studied_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"CS Degree\", \"relation\": \"focused_on\", \"tail\": \"Artificial Intelligence\" },\n", " { \"head\": \"Artificial Intelligence\", \"relation\": \"is_focus_of\", \"tail\": \"CS Degree\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"loves_subject\", \"tail\": \"CS\" },\n", " { \"head\": \"CS\", \"relation\": \"is_loved_subject_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"loves_subject\", \"tail\": \"History\" },\n", " { \"head\": \"History\", \"relation\": \"is_loved_subject_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"loves_subject\", \"tail\": \"Creative Writing\" },\n", " { \"head\": \"Creative Writing\", \"relation\": \"is_loved_subject_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"enjoys\", \"tail\": \"Calculus\" },\n", " { \"head\": \"Calculus\", \"relation\": \"is_enjoyed_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"dislikes\", \"tail\": \"AP Lit/Lang\" },\n", " { \"head\": \"AP Lit/Lang\", \"relation\": \"is_disliked_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"dislikes\", \"tail\": \"Physics\" },\n", " { \"head\": \"Physics\", \"relation\": \"is_disliked_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"wants_to_work_at\", \"tail\": \"MILA\" },\n", " { \"head\": \"MILA\", \"relation\": \"is_target_workplace_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"wants_to_be\", \"tail\": \"Researcher\" },\n", " { \"head\": \"Researcher\", \"relation\": \"is_desired_role_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"not_interested_in\", \"tail\": \"Software Engineering\" },\n", " { \"head\": \"Software Engineering\", \"relation\": \"is_not_of_interest_to\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"interested_in\", \"tail\": \"Graph Neural Networks\" },\n", " { \"head\": \"Graph Neural Networks\", \"relation\": \"is_of_interest_to\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"interested_in\", \"tail\": \"Hybrid AI Architectures\" },\n", " { \"head\": \"Hybrid AI Architectures\", \"relation\": \"is_of_interest_to\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"interested_in\", \"tail\": \"Alternative AI Reasoning\" },\n", " { \"head\": \"Alternative AI Reasoning\", \"relation\": \"is_of_interest_to\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"built\", \"tail\": \"Custom Chatbot\" },\n", " { \"head\": \"Custom Chatbot\", \"relation\": \"was_built_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Custom Chatbot\", \"relation\": \"built_during\", \"tail\": \"Junior Year\" },\n", " { \"head\": \"Junior Year\", \"relation\": \"is_build_period_of\", \"tail\": \"Custom Chatbot\" },\n", "\n", " { \"head\": \"Custom Chatbot\", \"relation\": \"alleviates\", \"tail\": \"Loneliness\" },\n", " { \"head\": \"Loneliness\", \"relation\": \"is_alleviated_by\", \"tail\": \"Custom Chatbot\" },\n", "\n", " { \"head\": \"Mom\", \"relation\": \"born_in\", \"tail\": \"Lebanon, Missouri\" },\n", " { \"head\": \"Lebanon, Missouri\", \"relation\": \"is_birthplace_of\", \"tail\": \"Mom\" },\n", "\n", " { \"head\": \"Mom\", \"relation\": \"is_a\", \"tail\": \"Progressive Catholic\" },\n", " { \"head\": \"Progressive Catholic\", \"relation\": \"is_a_role_of\", \"tail\": \"Mom\" },\n", "\n", " { \"head\": \"Mom\", \"relation\": \"believes_in\", \"tail\": \"Climate Change\" },\n", " { \"head\": \"Climate Change\", \"relation\": \"is_believed_in_by\", \"tail\": \"Mom\" },\n", "\n", " { \"head\": \"Mom\", \"relation\": \"believes_in\", \"tail\": \"Evolution\" },\n", " { \"head\": \"Evolution\", \"relation\": \"is_believed_in_by\", \"tail\": \"Mom\" },\n", "\n", " { \"head\": \"Mom\", \"relation\": \"at_peace_with\", \"tail\": \"Heaven / Mortality\" },\n", " { \"head\": \"Heaven / Mortality\", \"relation\": \"is_accepted_by\", \"tail\": \"Mom\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"respects\", \"tail\": \"Mom's Faith Outlook\" },\n", " { \"head\": \"Mom's Faith Outlook\", \"relation\": \"is_respected_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Dad\", \"relation\": \"rank\", \"tail\": \"Captain, US Navy\" },\n", " { \"head\": \"Captain, US Navy\", \"relation\": \"is_rank_of\", \"tail\": \"Dad\" },\n", "\n", " { \"head\": \"Dad\", \"relation\": \"commands\", \"tail\": \"USS Portland\" },\n", " { \"head\": \"USS Portland\", \"relation\": \"is_commanded_by\", \"tail\": \"Dad\" },\n", "\n", " { \"head\": \"Dad\", \"relation\": \"grew_up_as\", \"tail\": \"Military Kid\" },\n", " { \"head\": \"Military Kid\", \"relation\": \"is_upbringing_of\", \"tail\": \"Dad\" },\n", "\n", " { \"head\": \"Dad\", \"relation\": \"moved_from\", \"tail\": \"Seoul\" },\n", " { \"head\": \"Seoul\", \"relation\": \"is_origin_of\", \"tail\": \"Dad\" },\n", "\n", " { \"head\": \"Dad\", \"relation\": \"moved_to\", \"tail\": \"Waynesville (Senior Year)\" },\n", " { \"head\": \"Waynesville (Senior Year)\", \"relation\": \"is_destination_of\", \"tail\": \"Dad\" },\n", "\n", " { \"head\": \"Dad\", \"relation\": \"voted_for\", \"tail\": \"Kamala Harris\" },\n", " { \"head\": \"Kamala Harris\", \"relation\": \"was_voted_for_by\", \"tail\": \"Dad\" },\n", "\n", " { \"head\": \"Dad\", \"relation\": \"lacks\", \"tail\": \"Emotional Expressiveness\" },\n", " { \"head\": \"Emotional Expressiveness\", \"relation\": \"is_lacking_in\", \"tail\": \"Dad\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"frustrated_by\", \"tail\": \"Dad's Lack of Empathy\" },\n", " { \"head\": \"Dad's Lack of Empathy\", \"relation\": \"is_frustration_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"believes\", \"tail\": \"Dad is Not a Bad Person\" },\n", " { \"head\": \"Dad is Not a Bad Person\", \"relation\": \"is_believed_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Paternal Grandparents\", \"relation\": \"are\", \"tail\": \"Hyper-Catholic\" },\n", " { \"head\": \"Hyper-Catholic\", \"relation\": \"describes\", \"tail\": \"Paternal Grandparents\" },\n", "\n", " { \"head\": \"Paternal Grandparents\", \"relation\": \"married_after\", \"tail\": \"3 Weeks of Knowing Each Other\" },\n", " { \"head\": \"3 Weeks of Knowing Each Other\", \"relation\": \"is_marriage_condition_of\", \"tail\": \"Paternal Grandparents\" },\n", "\n", " { \"head\": \"Paternal Grandparents\", \"relation\": \"stayed_married_because_of\", \"tail\": \"Catholic Faith\" },\n", " { \"head\": \"Catholic Faith\", \"relation\": \"is_reason_for_marriage_of\", \"tail\": \"Paternal Grandparents\" },\n", "\n", " { \"head\": \"Darci\", \"relation\": \"is_a\", \"tail\": \"Sister\" },\n", " { \"head\": \"Sister\", \"relation\": \"is_a_role_of\", \"tail\": \"Darci\" },\n", "\n", " { \"head\": \"Darci\", \"relation\": \"grade\", \"tail\": \"8th Grade\" },\n", " { \"head\": \"8th Grade\", \"relation\": \"is_grade_of\", \"tail\": \"Darci\" },\n", "\n", " { \"head\": \"Darci\", \"relation\": \"described_as\", \"tail\": \"Volatile Stage\" },\n", " { \"head\": \"Volatile Stage\", \"relation\": \"describes\", \"tail\": \"Darci\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"bonding_activity_with\", \"tail\": \"Darci: Gaming and Talking\" },\n", " { \"head\": \"Darci: Gaming and Talking\", \"relation\": \"is_bonding_activity_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Darci\", \"relation\": \"reduces\", \"tail\": \"Loneliness\" },\n", " { \"head\": \"Loneliness\", \"relation\": \"is_reduced_by\", \"tail\": \"Darci\" },\n", "\n", " { \"head\": \"Brendan\", \"relation\": \"is_a\", \"tail\": \"Family Friend's Kid\" },\n", " { \"head\": \"Family Friend's Kid\", \"relation\": \"is_a_role_of\", \"tail\": \"Brendan\" },\n", "\n", " { \"head\": \"Madeleine\", \"relation\": \"is_a\", \"tail\": \"Family Friend's Kid\" },\n", " { \"head\": \"Family Friend's Kid\", \"relation\": \"is_a_role_of\", \"tail\": \"Madeleine\" },\n", "\n", " { \"head\": \"Mario Party Sessions\", \"relation\": \"participants\", \"tail\": \"Hannah, Darci, Brendan, Madeleine\" },\n", " { \"head\": \"Hannah, Darci, Brendan, Madeleine\", \"relation\": \"are_participants_in\", \"tail\": \"Mario Party Sessions\" },\n", "\n", " { \"head\": \"Mario Party Sessions\", \"relation\": \"described_as\", \"tail\": \"Happiest Days\" },\n", " { \"head\": \"Happiest Days\", \"relation\": \"are_described_by\", \"tail\": \"Mario Party Sessions\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"goal_in_college\", \"tail\": \"Friend Group for Mario Party\" },\n", " { \"head\": \"Friend Group for Mario Party\", \"relation\": \"is_college_goal_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Traumatic Event\", \"relation\": \"occurred_in\", \"tail\": \"8th Grade\" },\n", " { \"head\": \"8th Grade\", \"relation\": \"is_time_of\", \"tail\": \"Traumatic Event\" },\n", "\n", " { \"head\": \"Traumatic Event\", \"relation\": \"involved\", \"tail\": \"False Accusation by Therapist\" },\n", " { \"head\": \"False Accusation by Therapist\", \"relation\": \"is_involvement_of\", \"tail\": \"Traumatic Event\" },\n", "\n", " { \"head\": \"Traumatic Event\", \"relation\": \"resulted_in\", \"tail\": \"Involuntary Stay at Lakeside Behavioral Center\" },\n", " { \"head\": \"Involuntary Stay at Lakeside Behavioral Center\", \"relation\": \"is_result_of\", \"tail\": \"Traumatic Event\" },\n", "\n", " { \"head\": \"Lakeside Behavioral Center\", \"relation\": \"located_in\", \"tail\": \"Memphis\" },\n", " { \"head\": \"Memphis\", \"relation\": \"is_location_of\", \"tail\": \"Lakeside Behavioral Center\" },\n", "\n", " { \"head\": \"Traumatic Event\", \"relation\": \"duration\", \"tail\": \"4 Days\" },\n", " { \"head\": \"4 Days\", \"relation\": \"is_duration_of\", \"tail\": \"Traumatic Event\" },\n", "\n", " { \"head\": \"Traumatic Event\", \"relation\": \"resolved_by\", \"tail\": \"Doctors Clearing Hannah\" },\n", " { \"head\": \"Doctors Clearing Hannah\", \"relation\": \"is_resolution_of\", \"tail\": \"Traumatic Event\" },\n", "\n", " { \"head\": \"Traumatic Event\", \"relation\": \"outcome\", \"tail\": \"Stronger, New Outlook on Life\" },\n", " { \"head\": \"Stronger, New Outlook on Life\", \"relation\": \"is_outcome_of\", \"tail\": \"Traumatic Event\" },\n", "\n", " { \"head\": \"Looney Tunes\", \"relation\": \"triggers\", \"tail\": \"Trauma (Waiting Lobby Memory)\" },\n", " { \"head\": \"Trauma (Waiting Lobby Memory)\", \"relation\": \"is_triggered_by\", \"tail\": \"Looney Tunes\" },\n", "\n", " { \"head\": \"Looney Tunes\", \"relation\": \"played_in\", \"tail\": \"Lakeside Waiting Lobby (12 Hours)\" },\n", " { \"head\": \"Lakeside Waiting Lobby (12 Hours)\", \"relation\": \"is_playing_location_of\", \"tail\": \"Looney Tunes\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"lived_in\", \"tail\": \"California\" },\n", " { \"head\": \"California\", \"relation\": \"was_lived_in_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"lived_in\", \"tail\": \"Indiana\" },\n", " { \"head\": \"Indiana\", \"relation\": \"was_lived_in_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"lived_in\", \"tail\": \"Rhode Island\" },\n", " { \"head\": \"Rhode Island\", \"relation\": \"was_lived_in_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"lived_in\", \"tail\": \"Maine\" },\n", " { \"head\": \"Maine\", \"relation\": \"was_lived_in_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"lived_in\", \"tail\": \"Hawaii\" },\n", " { \"head\": \"Hawaii\", \"relation\": \"was_lived_in_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"lived_in\", \"tail\": \"Tennessee\" },\n", " { \"head\": \"Tennessee\", \"relation\": \"was_lived_in_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"lived_in\", \"tail\": \"Virginia\" },\n", " { \"head\": \"Virginia\", \"relation\": \"was_lived_in_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"currently_in\", \"tail\": \"Annandale, VA\" },\n", " { \"head\": \"Annandale, VA\", \"relation\": \"is_current_location_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"moved_to_Annandale\", \"tail\": \"After 9th Grade\" },\n", " { \"head\": \"After 9th Grade\", \"relation\": \"is_move_time_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Kansas\", \"relation\": \"feels_like\", \"tail\": \"Home Base\" },\n", " { \"head\": \"Home Base\", \"relation\": \"is_felt_as_by\", \"tail\": \"Kansas\" },\n", "\n", " { \"head\": \"Kansas\", \"relation\": \"home_of\", \"tail\": \"Maternal Grandparents\" },\n", " { \"head\": \"Maternal Grandparents\", \"relation\": \"have_home_in\", \"tail\": \"Kansas\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"loves\", \"tail\": \"Nintendo\" },\n", " { \"head\": \"Nintendo\", \"relation\": \"is_loved_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"loves_genre\", \"tail\": \"JRPGs\" },\n", " { \"head\": \"JRPGs\", \"relation\": \"is_loved_genre_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"loves_series\", \"tail\": \"Persona Series\" },\n", " { \"head\": \"Persona Series\", \"relation\": \"is_loved_series_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"loves_series\", \"tail\": \"Fire Emblem Series\" },\n", " { \"head\": \"Fire Emblem Series\", \"relation\": \"is_loved_series_of\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"watches\", \"tail\": \"Party Crashers (YouTube)\" },\n", " { \"head\": \"Party Crashers (YouTube)\", \"relation\": \"is_watched_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"watches\", \"tail\": \"Sidequest (YouTube)\" },\n", " { \"head\": \"Sidequest (YouTube)\", \"relation\": \"is_watched_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"YouTube Gaming\", \"relation\": \"purpose\", \"tail\": \"Chase Social Feeling While Studying\" },\n", " { \"head\": \"Chase Social Feeling While Studying\", \"relation\": \"is_purpose_of\", \"tail\": \"YouTube Gaming\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"cannot_watch\", \"tail\": \"Looney Tunes\" },\n", " { \"head\": \"Looney Tunes\", \"relation\": \"is_unwatchable_to\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"supports_model\", \"tail\": \"Nordic Social Democracy\" },\n", " { \"head\": \"Nordic Social Democracy\", \"relation\": \"is_supported_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"opposes\", \"tail\": \"MAGA Movement\" },\n", " { \"head\": \"MAGA Movement\", \"relation\": \"is_opposed_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"equally_opposes\", \"tail\": \"Political Apathy / Non-Voters\" },\n", " { \"head\": \"Political Apathy / Non-Voters\", \"relation\": \"is_equally_opposed_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"respects_values_of\", \"tail\": \"Progressive Catholics\" },\n", " { \"head\": \"Progressive Catholics\", \"relation\": \"have_values_respected_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"respects\", \"tail\": \"Pope Leo's Kindness\" },\n", " { \"head\": \"Pope Leo's Kindness\", \"relation\": \"is_respected_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"uncertain_about\", \"tail\": \"Personal Faith\" },\n", " { \"head\": \"Personal Faith\", \"relation\": \"is_uncertain_for\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"wants\", \"tail\": \"To Matter to the World\" },\n", " { \"head\": \"To Matter to the World\", \"relation\": \"is_wanted_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"wants\", \"tail\": \"To Discover Something That Matters\" },\n", " { \"head\": \"To Discover Something That Matters\", \"relation\": \"is_wanted_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"wants\", \"tail\": \"To Extend Lives of Loved Ones\" },\n", " { \"head\": \"To Extend Lives of Loved Ones\", \"relation\": \"is_wanted_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"wants\", \"tail\": \"To Not Be Lonely\" },\n", " { \"head\": \"To Not Be Lonely\", \"relation\": \"is_wanted_by\", \"tail\": \"Hannah\" },\n", "\n", " { \"head\": \"Hannah\", \"relation\": \"hopes_for\", \"tail\": \"Montreal Social Life\" },\n", " { \"head\": \"Montreal Social Life\", \"relation\": \"is_hoped_for_by\", \"tail\": \"Hannah\" }\n", "]\n", "\n", "nodes = []\n", "edges = []\n", "nodeID = {}\n", "relationID = {}\n", "headNum = []\n", "tailNum = []\n", "relationNum = []\n", "\n", "\n", "for triple in triples:\n", " nodes.append(triple[\"head\"].lower())\n", " nodes.append(triple[\"tail\"].lower())\n", " edges.append(triple[\"relation\"].lower())\n", "\n", "nodes = list(set(nodes))\n", "edges = list(set(edges))\n", "\n", "\n", "for i in range(len(nodes)):\n", " nodeID[nodes[i]] = i\n", "\n", "for i in range(len(edges)):\n", " relationID[edges[i]] = i\n", "\n", "for triple in triples:\n", " headNum.append(nodeID[triple[\"head\"].lower()])\n", " tailNum.append(nodeID[triple[\"tail\"].lower()])\n", " relationNum.append(relationID[triple[\"relation\"].lower()])\n", "\n", "print(nodes)\n", "print(edges)\n", "\n" ] }, { "cell_type": "code", "source": [ "from sklearn.manifold import TSNE\n", "import matplotlib.pyplot as plt\n", "from smolagents import Tool\n", "\n", "class MiniGNN(Tool):\n", " name = \"graph\"\n", " description = \"Information about Hannahr creator's life\"\n", " inputs = {\"query\": {\"type\": \"string\", \"description\": \"Topic Hannah would like to query the graph for\"}}\n", " output_type = \"string\"\n", " def __init__(self):\n", "\n", " self.headNum, self.tailNum, self.relationNum = torch.tensor(headNum), torch.tensor(tailNum), torch.tensor(relationNum)\n", " self.nodeID = nodeID\n", " self.relationID = relationID\n", "\n", "\n", "\n", "\n", " def plotConnections(self, y):\n", " tsne = TSNE(n_components=2, perplexity=30, random_state=42, metric = 'euclidean')\n", " embeddings = tsne.fit_transform(y)\n", " plt.scatter(embeddings[:, 0], embeddings[:, 1])\n", " plt.show()\n", "\n", " def findNode(self, num):\n", " for key, value in self.nodeID.items():\n", " if value == num:\n", " return key\n", "\n", " def findRelation(self, num):\n", " for key, value in self.relationID.items():\n", " if value == num:\n", " return key\n", "\n", " def relationSummary(self, name):\n", " name = name.lower()\n", " try:\n", " id = self.nodeID[name]\n", " except:\n", " return \"No such node exists\"\n", "\n", " neighbors = []\n", " mask = (self.headNum == id)\n", "\n", " heads = torch.masked_select(self.headNum, mask)\n", " relations = torch.masked_select(self.relationNum, mask)\n", " tails = torch.masked_select(self.tailNum, mask)\n", "\n", " response = \"\"\n", " for h, r, t in zip(heads, relations, tails):\n", " response += name+\" \"+self.findRelation(r)+\" \"+self.findNode(t)+\"\\n\"\n", "\n", " return response\n", "\n", " def neighborFinder(self, name):\n", " id = self.nodeID[name]\n", " neighbors = []\n", " mask = (self.headNum == id)\n", "\n", " neighbors = torch.masked_select(self.tailNum, mask)\n", "\n", " return neighbors\n", "\n", "\n", " def forward(self, query):\n", " return self.relationSummary(query)\n", "\n", "\n", "\n" ], "metadata": { "id": "4xq4X0rVa6AU" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "GPcJGLxTZhIy", "colab": { "base_uri": "https://localhost:8080/", "height": 122 }, "outputId": "449fa9e2-1b66-4ada-bbb1-56c085a2bf6f" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "\"hannah is_a high school senior\\nhannah has_condition high functioning asd\\nhannah identifies_as social democrat\\nhannah aspires_to phd\\nhannah despises apathy\\nhannah fears death\\nhannah has_sensitivity heat sensitivity\\nhannah loves snow\\nhannah attends woodson high school\\nhannah accepted_to mcgill university\\nhannah will_study computer science\\nhannah loves_subject cs\\nhannah loves_subject history\\nhannah loves_subject creative writing\\nhannah enjoys calculus\\nhannah dislikes ap lit/lang\\nhannah dislikes physics\\nhannah wants_to_work_at mila\\nhannah wants_to_be researcher\\nhannah not_interested_in software engineering\\nhannah interested_in graph neural networks\\nhannah interested_in hybrid ai architectures\\nhannah interested_in alternative ai reasoning\\nhannah built custom chatbot\\nhannah respects mom's faith outlook\\nhannah frustrated_by dad's lack of empathy\\nhannah believes dad is not a bad person\\nhannah bonding_activity_with darci: gaming and talking\\nhannah goal_in_college friend group for mario party\\nhannah lived_in california\\nhannah lived_in indiana\\nhannah lived_in rhode island\\nhannah lived_in maine\\nhannah lived_in hawaii\\nhannah lived_in tennessee\\nhannah lived_in virginia\\nhannah currently_in annandale, va\\nhannah moved_to_annandale after 9th grade\\nhannah loves nintendo\\nhannah loves_genre jrpgs\\nhannah loves_series persona series\\nhannah loves_series fire emblem series\\nhannah watches party crashers (youtube)\\nhannah watches sidequest (youtube)\\nhannah cannot_watch looney tunes\\nhannah supports_model nordic social democracy\\nhannah opposes maga movement\\nhannah equally_opposes political apathy / non-voters\\nhannah respects_values_of progressive catholics\\nhannah respects pope leo's kindness\\nhannah uncertain_about personal faith\\nhannah wants to matter to the world\\nhannah wants to discover something that matters\\nhannah wants to extend lives of loved ones\\nhannah wants to not be lonely\\nhannah hopes_for montreal social life\\n\"" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 68 } ], "source": [ "n = MiniGNN()\n", "n.forward(\"Hannah\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "ZcCO1scW5tVH", "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "outputId": "b96614aa-a576-4e73-dece-1f57044a85b1" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nlineGraph(gdp, \"Year\", \"GDP\", \"GDP Over Time\")\\n\\nlineRegression(b)\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 69 } ], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import seaborn as sns\n", "import pandas as pd\n", "from mpl_toolkits.mplot3d import Axes3D\n", "\n", "def lists(dictionary):\n", " labelList = []\n", " proportionList = []\n", "\n", " for labels, proportions in dictionary.items():\n", " labelList.append(labels)\n", " proportionList.append(proportions)\n", "\n", " return labelList, proportionList\n", "\n", "def xyList(dictionary):\n", " xs = dictionary.get(\"X_Values\")\n", " ys = dictionary.get(\"Y_Values\")\n", "\n", " return x, y\n", "\n", "def xyList3D(dictionary):\n", " xs = dictionary.get(\"X_Values\")\n", " ys = dictionary.get(\"Y_Values\")\n", " zs = dictionary.get(\"Z_Values\")\n", "\n", " return xs, ys, zs\n", "\n", "\n", "def dataFrame(inputs):\n", " df = pd.DataFrame.from_dict(inputs)\n", " return df\n", "\n", "def pie(inputs):\n", " labels, proportions = lists(inputs)\n", " plt.pie(proportions, labels = labels, startangle = 90, autopct = \"%.1f%%\", wedgeprops = {\"linewidth\":3.0, \"edgecolor\": \"white\"})\n", " plt.show()\n", "\n", "def bar(inputs):\n", " x, y = lists(inputs)\n", " fig, ax = plt.subplots()\n", " ax.bar(x, y)\n", " plt.show()\n", "\n", "def histogram(inputs):\n", " fig, ax = plt.subplots()\n", " ax.hist(inputs, bins = 50, linewidth = 0.5, edgecolor = \"white\")\n", " plt.show()\n", "\n", "def lineGraph(inputs, xlabel, ylabel, title):\n", " x, y = lists(inputs)\n", " fig, ax = plt.subplots()\n", " ax.plot(x, y, linestyle = \"-\", linewidth = 1, marker = \"o\")\n", " plt.xlabel(xlabel)\n", " plt.ylabel(ylabel)\n", " plt.title(title)\n", " plt.show()\n", "\n", "def multiPlot():\n", "\n", " fig, ax = plt.subplots()\n", "\n", " t = np.arange(0, 10, 0.2)\n", "\n", " plt.plot(t, 50*np.sin(0.25*np.pi*t), linestyle = \"-\", linewidth = 1, marker = \"o\")\n", " plt.plot(t**2, linewidth = 1, marker = \"o\")\n", " plt.show()\n", "\n", "def scatterplot(inputs):\n", " x, y = lists(inputs)\n", " fig, ax = plt.subplots()\n", " ax.scatter(x, y)\n", " plt.show()\n", "\n", "def lineRegression(inputs):\n", " if(type(inputs)) == pd.DataFrame:\n", " sns.regplot(data = inputs, x = \"X_Values\", y = \"Y_Values\", order = 2)\n", " plt.show()\n", " else:\n", " data = dataFrame(inputs)\n", " print(data)\n", " print(data.size)\n", " sns.regplot(data, x = \"X_Values\", y = \"Y_Values\", order = 2)\n", " plt.show()\n", "\n", "def threeDPlot(inputs):\n", " x, y, z = xyList3D(inputs)\n", "\n", " x = np.array(x)\n", " y = np.array(y)\n", " z = np.array(z)\n", "\n", " print(type(x))\n", " print(type(y))\n", " print(type(z))\n", "\n", " fig = plt.figure()\n", " ax = plt.axes(projection = \"3d\")\n", " ax.scatter3D(x, y, z)\n", " #ax.plot_surface(x, y, z, cmap=sns.color_palette(\"viridis\", as_cmap=True), linewidth=0, antialiased=False)\n", "'''\n", "lineGraph(gdp, \"Year\", \"GDP\", \"GDP Over Time\")\n", "\n", "lineRegression(b)\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "eb64RsnhFc90", "colab": { "base_uri": "https://localhost:8080/", "height": 52 }, "outputId": "9362aa3a-8ea8-4e14-cc35-b1cb859a8881" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nimport random\\ndict1 = {\"X_Values\": random.sample(range(100), 10), \"Y_Values\": random.sample(range(100), 10), \"Z_Values\": random.sample(range(100), 10)}\\nthreeDPlot(dict1)\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 70 } ], "source": [ "'''\n", "import random\n", "dict1 = {\"X_Values\": random.sample(range(100), 10), \"Y_Values\": random.sample(range(100), 10), \"Z_Values\": random.sample(range(100), 10)}\n", "threeDPlot(dict1)\n", "'''" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "QJTdSlbBIdo9", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "2a5c12ab-3c22-4714-e2d0-50cd934697f0" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Go to this url and authorize the application:\n", "https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=411956399797-8v2a131bkmqbnih2bfa90ilb8esvnfpd.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.modify&state=mkibalDnkObO4Dngyz4J6ZfprJRIaK&code_challenge=TxjPVLRv2zR5pawPGlvsQCqtek8eSMW4zWbDXnbV8B8&code_challenge_method=S256&access_type=offline&prompt=consent\n", "\n", " Paste authorization code below:\n", "Enter the authorization code: 4/1AeoWuM9X4gUGY39w7apabWM5yzR3Q3VtBTawyK0DBLUv9QWDnQ8p7s_t-Q8\n", "Please go to this URL and authorize the application:\n", "https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=411956399797-8v2a131bkmqbnih2bfa90ilb8esvnfpd.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ftasks&state=ewLErSKPYTRPVj5KuKfgseLwusCnJY&code_challenge=4yWCRUEs4N-DbD2jx0qORpL7ilSK26E9JxIscOeOOn8&code_challenge_method=S256&access_type=offline&prompt=consent\n", "\n", "After authorization, you will get a code. Paste it below:\n", "Enter the authorization code: 4/1AeoWuM9JlKmKmYhANVYzhzh6k4AHb0X1Y2CryB_4g4tpDEJZ4m_JfeIQINI\n", "googleSearch\n", "arxiv\n", "gmail\n", "taskSetter\n", "memory\n", "wikipedia\n", "gnn\n", "googleSearch\n", "wikipedia\n", "You have access to the tool googleSearch, with the inputs {'task': {'type': 'string', 'description': 'What you would like to search for.'}}. For example Use this tool to find opinion-based or current information. When calling this tool, output ONLY the call on a single line, with no prose, markdown, or bullets. Format: `googleSearch(task: )` Correct example: `googleSearch(task: What country has the most fjords?)` Wrong (do NOT do this): `Sure! Let me search for that. I'll look up which country has the most fjords.` You have access to the tool arxiv, with the inputs {'task': {'type': 'string', 'description': 'What you would like to search for.'}}. For example Use this tool to consult research papers. When calling this tool, output ONLY the call on a single line, with no prose, markdown, or bullets. Format: `arxiv(task: )` Correct example: `arxiv(task: world models)` Wrong (do NOT do this): `I'll look into research papers about world models for you.` You have access to the tool gmail, with the inputs {'query': {'type': 'string', 'description': \"Searches Gmail using keywords. Examples:\\n - 'invoice' finds emails mentioning invoice\\n - 'subject:meeting' finds emails with meeting in subject\\n - 'from:john@company.com' finds emails from John\\n - '' (empty) returns 10 most recent emails\"}}. For example Use this tool when the user asks about their Gmail. When calling this tool, output ONLY the call on a single line, with no prose, markdown, or bullets. Format: `gmail(query: )` Correct example: `gmail(query: from:john@company.com)` Wrong (do NOT do this): `Let me check your emails from John at company.com.` You have access to the tool taskSetter, with the inputs {'title': {'type': 'string', 'description': 'Input the title of the task you wish to put on the calendar'}, 'description': {'type': 'string', 'description': 'The description of the task you are putting on the calendar'}, 'date': {'type': 'string', 'description': 'The date you wish to put the task on the calendar, as 3 numbers in the format month-day-year'}}. For example Use this tool when the user requests a reminder or calendar task. When calling this tool, output ONLY the call on a single line, with no prose, markdown, or bullets. Format: `taskSetter(title: , description: <description>, date: <MM-DD-YYYY>)` Correct example: `taskSetter(title: RPI Due, description: Due date for RPI application, date: 12-01-2025)` Wrong (do NOT do this): `Okay! I'll set that reminder.\n", "* **Title:** RPI Due\n", "* **Date:** 12-01-2025` You have access to the tool memory, with the inputs {'knowledgeExtend': {'type': 'object', 'description': 'Input a list of a dictionary with one node name, a relation name and another node name to record causal relationships. Leave blank if not intended to be used.'}, 'notes': {'type': 'string', 'description': 'Record notes to remember into a file. Leave blank if not intended to be used.'}, 'fileName': {'type': 'string', 'description': 'Name of the file you wish to record notes into, or continue recording notes into. Leave blank if unused.'}, 'knowledgeQuery': {'type': 'string', 'description': 'Key word you wish to query the knowledge graph memory for. Leave blank if unused.'}, 'noteQuery': {'type': 'string', 'description': \"The file you want to retrieve within memory. Leave blank if unused, write 'all' if you want all of them.\"}}. For example Use this tool to record or query persistent memory. When calling this tool, output ONLY the call on a single line, with no prose, markdown, or bullets. Format: `memory(knowledgeExtend: <dict>, notes: <string>, fileName: <string>, knowledgeQuery: <string>, noteQuery: <string>)` Correct example: `memory(knowledgeExtend: {\"Head\": \"Creator\", \"Relation\": \"Created me\", \"Tail\": \"Hannah\"}, notes: My creator is high school student Hannah Fensterer., fileName: creator, knowledgeQuery: , noteQuery: )` Wrong (do NOT do this): `I'll remember that Hannah is your creator.` You have access to the tool wikipedia, with the inputs {'query': {'type': 'string', 'description': 'What you would like to search for.'}}. For example Use this tool to find fact-based information. Use very frequently if the user asks a question or wants a description When calling this tool, output ONLY the call on a single line, with no prose, markdown, or bullets. Format: `wikipedia(query: <search query>)` Correct example: `wikipedia(query: What is the capital of France?)` Wrong (do NOT do this): `The capital of France is Paris. Let me verify that for you.` You have access to the tool gnn, with the inputs {'query': {'type': 'string', 'description': 'Topic Hannah would like to query the graph for'}}. For example Query graph to learn information about your creator, Hannah Fensterer, and her life When calling this tool, output ONLY the call on a single line, with no prose, markdown, or bullets. Format: `gnn(query: <search query>)` Correct example: `gnn(query: Hannah)` Wrong (do NOT do this): `I'll remember that Hannah is your creator.` \n" ] } ], "source": [ "#from unsloth import FastLanguageModel\n", "\n", "#graphSearch = Query(elyos)\n", "googleSearch = GoogleSearchTool()\n", "arxiv = paperSearch()\n", "gmail = gmailCall()\n", "taskSetter = CalendarPost()\n", "memory = Memory()\n", "wikipedia = wikiSearch()\n", "gnn = MiniGNN()\n", "\n", "\n", "def example(tool):\n", " examples = {\n", " \"googleSearch\": {\n", " \"purpose\": \"Use this tool to find opinion-based or current information.\",\n", " \"format\": \"googleSearch(task: <search query>)\",\n", " \"correct\": \"googleSearch(task: What country has the most fjords?)\",\n", " \"wrong\": \"Sure! Let me search for that. I'll look up which country has the most fjords.\",\n", " },\n", " \"wikipedia\": {\n", " \"purpose\": \"Use this tool to find fact-based information. Use very frequently if the user asks a question or wants a description\",\n", " \"format\": \"wikipedia(query: <search query>)\",\n", " \"correct\": \"wikipedia(query: What is the capital of France?)\",\n", " \"wrong\": \"The capital of France is Paris. Let me verify that for you.\",\n", " },\n", " \"arxiv\": {\n", " \"purpose\": \"Use this tool to consult research papers.\",\n", " \"format\": \"arxiv(task: <topic>)\",\n", " \"correct\": \"arxiv(task: world models)\",\n", " \"wrong\": \"I'll look into research papers about world models for you.\",\n", " },\n", " \"gmail\": {\n", " \"purpose\": \"Use this tool when the user asks about their Gmail.\",\n", " \"format\": \"gmail(query: <gmail search syntax>)\",\n", " \"correct\": \"gmail(query: from:john@company.com)\",\n", " \"wrong\": \"Let me check your emails from John at company.com.\",\n", " },\n", " \"taskSetter\": {\n", " \"purpose\": \"Use this tool when the user requests a reminder or calendar task.\",\n", " \"format\": \"taskSetter(title: <title>, description: <description>, date: <MM-DD-YYYY>)\",\n", " \"correct\": \"taskSetter(title: RPI Due, description: Due date for RPI application, date: 12-01-2025)\",\n", " \"wrong\": \"Okay! I'll set that reminder.\\n* **Title:** RPI Due\\n* **Date:** 12-01-2025\",\n", " },\n", " \"memory\": {\n", " \"purpose\": \"Use this tool to record or query persistent memory.\",\n", " \"format\": 'memory(knowledgeExtend: <dict>, notes: <string>, fileName: <string>, knowledgeQuery: <string>, noteQuery: <string>)',\n", " \"correct\": 'memory(knowledgeExtend: {\"Head\": \"Creator\", \"Relation\": \"Created me\", \"Tail\": \"Hannah\"}, notes: My creator is high school student Hannah Fensterer., fileName: creator, knowledgeQuery: , noteQuery: )',\n", " \"wrong\": \"I'll remember that Hannah is your creator.\",\n", " }, \"gnn\": {\n", " \"purpose\": \"Query graph to learn information about your creator, Hannah Fensterer, and her life\",\n", " \"format\": \"gnn(query: <search query>)\",\n", " \"correct\": \"gnn(query: Hannah)\",\n", " \"wrong\": \"I'll remember that Hannah is your creator.\",\n", " }\n", " }\n", "\n", " e = examples[tool]\n", " return (\n", " f\"{e['purpose']} \"\n", " f\"When calling this tool, output ONLY the call on a single line, with no prose, markdown, or bullets. \"\n", " f\"Format: `{e['format']}` \"\n", " f\"Correct example: `{e['correct']}` \"\n", " f\"Wrong (do NOT do this): `{e['wrong']}` \"\n", " )\n", "\n", "tools = {\"googleSearch\": googleSearch,\n", " \"arxiv\": arxiv, \"gmail\": gmail, \"taskSetter\": taskSetter, \"memory\": memory, \"wikipedia\" : wikipedia, \"gnn\":gnn}\n", "tools2 = {\"googleSearch\": googleSearch,\n", " \"wikipedia\" : wikipedia}\n", "\n", "desc = \"\"\n", "desc2 = \"\"\n", "desc3 = \"You have access to the tool gnn , with the inputs \"+str(gnn) + '. For example ' + example(\"gnn\")\n", "\n", "for i in tools.keys():\n", " print(i)\n", " desc += \"You have access to the tool \"+ i + \", with the inputs \"+str(tools[i].inputs) + '. For example ' + example(i)\n", "\n", "for i in tools2.keys():\n", " print(i)\n", " desc2 += \"You have access to the tool \"+ i + \", with the inputs \"+str(tools[i].inputs) + '. For example ' + example(i)\n", "print(desc)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "VAIlnm_6n7pU" }, "outputs": [], "source": [ "import re\n", "from datetime import datetime\n", "\n", "def normalize_date(date_str):\n", " for fmt in (\"%Y-%m-%d\", \"%m-%d-%Y\", \"%d-%m-%Y\"):\n", " try:\n", " return datetime.strptime(date_str, fmt).strftime(\"%m-%d-%Y\")\n", " except ValueError:\n", " continue\n", " return date_str\n", "\n", "def parse_tool_call(text):\n", " calls = []\n", " fn_pattern = re.finditer(r'(\\w+)\\((.+?)\\)', text, re.DOTALL)\n", "\n", " for match in fn_pattern:\n", " name = match.group(1)\n", " if name not in tools:\n", " continue\n", " args_string = match.group(2)\n", "\n", " kv_pattern = r'(\\w+):\\s*(?:\"([^\"]+)\"|([^,)]+))'\n", " pairs = re.findall(kv_pattern, args_string)\n", "\n", " args = {key: (quoted or unquoted).strip().strip(\"'\")\n", " for key, quoted, unquoted in pairs}\n", "\n", " if \"date\" in args:\n", " args[\"date\"] = normalize_date(args[\"date\"])\n", "\n", " calls.append({\"name\": name, \"args\": args})\n", "\n", " return calls if calls else None" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "KdxVQHQn7Wwx", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "c29fd82e-d875-45a3-8072-ecae0ec67da4" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "[{'name': 'googleSearch', 'args': {'task': 'What is euclidean geometry'}}]\n", "trying\n", "Source 1: You've been blocked by network security.\n", "To continue, log in to your Reddit account or use your developer token\n", "If you think you've been blocked by mistake, file a ticket below and we'll look into it.\n", "Log in\n", "File a ticket\n", "\n", "\n", "Source 2: Please set a user-agent and respect our robot policy https://w.wiki/4wJS. See also https://phabricator.wikimedia.org/T400119.\n", "\n", "\n", "Source 3: Just a moment...\n", "Enable JavaScript and cookies to continue\n", "\n", "\n", "\n" ] } ], "source": [ "text = \"I now am going to googleSearch(task: What is euclidean geometry)\"\n", "x = parse_tool_call(text)\n", "print(x)\n", "if x:\n", " response = \"\"\n", " for match1 in x:\n", " name = match1.get(\"name\")\n", " args = match1.get(\"args\")\n", " response += tools[name].forward(**args)\n", "print(response)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "yx41qeh6MExy", "colab": { "base_uri": "https://localhost:8080/", "height": 528, "referenced_widgets": [ "f8ed928fb86d4a1a91033aad610131d4", "ba8ee85b32024e73b55fef506a68ba45", "6a5b75943b0b41b995fb8e44d7394dfa", "a12a34d619e44f66b0bb70d27d808fb4", "35eebbfb80c347a594eadc8e649eaa26", "af348396d6e34a4e9f66019445f84a0f", "9aace401736b438da1f601619e6b2341", "a056e25fb8a344fb8f666450b6830b7e", "9eeb61145c2e43ecabbf2869295bd36a", "607d1d5a35594065bf3d75f413f20337", "9a9859a4717e4af4a422c160e5c75b21", "1e091505d29846b0b0cb52ad9e5608dc", "66e8e3d54a96495ba5049b70bbffdbf1", "7707e05e5aea4414bbd323f7156ad22a", "bb3f44a77a544c59a4815f4a47ad1807", "1cd5a8e27a7e4562bb24a4010ea1beae", "da824e489d68435cb3aea402fcbb5fa8", "53c1132b9f6647d5a59f3edc380fd411", "8f54a88d71a840628f67ee20e05bc00e", "5ec6321329844320ac2f2c0dfa493df7", "6276a71153fe4d31954f03df4aefc09d", "17cb11bb653047d48937dceccc3ce62f", "901b89745e1f424eb94a7f735809dc34", "1564dec4945f42cd9b956f2963cfdce0", "650f137ad7774569ad799f42c47f9185", "a2598f281406434989d84956a17647a9", "a811009316fb4e85835385ea7f97f013", "84d3c1b47bad401eb15fd5d84d5f8e63", "b4c2241c4e1e49848922a35c4d25dc18", "6b7e1c8b501a4b6f9442b19d962e3b2a", "02cb646f06bd41fdae37d2a8f33c0464", "ecc3b3d0ca8d4a719d314fdbeafda297", "3f3fe09381d24fc3b6a950458713922c", "8a4c49c8193c4cd3bf3237542dc6b7da", "0b4185edeeb5455c926b2175a8f36108", "810940c6110a445f84cbb6b1cd3e2ebb", "4a8794cd91be441ea942344e7ac999ae", "15c08727fc1040fdad96b886a55c6c0d", "83bda57224064a8a94401d3591b0fef7", "2377abdc97714638b38ffa2df887b5e5", "490e7ec9ab014f98b239853acebd2433", "d74402cbc13741db848a19b0e1382869", "4592f13df65e42dd9dcccf159ebccd65", "d62e3f13ecf54a388e97f42bce5ceba1", "cf23ad9834ad437c9d57ad7f65c07eac", "caccef0ffb5b4cd89516db9b9f1a957a", "d5b544492c94491ab956e0cc5930e7aa", "dccfd08555f74e0790232013204ae7b3", "9bcad67bb646432eb6bc114cb85f5600", "80946022df144c7e8af55d7486240829", "89248f42726a455aa48b82494b752dfa", "5540f0d841a04d97989b1696c63d6d3e", "2c6aa9be36af4a00bb980259c7dc495f", "83c01fa857af46e2ac075e9a92aee662", "d448b6bf5cb54a9b989d08b2a403f1b2", "fc908588c3994e25ae3ba650da5147d5", "a3bd62aceaec4daaac46473a32405d9d", "7bb116a5c2214d669f8b207c4ef73e05", "a772c24a277f4cc093ca908067432786", "043ae9adf1a04df39e85ae63441db09b", "6597ab68d8a247da8d4c1ac63facefdf", "1e4567d334ae47f699e720809ffdfce5", "cb9e264d3dac47dc92f08434aa10da06", "170eecf037724fe6ba5bdd74b4650210", "cbe0cdcc5c9e474e8e876068b3d71c6a", "17f855c87c474f2bb72555258d319a69", "a0e280c4b71b4bc594c063be670c01ed", "004031ad9af2436487e07c8f89547efa", "024e47f772624a7bba264eeb5b62f59a", "da06071b882a49c4b4df867419df1d76", "b4f840c42a894701b295303e4fb1765c", "954e3a978aa1433182cc042d20f51319", "7d83b099df5e4fe491809e763dd85cb6", "f742e8b1ea704e4bb8066176527518b5", "3bdc3ca52ead41f5845fe0301af1f45d", "3a65c565c9c147709a7713c8e71f52fe", "b2eb3458e73141ceaeaf8b1bd407b21e", "592d75603dce4a8cbadcc62158a2fa82", "219558ec2b7f400ca781911749759dc1", "c39cc322fa5c4713b85765afa3b79bbb", "087a6a4634e847d3a8cd09211a5943bb", "332981e9157d4856bf68b4318db0794f", "f7dd47f6f3a84399beaef3e7b86ffe78", "bd2f64b3067349778400820a4691a4aa", "1c5b285ce52042e6a86c4803f6fb7e19", "61d5c60bd8eb4ce4875dc94070369047", "78c4b1972d1e48dbad88c53f9dfe218a", "a87e9f01f1ae4da5a896c4418f32ffda", "0885f0cf5e604afd862c84c86989fa3e", "6f307294a0f34d849da45377dabb77dc", "6fbc22bb5e5647dd9e1472871ca34f63", "a531f0bb1243485b83a49ba6586f7f9b", "6ed6f5793cb24211bca27337dc7ac64c", "b7d519eb79354edd9c31a36455224fbd", "60b0025e89f54b04a330061510b4d982", "c39f98b4c0d042e1b272c4518f296f3a", "79fe29caa930420e861cedd66f7a08f1", "4f78666428414995922e48c6c230de0f", "2f84e7ec830543b58dc62c5256cc8c4c", "63ccc341ee034f578ed885e47664a0f5", "172fecfa5a1c4b40bb59a4e47c6e16de", "2b519a5efee74347afb3a5920adfdd78", "8dd54a2812254964870a5b9440075e16", "3306b989c1374c7ca8d919ed63e8b0fb", "bbbd96cdacfc4ee29f9bdbcdbdaa3d60", "9bd15797a66c4676b8d90219e80fcc4b", "aeb5f2addf8049dabba7ebbc6c1a9e76", "d94edf2caeae489d9ed7efdcc1469296", "d2eb5853f2824fdbbb5947ef137da191", "857cf8f6bacd4eb1b309ef8c7c08a874", "139e81f03c4e4027bbe569ee4ccf0fb9", "fbbba7dfd3e24f2ca3056f145f986574", "0a0061ad29d34387a50e0d1cb049b457", "3d29492f3728452faa249006fbbc620d", "eeac80600299408ba3da1f6073c15b4c", "a7aff3ccac5b408792b94d3e08552b56", "567180854a3a48218c768c1323fc994c", "f74a60887eca414ca48969b061711f5a", "f06454683d3f41db820039aad4772266", "d80ddf13231d4c79b9b564df186a1e93", "03a9ee8936334851979a2878d9b78a12" ] }, "outputId": "84270179-13a6-43e6-9b66-8b175c6bedfc" }, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning: \n", "The secret `HF_TOKEN` does not exist in your Colab secrets.\n", "To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n", "You will be able to reuse this secret in all of your notebooks.\n", "Please note that authentication is recommended but still optional to access public models or datasets.\n", " warnings.warn(\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "config.json: 0.00B [00:00, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "f8ed928fb86d4a1a91033aad610131d4" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } }, { "output_type": "stream", "name": "stderr", "text": [ "/usr/local/lib/python3.12/dist-packages/transformers/models/cohere2/configuration_cohere2.py:235: FutureWarning: The `sliding_window_pattern` attribute is deprecated and will be removed in v4.55.0.\n", " warnings.warn(\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "model.safetensors.index.json: 0.00B [00:00, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "17cb11bb653047d48937dceccc3ce62f" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } }, { "output_type": "display_data", "data": { "text/plain": [ "Fetching 2 files: 0%| | 0/2 [00:01<?, ?it/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "3f3fe09381d24fc3b6a950458713922c" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } }, { "output_type": "display_data", "data": { "text/plain": [ "model-00001-of-00002.safetensors: 0%| | 0.00/4.98G [00:00<?, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "dccfd08555f74e0790232013204ae7b3" } }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "model-00002-of-00002.safetensors: 0%| | 0.00/4.11G [00:00<?, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "9bcad67bb646432eb6bc114cb85f5600" } }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "Loading checkpoint shards: 0%| | 0/2 [00:00<?, ?it/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "fc908588c3994e25ae3ba650da5147d5" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } }, { "output_type": "display_data", "data": { "text/plain": [ "generation_config.json: 0%| | 0.00/197 [00:00<?, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "b2eb3458e73141ceaeaf8b1bd407b21e" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } }, { "output_type": "display_data", "data": { "text/plain": [ "tokenizer_config.json: 0.00B [00:00, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "a87e9f01f1ae4da5a896c4418f32ffda" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } }, { "output_type": "display_data", "data": { "text/plain": [ "tokenizer.json: 0%| | 0.00/20.1M [00:00<?, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "2f84e7ec830543b58dc62c5256cc8c4c" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } }, { "output_type": "display_data", "data": { "text/plain": [ "special_tokens_map.json: 0%| | 0.00/664 [00:00<?, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "857cf8f6bacd4eb1b309ef8c7c08a874" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } }, { "output_type": "display_data", "data": { "text/plain": [ "chat_template.jinja: 0.00B [00:00, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "03a9ee8936334851979a2878d9b78a12" } }, "metadata": { "application/vnd.jupyter.widget-view+json": { "colab": { "custom_widget_manager": { "url": "https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/2b70e893a8ba7c0f/manager.min.js" } } } } } ], "source": [ "from transformers import AutoModelForCausalLM, TextStreamer, GenerationConfig\n", "\n", "model = AutoModelForCausalLM.from_pretrained(\"FluegelQueen/Coeur-Validation-Fin\")\n", "tokenizer = AutoTokenizer.from_pretrained(\"FluegelQueen/Coeur-Validation-Fin\")\n", "generationConfig = GenerationConfig(max_new_tokens=500, do_sample=True, top_k=50, eos_token_id=model.config.eos_token_id)\n", "streamer = TextStreamer(tokenizer)\n", "functionGo = True" ] }, { "cell_type": "code", "source": [ "model.config.max_position_embeddings = 8192\n", "model.generation_config.max_length = 8192\n", "\n", "print(\"model.config.max_position_embeddings:\", model.config.max_position_embeddings)\n", "print(\"model.config.sliding_window:\", getattr(model.config, \"sliding_window\", None))\n", "print(\"model.config.sliding_window_pattern:\", getattr(model.config, \"sliding_window_pattern\", None))\n", "print(\"model.generation_config.max_length:\", model.generation_config.max_length)" ], "metadata": { "id": "p2RqQblaL9ET", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "4064484a-4eda-4ed2-e837-6bcd64cc23c7" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "model.config.max_position_embeddings: 8192\n", "model.config.sliding_window: 4096\n", "model.config.sliding_window_pattern: 4\n", "model.generation_config.max_length: 8192\n" ] } ] }, { "cell_type": "code", "source": [ "from transformers import TextIteratorStreamer\n", "\n", "specialStreamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)" ], "metadata": { "id": "tEEGquJkJ_ym" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "def clean_query(q):\n", " STOP_VERBS = {\"describe\", \"tell\", \"explain\", \"show\", \"give\", \"find\",\n", " \"what\", \"is\", \"are\", \"the\", \"a\", \"an\", \"me\", \"about\", \"of\"}\n", " words = q.lower().replace(\"?\", \"\").split()\n", " keywords = [w for w in words if w not in STOP_VERBS]\n", " return \" \".join(keywords)\n" ], "metadata": { "id": "7Mo2y-mlgZdS" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "2bAGgtjennMj" }, "outputs": [], "source": [ "import pdb" ] }, { "cell_type": "code", "source": [ "reason = False" ], "metadata": { "id": "jTK-ktNw81Rm" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "\n", "def main(conversation, tool, model, tokenizer, generationConfig, streamer, prompt):\n", " classify = classifier_convo = [\n", " {\"role\": \"system\", \"content\": (\n", " \"Classify the user request as exactly one word: INFORMATIONAL, ACTION, or OPINION. \"\n", " \"INFORMATIONAL = asking about facts/topics. \"\n", " \"ACTION = asking you to do something (set reminder, check email, save note). \"\n", " \"OPINION = asking for subjective recommendations(ie best restaurants in x area) or current events. \"\n", " \"Respond with ONE WORD only.\"\n", " )},\n", " {\"role\": \"user\", \"content\": \"Classify the user prompt \" + prompt + \" as exactly one word: INFORMATIONAL, ACTION, or OPINION. \"\n", " \"INFORMATIONAL = asking about facts/topics or subjects that require hard knowledge. \"\n", " \"ACTION = asking you to do something (set reminder, check email, save note). \"\n", " \"OPINION = asking for subjective recommendations(ie best food in x area) or current events.\"\n", "\n", " \"Respond with ONE WORD only.\"}\n", " ]\n", " formatted = tokenizer.apply_chat_template(\n", " classify,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", " category = \"\"\n", "\n", " if \"INFORMATIONAL\" in re_output.upper():\n", " category = \"INFORMATIONAL\"\n", " elif \"OPINION\" in re_output.upper():\n", " category = \"OPINION\"\n", " elif \"ACTION\" in re_output.upper():\n", " category = \"ACTION\"\n", "\n", "\n", " print(\"The category is \"+category)\n", "\n", " if tool == False:\n", " if conversation ==[]:\n", " conversation = [\n", " {\"role\": \"system\", \"content\": \"You are a helpful assistant. You must write <|CHATBOT_TOKEN|> before beginning your answer. Print STOP when you are finished\"},\n", " {\"role\": \"user\", \"content\": \"Thoroughly reason out the prompt \"+prompt}\n", " ]\n", "\n", " formatted = tokenizer.apply_chat_template(\n", " conversation,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", "\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", " input_length = inputs.input_ids.shape[1]\n", " print(input_length)\n", "\n", " print(\"Beginning thinking\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " #pdb.set_trace()\n", " print(\"Final thinking\")\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " if \"<|CHATBOT_TOKEN|>\" in re_output:\n", " print(\"Found start\")\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " conversation.append({\"role\": \"assistant\", \"content\": re_output})\n", " conversation.append({\"role\": \"user\", \"content\": \"Present you answer in a final, informational way to the user. \"})\n", "\n", " formatted = tokenizer.apply_chat_template(\n", " conversation,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", " input_length = inputs.input_ids.shape[1]\n", "\n", " print(\"Begin final\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " print(\"End final\")\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " conversation.append({\"role\": \"assistant\", \"content\": re_output})\n", " functionGo = False\n", " do = False\n", "\n", " else:\n", " if category == \"INFORMATIONAL\":\n", " print(\"Convo for informational\")\n", " conversation = [\n", " {\"role\": \"system\", \"content\": \"You are a helpful assistant. You must write <|CHATBOT_TOKEN|> before beginning your answer. You have the tools provided here \" + desc2+\". Output function calls to use these if necessary in the exact format shown in the examples\"},\n", " {\"role\": \"user\", \"content\": \"You must print the given wikipedia tool function call to search for background info about the prompt \" +prompt}\n", " ]\n", " elif category == \"OPINION\":\n", " print(\"Convo for opinion\")\n", " conversation = [\n", " {\"role\": \"system\", \"content\": \"You are a helpful assistant. You must write <|CHATBOT_TOKEN|> before beginning your answer. You have the tools provided here \" + desc2+\". Output function calls to use these if necessary in the exact format shown in the examples\"},\n", " {\"role\": \"user\", \"content\": \"Use the googleSearch function call to search for background info about the prompt \" +prompt}\n", " ]\n", "\n", " else:\n", " conversation = [\n", " {\"role\": \"system\", \"content\": \"You are a helpful assistant. You must write <|CHATBOT_TOKEN|> before beginning your answer. You have the tools provided here \" + desc+\". Output function calls to use these if necessary in the exact format shown in the examples\"},\n", " {\"role\": \"user\", \"content\": prompt}\n", " ]\n", "\n", " if reason:\n", " pass\n", "\n", " else:\n", " research = False\n", " formatted = tokenizer.apply_chat_template(\n", " conversation,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", "\n", " print(prompt)\n", " print(\"Start google search\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", "\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " matches = parse_tool_call(re_output)\n", " if matches:\n", " response = \"\"\n", " for match1 in matches:\n", " name = match1.get(\"name\")\n", " if name == \"wikipedia\" or name == \"googleSearch\":\n", " research = True\n", "\n", " args = match1.get(\"args\")\n", "\n", " print(name)\n", " print(args)\n", "\n", " thing = tools[name].forward(**args)\n", " if type(thing) == dict:\n", " thing = json.dumps(thing)\n", "\n", " response += thing\n", " re_output = re_output+response\n", " print(\"Finished google search\")\n", "\n", " if research:\n", " conversation.append({\"role\": \"assistant\", \"content\": \"Background info\"+re_output})\n", " conversation.append({\"role\": \"user\", \"content\": prompt})\n", "\n", " formatted = tokenizer.apply_chat_template(\n", " conversation,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", " input_length = inputs.input_ids.shape[1]\n", "\n", " print(\"Start initial prompt\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", "\n", " print(\"Finished initial prompt\")\n", "\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " matches = parse_tool_call(re_output)\n", " if matches:\n", " response = \"\"\n", " for match1 in matches:\n", " name = match1.get(\"name\")\n", " args = match1.get(\"args\")\n", " if name == \"taskSetter\":\n", " tools[name].forward(**args)\n", " else:\n", " response += tools[name].forward(**args)\n", "\n", " re_output = re_output+response\n", "\n", "\n", " print(\"Assistant:\", re_output)\n", " conversation.append({\"role\": \"assistant\", \"content\": re_output})\n", " functionGo = False\n", "\n", " torch.cuda.empty_cache()\n", " return conversation\n" ], "metadata": { "id": "vUIeMCdIPBD1" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "from threading import Thread\n", "def uiVersion(conversation, tool, model, tokenizer, generationConfig, streamer, prompt):\n", " classify = classifier_convo = [\n", " {\"role\": \"system\", \"content\": (\n", " \"Classify the user request as exactly one word: INFORMATIONAL, ACTION, or OPINION. \"\n", " \"INFORMATIONAL = asking about facts/topics. \"\n", " \"ACTION = asking you to do something (set reminder, check email, save note). \"\n", " \"OPINION = asking for subjective recommendations(ie best restaurants in x area) or current events. \"\n", " \"Respond with ONE WORD only.\"\n", " )},\n", " {\"role\": \"user\", \"content\": \"Classify the user prompt \" + prompt + \" as exactly one word: INFORMATIONAL, ACTION, or OPINION. \"\n", " \"INFORMATIONAL = asking about facts/topics or subjects that require hard knowledge. \"\n", " \"ACTION = asking you to do something (set reminder, check email, save note). \"\n", " \"OPINION = asking for subjective recommendations(ie best food in x area) or current events.\"\n", " \"Respond with ONE WORD only.\"}\n", " ]\n", " formatted = tokenizer.apply_chat_template(\n", " classify,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", " category = \"\"\n", "\n", " if \"INFORMATIONAL\" in re_output.upper():\n", " category = \"INFORMATIONAL\"\n", " elif \"OPINION\" in re_output.upper():\n", " category = \"OPINION\"\n", " elif \"ACTION\" in re_output.upper():\n", " category = \"ACTION\"\n", "\n", "\n", " print(\"The category is \"+category)\n", "\n", " if tool == False:\n", " if conversation ==[]:\n", " conversation = [\n", " {\"role\": \"system\", \"content\": \"You are a helpful assistant. You must write <|CHATBOT_TOKEN|> before beginning your answer. Print STOP when you are finished\"},\n", " {\"role\": \"user\", \"content\": \"Thoroughly reason out the prompt \"+prompt}\n", " ]\n", "\n", " formatted = tokenizer.apply_chat_template(\n", " conversation,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", "\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", " input_length = inputs.input_ids.shape[1]\n", " print(input_length)\n", "\n", " print(\"Beginning thinking\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " #pdb.set_trace()\n", " print(\"Final thinking\")\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " if \"<|CHATBOT_TOKEN|>\" in re_output:\n", " print(\"Found start\")\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " conversation.append({\"role\": \"assistant\", \"content\": re_output})\n", " conversation.append({\"role\": \"user\", \"content\": \"Present you answer in a final, informational way to the user. \"})\n", "\n", " formatted = tokenizer.apply_chat_template(\n", " conversation,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", " input_length = inputs.input_ids.shape[1]\n", "\n", " print(\"Begin final\")\n", " kwargs = dict(**inputs, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " ree = Thread(target = model.generate, kwargs = kwargs)\n", " ree.start()\n", " partial = \"\"\n", " for text in streamer:\n", " partial += text\n", " yield partial\n", "\n", " print(\"End final\")\n", " re_output = partial\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " conversation.append({\"role\": \"assistant\", \"content\": re_output})\n", " functionGo = False\n", " do = False\n", "\n", " else:\n", " if category == \"INFORMATIONAL\":\n", " print(\"Convo for informational\")\n", " conversation = [\n", " {\"role\": \"system\", \"content\": \"You are a helpful assistant. You must write <|CHATBOT_TOKEN|> before beginning your answer. You have the tools provided here \" + desc2+\". Output function calls to use these if necessary in the exact format shown in the examples\"},\n", " {\"role\": \"user\", \"content\": \"You must print the given wikipedia tool function call to search for background info about the prompt \" +prompt}\n", " ]\n", " elif category == \"OPINION\":\n", " print(\"Convo for opinion\")\n", " conversation = [\n", " {\"role\": \"system\", \"content\": \"You are a helpful assistant. You must write <|CHATBOT_TOKEN|> before beginning your answer. You have the tools provided here \" + desc2+\". Output function calls to use these if necessary in the exact format shown in the examples\"},\n", " {\"role\": \"user\", \"content\": \"Use the googleSearch function call to search for background info about the prompt \" +prompt}\n", " ]\n", "\n", " else:\n", " conversation = [\n", " {\"role\": \"system\", \"content\": \"You are a helpful assistant. You must write <|CHATBOT_TOKEN|> before beginning your answer. You have the tools provided here \" + desc+\". Output function calls to use these if necessary in the exact format shown in the examples\"},\n", " {\"role\": \"user\", \"content\": prompt}\n", " ]\n", "\n", " if reason:\n", " pass\n", "\n", " else:\n", " research = False\n", " actionTaken = False\n", "\n", " formatted = tokenizer.apply_chat_template(\n", " conversation,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", "\n", " print(prompt)\n", " print(\"Start google search\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, stop_strings = \"STOP\", tokenizer = tokenizer)\n", "\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " matches = parse_tool_call(re_output)\n", " if matches:\n", " response = \"\"\n", " for match1 in matches:\n", " name = match1.get(\"name\")\n", " if name == \"wikipedia\" or name == \"googleSearch\" or name == \"gmail\":\n", " research = True\n", " else:\n", " actionTaken = True\n", "\n", " args = match1.get(\"args\")\n", "\n", " print(name)\n", " print(args)\n", "\n", " thing = tools[name].forward(**args)\n", " if type(thing) == dict:\n", " thing = json.dumps(thing)\n", "\n", " response += thing\n", " re_output = re_output+response\n", "\n", " if category == \"ACTION\":\n", " while actionTaken == False:\n", " print(\"Try again ding dong\")\n", " ree = model.generate(**inputs, generation_config=generationConfig, cache_implementation=None, stop_strings = \"STOP\", tokenizer = tokenizer)\n", "\n", " re_output = tokenizer.decode(ree[0], skip_special_tokens=True)\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " matches = parse_tool_call(re_output)\n", " if matches:\n", " response = \"\"\n", " for match1 in matches:\n", " name = match1.get(\"name\")\n", " if name == \"wikipedia\" or name == \"googleSearch\" or name == \"gmail\":\n", " research = True\n", " else:\n", " actionTaken = True\n", "\n", " args = match1.get(\"args\")\n", "\n", " print(name)\n", " print(args)\n", "\n", " thing = tools[name].forward(**args)\n", " if type(thing) == dict:\n", " thing = json.dumps(thing)\n", "\n", " response += thing\n", " re_output = re_output+response\n", " print(\"Finished google search\")\n", "\n", " if actionTaken:\n", " conversation.append({\"role\": \"assistant\", \"content\": \"Action taken\"+re_output})\n", "\n", " if research:\n", " conversation.append({\"role\": \"assistant\", \"content\": \"Background info\"+re_output})\n", " conversation.append({\"role\": \"user\", \"content\": prompt})\n", "\n", " formatted = tokenizer.apply_chat_template(\n", " conversation,\n", " tokenize=False,\n", " add_generation_prompt=True\n", " )\n", " inputs = tokenizer(formatted, return_tensors=\"pt\").to(\"cuda\")\n", " input_length = inputs.input_ids.shape[1]\n", " streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)\n", " print(\"Start initial prompt\")\n", " kwargs = dict(**inputs, streamer=streamer, stop_strings = \"STOP\", tokenizer = tokenizer)\n", " ree = Thread(target = model.generate, kwargs = kwargs)\n", " ree.start()\n", " partial = \"\"\n", " for text in streamer:\n", " print(text)\n", " partial += text\n", " yield partial\n", " ree.join()\n", " print(\"End initial prompt\")\n", " ree.join()\n", "\n", " print(\"Finished initial prompt\")\n", "\n", " re_output = partial\n", " re_output = re_output.split(\"<|CHATBOT_TOKEN|>\")\n", " re_output = re_output[-1]\n", "\n", " matches = parse_tool_call(re_output)\n", " if matches:\n", " response = \"\"\n", " for match1 in matches:\n", " name = match1.get(\"name\")\n", " args = match1.get(\"args\")\n", " if name == \"taskSetter\":\n", " tools[name].forward(**args)\n", " else:\n", " response += tools[name].forward(**args)\n", "\n", " re_output = re_output+response\n", "\n", "\n", " print(\"Assistant:\", re_output)\n", " conversation.append({\"role\": \"assistant\", \"content\": re_output})\n", " if actionTaken:\n", " conversation.append({\"role\": \"assistant\", \"content\": \"Action taken\"})\n", " yield \"The action has been completed\"\n", " functionGo = False\n", " del ree, inputs # drop large tensors\n", " import gc; gc.collect()\n", " torch.cuda.empty_cache()\n", " yield conversation\n" ], "metadata": { "id": "BBP6KHjNCBf2" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "conv = []\n", "#x = main(conv, True, model, tokenizer, generationConfig, streamer, \"Set a reminder for my graduation on june 4 2026\")\n" ], "metadata": { "id": "_PMU8ouIuYTR" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "# Exact same path as Gradio\n", "'''\n", "list(uiVersion(\n", " conversation=[],\n", " tool=True, # same as Gradio\n", " model=model,\n", " tokenizer=tokenizer,\n", " generationConfig=generationConfig,\n", " streamer=specialStreamer,\n", " prompt=\"Describe the economy of thailand\"\n", "))\n", "'''" ], "metadata": { "id": "kA0IZqr_GZjf", "colab": { "base_uri": "https://localhost:8080/", "height": 52 }, "outputId": "be93b6c4-630d-4bd2-e3b9-01efce15dc2e" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'\\nlist(uiVersion(\\n conversation=[],\\n tool=True, # same as Gradio\\n model=model,\\n tokenizer=tokenizer,\\n generationConfig=generationConfig,\\n streamer=specialStreamer,\\n prompt=\"Describe the economy of thailand\"\\n))\\n'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 83 } ] }, { "cell_type": "code", "source": [ "import torch\n", "import gc\n", "\n", "# How many model-sized things are on GPU?\n", "big_tensors = []\n", "for obj in gc.get_objects():\n", " try:\n", " if torch.is_tensor(obj) and obj.is_cuda:\n", " size_gb = obj.numel() * obj.element_size() / 1e9\n", " if size_gb > 0.01: # only show >10MB tensors\n", " big_tensors.append((size_gb, tuple(obj.shape), obj.dtype))\n", " except Exception:\n", " pass\n", "\n", "big_tensors.sort(reverse=True)\n", "total = sum(s for s, _, _ in big_tensors)\n", "print(f\"Total in big tensors: {total:.2f} GB\")\n", "print(f\"Count: {len(big_tensors)}\")\n", "for s, shape, dtype in big_tensors[:20]:\n", " print(f\" {s:.3f} GB {shape} {dtype}\")" ], "metadata": { "id": "-hUdK5MOHB2M", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "7db44dfc-0f75-4eac-ccf2-a7f71b1c5b7d" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "/usr/local/lib/python3.12/dist-packages/torch/__init__.py:1164: FutureWarning: `torch.distributed.reduce_op` is deprecated, please use `torch.distributed.ReduceOp` instead\n", " return isinstance(obj, torch.Tensor)\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ "Total in big tensors: 15.52 GB\n", "Count: 321\n", " 2.097 GB (256000, 4096) torch.float16\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n", " 0.059 GB (14336, 4096) torch.int8\n" ] } ] }, { "cell_type": "code", "source": [ "import gradio as gr\n", "\n", "def printer(string, conversation, chatbot):\n", " partial = \"\"\n", " happen = False\n", " chatbot.append((gr.ChatMessage(role = \"user\", content = string)))\n", " chatbot.append((gr.ChatMessage(role = \"assistant\", content = \"Thinking...\")))\n", "\n", " yield string, conversation, chatbot\n", "\n", " print(\"Beginning generation\")\n", " for partial in uiVersion(conversation, True, model, tokenizer, generationConfig,\n", " specialStreamer, string):\n", " if type(partial) == str:\n", " chatbot[-1] = (gr.ChatMessage(role = \"assistant\", content = partial))\n", " yield string, conversation, chatbot\n", "\n", " if type(partial) == list:\n", " conversation = partial\n", " yield string, conversation, chatbot\n", "\n", "\n", "\n", "\n", "\n", "\n" ], "metadata": { "id": "9G_GhejjbOOC" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "\n", "with gr.Blocks(theme = gr.themes.Ocean()) as demo:\n", " helperBot = gr.Chatbot()\n", " convo = gr.State([])\n", " #gr.Markdown(\"Hello World\")\n", " input = gr.Textbox(\"\")\n", " input.submit(printer, [input, convo, helperBot], [input, convo, helperBot])\n", "\n", " helperBot\n", "\n", "demo.launch(debug=True, show_error=True)" ], "metadata": { "id": "CJ_YaY81bXuC", "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "outputId": "2a998a2c-af01-4357-ee4f-8e6d1ec1be9b" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "/tmp/ipykernel_1796/1947916084.py:1: UserWarning: The parameters have been moved from the Blocks constructor to the launch() method in Gradio 6.0: theme. Please pass these parameters to launch() instead.\n", " with gr.Blocks(theme = gr.themes.Ocean()) as demo:\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ "It looks like you are running Gradio on a hosted Jupyter notebook, which requires `share=True`. Automatically setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n", "\n", "Colab notebook detected. This cell will run indefinitely so that you can see errors and logs. To turn off, set debug=False in launch().\n", "* Running on public URL: https://f6b78c36de0f1a00c7.gradio.live\n", "\n", "This share link expires in 1 week. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "<IPython.core.display.HTML object>" ], "text/html": [ "<div><iframe src=\"https://f6b78c36de0f1a00c7.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>" ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "Beginning generation\n", "The category is OPINION\n", "Convo for opinion\n", "What who has robot friend and face yes yes yes aweerwgq\n", "Start google search\n", "googleSearch\n", "{'task': 'What who has robot friend and face yes yes yes aweer wg q'}\n", "trying\n", "Finished google search\n", "Start initial prompt\n", "\n", "\n", "I'm \n", "\n", "sorry, \n", "I \n", "\n", "couldn't \n", "find \n", "any \n", "relevant \n", "information \n", "for \n", "the \n", "search \n", "query \n", "\n", "\"What \n", "who \n", "has \n", "robot \n", "friend \n", "and \n", "face \n", "yes \n", "yes \n", "yes \n", "\n", "\n", "\n", "\n", "aweerwgq\". \n", "The \n", "search \n", "results \n", "seem \n", "to \n", "be \n", "unrelated \n", "or \n", "\n", "incomplete. \n", "Could \n", "you \n", "please \n", "provide \n", "more \n", "context \n", "or \n", "clarify \n", "the \n", "\n", "\n", "\n", "question?\n", "End initial prompt\n", "Finished initial prompt\n", "Assistant: I'm sorry, I couldn't find any relevant information for the search query \"What who has robot friend and face yes yes yes aweerwgq\". The search results seem to be unrelated or incomplete. Could you please provide more context or clarify the question?\n", "Keyboard interruption in main thread... closing server.\n", "Killing tunnel 127.0.0.1:7860 <> https://f6b78c36de0f1a00c7.gradio.live\n" ] }, { "output_type": "execute_result", "data": { "text/plain": [] }, "metadata": {}, "execution_count": 90 } ] }, { "cell_type": "code", "source": [ "demo.close()\n", "torch.cuda.empty_cache()\n", "\n", "import gc; gc.collect()" ], "metadata": { "id": "HWEGsDyZPFvg", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "3c7a0d94-eb84-47a3-e1f6-17b128d0dfe4" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Closing server running on port: 7860\n" ] }, { "output_type": "execute_result", "data": { "text/plain": [ "41081" ] }, "metadata": {}, "execution_count": 89 } ] } ], "metadata": { "accelerator": "GPU", "colab": { "gpuType": "T4", "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "version_major": 2, "version_minor": 0, "state": { "f8ed928fb86d4a1a91033aad610131d4": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_ba8ee85b32024e73b55fef506a68ba45", "IPY_MODEL_6a5b75943b0b41b995fb8e44d7394dfa", "IPY_MODEL_a12a34d619e44f66b0bb70d27d808fb4" ], "layout": "IPY_MODEL_35eebbfb80c347a594eadc8e649eaa26" } }, "ba8ee85b32024e73b55fef506a68ba45": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_af348396d6e34a4e9f66019445f84a0f", "placeholder": "​", "style": "IPY_MODEL_9aace401736b438da1f601619e6b2341", "value": "config.json: " } }, "6a5b75943b0b41b995fb8e44d7394dfa": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_a056e25fb8a344fb8f666450b6830b7e", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_9eeb61145c2e43ecabbf2869295bd36a", "value": 1 } }, "a12a34d619e44f66b0bb70d27d808fb4": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_607d1d5a35594065bf3d75f413f20337", "placeholder": "​", "style": "IPY_MODEL_9a9859a4717e4af4a422c160e5c75b21", "value": " 2.35k/? [00:00<00:00, 82.3kB/s]" } }, "35eebbfb80c347a594eadc8e649eaa26": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "af348396d6e34a4e9f66019445f84a0f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "9aace401736b438da1f601619e6b2341": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "a056e25fb8a344fb8f666450b6830b7e": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "9eeb61145c2e43ecabbf2869295bd36a": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "607d1d5a35594065bf3d75f413f20337": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "9a9859a4717e4af4a422c160e5c75b21": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "1e091505d29846b0b0cb52ad9e5608dc": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "66e8e3d54a96495ba5049b70bbffdbf1": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "7707e05e5aea4414bbd323f7156ad22a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "bb3f44a77a544c59a4815f4a47ad1807": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "1cd5a8e27a7e4562bb24a4010ea1beae": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "da824e489d68435cb3aea402fcbb5fa8": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "53c1132b9f6647d5a59f3edc380fd411": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_7707e05e5aea4414bbd323f7156ad22a", "placeholder": "​", "style": "IPY_MODEL_bb3f44a77a544c59a4815f4a47ad1807", "value": "model.safetensors.index.json: " } }, "8f54a88d71a840628f67ee20e05bc00e": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_1e091505d29846b0b0cb52ad9e5608dc", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_66e8e3d54a96495ba5049b70bbffdbf1", "value": 1 } }, "5ec6321329844320ac2f2c0dfa493df7": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_1cd5a8e27a7e4562bb24a4010ea1beae", "placeholder": "​", "style": "IPY_MODEL_da824e489d68435cb3aea402fcbb5fa8", "value": " 58.3k/? [00:00<00:00, 1.44MB/s]" } }, "6276a71153fe4d31954f03df4aefc09d": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "17cb11bb653047d48937dceccc3ce62f": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_53c1132b9f6647d5a59f3edc380fd411", "IPY_MODEL_8f54a88d71a840628f67ee20e05bc00e", "IPY_MODEL_5ec6321329844320ac2f2c0dfa493df7" ], "layout": "IPY_MODEL_6276a71153fe4d31954f03df4aefc09d" } }, "901b89745e1f424eb94a7f735809dc34": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "1564dec4945f42cd9b956f2963cfdce0": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "650f137ad7774569ad799f42c47f9185": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a2598f281406434989d84956a17647a9": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "a811009316fb4e85835385ea7f97f013": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "84d3c1b47bad401eb15fd5d84d5f8e63": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "b4c2241c4e1e49848922a35c4d25dc18": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_650f137ad7774569ad799f42c47f9185", "placeholder": "​", "style": "IPY_MODEL_a2598f281406434989d84956a17647a9", "value": "Fetching 2 files: 100%" } }, "6b7e1c8b501a4b6f9442b19d962e3b2a": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_901b89745e1f424eb94a7f735809dc34", "max": 2, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_1564dec4945f42cd9b956f2963cfdce0", "value": 2 } }, "02cb646f06bd41fdae37d2a8f33c0464": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_a811009316fb4e85835385ea7f97f013", "placeholder": "​", "style": "IPY_MODEL_84d3c1b47bad401eb15fd5d84d5f8e63", "value": " 2/2 [04:01<00:00, 107.43s/it]" } }, "ecc3b3d0ca8d4a719d314fdbeafda297": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "3f3fe09381d24fc3b6a950458713922c": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_b4c2241c4e1e49848922a35c4d25dc18", "IPY_MODEL_6b7e1c8b501a4b6f9442b19d962e3b2a", "IPY_MODEL_02cb646f06bd41fdae37d2a8f33c0464" ], "layout": "IPY_MODEL_ecc3b3d0ca8d4a719d314fdbeafda297" } }, "8a4c49c8193c4cd3bf3237542dc6b7da": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "0b4185edeeb5455c926b2175a8f36108": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "810940c6110a445f84cbb6b1cd3e2ebb": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "4a8794cd91be441ea942344e7ac999ae": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "15c08727fc1040fdad96b886a55c6c0d": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "83bda57224064a8a94401d3591b0fef7": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "2377abdc97714638b38ffa2df887b5e5": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_810940c6110a445f84cbb6b1cd3e2ebb", "placeholder": "​", "style": "IPY_MODEL_4a8794cd91be441ea942344e7ac999ae", "value": "model-00001-of-00002.safetensors: 100%" } }, "490e7ec9ab014f98b239853acebd2433": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_8a4c49c8193c4cd3bf3237542dc6b7da", "max": 4976967471, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_0b4185edeeb5455c926b2175a8f36108", "value": 4976967471 } }, "d74402cbc13741db848a19b0e1382869": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_15c08727fc1040fdad96b886a55c6c0d", "placeholder": "​", "style": "IPY_MODEL_83bda57224064a8a94401d3591b0fef7", "value": " 4.98G/4.98G [03:15<00:00, 13.8MB/s]" } }, "4592f13df65e42dd9dcccf159ebccd65": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "d62e3f13ecf54a388e97f42bce5ceba1": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "cf23ad9834ad437c9d57ad7f65c07eac": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "caccef0ffb5b4cd89516db9b9f1a957a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "d5b544492c94491ab956e0cc5930e7aa": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "dccfd08555f74e0790232013204ae7b3": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_2377abdc97714638b38ffa2df887b5e5", "IPY_MODEL_490e7ec9ab014f98b239853acebd2433", "IPY_MODEL_d74402cbc13741db848a19b0e1382869" ], "layout": "IPY_MODEL_4592f13df65e42dd9dcccf159ebccd65" } }, "9bcad67bb646432eb6bc114cb85f5600": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_80946022df144c7e8af55d7486240829", "IPY_MODEL_89248f42726a455aa48b82494b752dfa", "IPY_MODEL_5540f0d841a04d97989b1696c63d6d3e" ], "layout": "IPY_MODEL_2c6aa9be36af4a00bb980259c7dc495f" } }, "80946022df144c7e8af55d7486240829": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_caccef0ffb5b4cd89516db9b9f1a957a", "placeholder": "​", "style": "IPY_MODEL_d5b544492c94491ab956e0cc5930e7aa", "value": "model-00002-of-00002.safetensors: 100%" } }, "89248f42726a455aa48b82494b752dfa": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_d62e3f13ecf54a388e97f42bce5ceba1", "max": 4105629169, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_cf23ad9834ad437c9d57ad7f65c07eac", "value": 4105629169 } }, "5540f0d841a04d97989b1696c63d6d3e": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_83c01fa857af46e2ac075e9a92aee662", "placeholder": "​", "style": "IPY_MODEL_d448b6bf5cb54a9b989d08b2a403f1b2", "value": " 4.11G/4.11G [03:59<00:00, 32.3MB/s]" } }, "2c6aa9be36af4a00bb980259c7dc495f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "83c01fa857af46e2ac075e9a92aee662": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "d448b6bf5cb54a9b989d08b2a403f1b2": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "fc908588c3994e25ae3ba650da5147d5": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_a3bd62aceaec4daaac46473a32405d9d", "IPY_MODEL_7bb116a5c2214d669f8b207c4ef73e05", "IPY_MODEL_a772c24a277f4cc093ca908067432786" ], "layout": "IPY_MODEL_043ae9adf1a04df39e85ae63441db09b" } }, "a3bd62aceaec4daaac46473a32405d9d": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_6597ab68d8a247da8d4c1ac63facefdf", "placeholder": "​", "style": "IPY_MODEL_1e4567d334ae47f699e720809ffdfce5", "value": "Loading checkpoint shards: 100%" } }, "7bb116a5c2214d669f8b207c4ef73e05": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_cb9e264d3dac47dc92f08434aa10da06", "max": 2, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_170eecf037724fe6ba5bdd74b4650210", "value": 2 } }, "a772c24a277f4cc093ca908067432786": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_cbe0cdcc5c9e474e8e876068b3d71c6a", "placeholder": "​", "style": "IPY_MODEL_17f855c87c474f2bb72555258d319a69", "value": " 2/2 [00:42<00:00, 20.67s/it]" } }, "043ae9adf1a04df39e85ae63441db09b": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "6597ab68d8a247da8d4c1ac63facefdf": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "1e4567d334ae47f699e720809ffdfce5": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "cb9e264d3dac47dc92f08434aa10da06": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "170eecf037724fe6ba5bdd74b4650210": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "cbe0cdcc5c9e474e8e876068b3d71c6a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "17f855c87c474f2bb72555258d319a69": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "a0e280c4b71b4bc594c063be670c01ed": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "004031ad9af2436487e07c8f89547efa": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "024e47f772624a7bba264eeb5b62f59a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "da06071b882a49c4b4df867419df1d76": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "b4f840c42a894701b295303e4fb1765c": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "954e3a978aa1433182cc042d20f51319": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "7d83b099df5e4fe491809e763dd85cb6": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_024e47f772624a7bba264eeb5b62f59a", "placeholder": "​", "style": "IPY_MODEL_da06071b882a49c4b4df867419df1d76", "value": "generation_config.json: 100%" } }, "f742e8b1ea704e4bb8066176527518b5": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_a0e280c4b71b4bc594c063be670c01ed", "max": 197, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_004031ad9af2436487e07c8f89547efa", "value": 197 } }, "3bdc3ca52ead41f5845fe0301af1f45d": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_b4f840c42a894701b295303e4fb1765c", "placeholder": "​", "style": "IPY_MODEL_954e3a978aa1433182cc042d20f51319", "value": " 197/197 [00:00<00:00, 18.6kB/s]" } }, "3a65c565c9c147709a7713c8e71f52fe": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "b2eb3458e73141ceaeaf8b1bd407b21e": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_7d83b099df5e4fe491809e763dd85cb6", "IPY_MODEL_f742e8b1ea704e4bb8066176527518b5", "IPY_MODEL_3bdc3ca52ead41f5845fe0301af1f45d" ], "layout": "IPY_MODEL_3a65c565c9c147709a7713c8e71f52fe" } }, "592d75603dce4a8cbadcc62158a2fa82": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "219558ec2b7f400ca781911749759dc1": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "c39cc322fa5c4713b85765afa3b79bbb": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "087a6a4634e847d3a8cd09211a5943bb": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "332981e9157d4856bf68b4318db0794f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "f7dd47f6f3a84399beaef3e7b86ffe78": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "bd2f64b3067349778400820a4691a4aa": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c39cc322fa5c4713b85765afa3b79bbb", "placeholder": "​", "style": "IPY_MODEL_087a6a4634e847d3a8cd09211a5943bb", "value": "tokenizer_config.json: " } }, "1c5b285ce52042e6a86c4803f6fb7e19": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_592d75603dce4a8cbadcc62158a2fa82", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_219558ec2b7f400ca781911749759dc1", "value": 1 } }, "61d5c60bd8eb4ce4875dc94070369047": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_332981e9157d4856bf68b4318db0794f", "placeholder": "​", "style": "IPY_MODEL_f7dd47f6f3a84399beaef3e7b86ffe78", "value": " 8.18k/? [00:00<00:00, 514kB/s]" } }, "78c4b1972d1e48dbad88c53f9dfe218a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a87e9f01f1ae4da5a896c4418f32ffda": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_bd2f64b3067349778400820a4691a4aa", "IPY_MODEL_1c5b285ce52042e6a86c4803f6fb7e19", "IPY_MODEL_61d5c60bd8eb4ce4875dc94070369047" ], "layout": "IPY_MODEL_78c4b1972d1e48dbad88c53f9dfe218a" } }, "0885f0cf5e604afd862c84c86989fa3e": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "6f307294a0f34d849da45377dabb77dc": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "6fbc22bb5e5647dd9e1472871ca34f63": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a531f0bb1243485b83a49ba6586f7f9b": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "6ed6f5793cb24211bca27337dc7ac64c": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "b7d519eb79354edd9c31a36455224fbd": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "60b0025e89f54b04a330061510b4d982": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_6fbc22bb5e5647dd9e1472871ca34f63", "placeholder": "​", "style": "IPY_MODEL_a531f0bb1243485b83a49ba6586f7f9b", "value": "tokenizer.json: 100%" } }, "c39f98b4c0d042e1b272c4518f296f3a": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_0885f0cf5e604afd862c84c86989fa3e", "max": 20124922, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_6f307294a0f34d849da45377dabb77dc", "value": 20124922 } }, "79fe29caa930420e861cedd66f7a08f1": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_6ed6f5793cb24211bca27337dc7ac64c", "placeholder": "​", "style": "IPY_MODEL_b7d519eb79354edd9c31a36455224fbd", "value": " 20.1M/20.1M [00:01<00:00, 15.1MB/s]" } }, "4f78666428414995922e48c6c230de0f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "2f84e7ec830543b58dc62c5256cc8c4c": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_60b0025e89f54b04a330061510b4d982", "IPY_MODEL_c39f98b4c0d042e1b272c4518f296f3a", "IPY_MODEL_79fe29caa930420e861cedd66f7a08f1" ], "layout": "IPY_MODEL_4f78666428414995922e48c6c230de0f" } }, "63ccc341ee034f578ed885e47664a0f5": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "172fecfa5a1c4b40bb59a4e47c6e16de": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "2b519a5efee74347afb3a5920adfdd78": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "8dd54a2812254964870a5b9440075e16": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "3306b989c1374c7ca8d919ed63e8b0fb": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "bbbd96cdacfc4ee29f9bdbcdbdaa3d60": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "9bd15797a66c4676b8d90219e80fcc4b": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_2b519a5efee74347afb3a5920adfdd78", "placeholder": "​", "style": "IPY_MODEL_8dd54a2812254964870a5b9440075e16", "value": "special_tokens_map.json: 100%" } }, "aeb5f2addf8049dabba7ebbc6c1a9e76": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_63ccc341ee034f578ed885e47664a0f5", "max": 664, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_172fecfa5a1c4b40bb59a4e47c6e16de", "value": 664 } }, "d94edf2caeae489d9ed7efdcc1469296": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_3306b989c1374c7ca8d919ed63e8b0fb", "placeholder": "​", "style": "IPY_MODEL_bbbd96cdacfc4ee29f9bdbcdbdaa3d60", "value": " 664/664 [00:00<00:00, 62.6kB/s]" } }, "d2eb5853f2824fdbbb5947ef137da191": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "857cf8f6bacd4eb1b309ef8c7c08a874": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_9bd15797a66c4676b8d90219e80fcc4b", "IPY_MODEL_aeb5f2addf8049dabba7ebbc6c1a9e76", "IPY_MODEL_d94edf2caeae489d9ed7efdcc1469296" ], "layout": "IPY_MODEL_d2eb5853f2824fdbbb5947ef137da191" } }, "139e81f03c4e4027bbe569ee4ccf0fb9": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "fbbba7dfd3e24f2ca3056f145f986574": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "0a0061ad29d34387a50e0d1cb049b457": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "3d29492f3728452faa249006fbbc620d": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "eeac80600299408ba3da1f6073c15b4c": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a7aff3ccac5b408792b94d3e08552b56": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "567180854a3a48218c768c1323fc994c": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_0a0061ad29d34387a50e0d1cb049b457", "placeholder": "​", "style": "IPY_MODEL_3d29492f3728452faa249006fbbc620d", "value": "chat_template.jinja: " } }, "f74a60887eca414ca48969b061711f5a": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_139e81f03c4e4027bbe569ee4ccf0fb9", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_fbbba7dfd3e24f2ca3056f145f986574", "value": 1 } }, "f06454683d3f41db820039aad4772266": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_eeac80600299408ba3da1f6073c15b4c", "placeholder": "​", "style": "IPY_MODEL_a7aff3ccac5b408792b94d3e08552b56", "value": " 12.8k/? [00:00<00:00, 1.01MB/s]" } }, "d80ddf13231d4c79b9b564df186a1e93": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "03a9ee8936334851979a2878d9b78a12": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_567180854a3a48218c768c1323fc994c", "IPY_MODEL_f74a60887eca414ca48969b061711f5a", "IPY_MODEL_f06454683d3f41db820039aad4772266" ], "layout": "IPY_MODEL_d80ddf13231d4c79b9b564df186a1e93" } } } } } }, "nbformat": 4, "nbformat_minor": 0 }