alonsosilva commited on
Commit
acef88c
·
unverified ·
1 Parent(s): 5eaf348

Add Batch Processing for Multiple Choice Questions notebook

Browse files
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .ipynb_checkpoints/
Litelines_Batch_Processing_Multiple_Choice.ipynb ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": [],
7
+ "gpuType": "T4"
8
+ },
9
+ "kernelspec": {
10
+ "name": "python3",
11
+ "display_name": "Python 3"
12
+ },
13
+ "language_info": {
14
+ "name": "python"
15
+ },
16
+ "accelerator": "GPU"
17
+ },
18
+ "cells": [
19
+ {
20
+ "cell_type": "markdown",
21
+ "source": [
22
+ "# Batch Processing for Multiple-Choice Questions"
23
+ ],
24
+ "metadata": {
25
+ "id": "bjbqHUTuNFyd"
26
+ }
27
+ },
28
+ {
29
+ "cell_type": "markdown",
30
+ "source": [
31
+ "# 1. Install Litelines"
32
+ ],
33
+ "metadata": {
34
+ "id": "B8jIr1KAKQWF"
35
+ }
36
+ },
37
+ {
38
+ "cell_type": "code",
39
+ "execution_count": 1,
40
+ "metadata": {
41
+ "id": "cvgtiC0Kcl-z"
42
+ },
43
+ "outputs": [],
44
+ "source": [
45
+ "%pip install --quiet --upgrade litelines"
46
+ ]
47
+ },
48
+ {
49
+ "cell_type": "markdown",
50
+ "source": [
51
+ "## 2. Download a model and its tokenizer"
52
+ ],
53
+ "metadata": {
54
+ "id": "-dLJS16ZNy97"
55
+ }
56
+ },
57
+ {
58
+ "cell_type": "code",
59
+ "source": [
60
+ "# Use cuda for faster inference\n",
61
+ "import torch\n",
62
+ "\n",
63
+ "device = torch.device(\"cuda\") if torch.cuda.is_available() else torch.device(\"cpu\")\n",
64
+ "assert device == torch.device(\"cuda\"), \"In the Runtime tab, please Change runtime type to GPU\""
65
+ ],
66
+ "metadata": {
67
+ "id": "68zKdmOQcqLo"
68
+ },
69
+ "execution_count": 2,
70
+ "outputs": []
71
+ },
72
+ {
73
+ "cell_type": "code",
74
+ "source": [
75
+ "from transformers import AutoModelForCausalLM, AutoTokenizer\n",
76
+ "\n",
77
+ "MODEL_ID = \"Qwen/Qwen2.5-0.5B-Instruct\"\n",
78
+ "tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)\n",
79
+ "model = AutoModelForCausalLM.from_pretrained(MODEL_ID).to(device)"
80
+ ],
81
+ "metadata": {
82
+ "id": "U-a-w5jwc6Xg"
83
+ },
84
+ "execution_count": 3,
85
+ "outputs": []
86
+ },
87
+ {
88
+ "cell_type": "markdown",
89
+ "source": [
90
+ "## 3. Prepare the inputs to the LLM"
91
+ ],
92
+ "metadata": {
93
+ "id": "ohUnAx9NJ7AV"
94
+ }
95
+ },
96
+ {
97
+ "cell_type": "code",
98
+ "source": [
99
+ "user_inputs = [\"What is the capital of France?\", \"What is the capital of Italy?\", \"What is the capital of Spain?\"]\n",
100
+ "alternatives = \"\"\"\n",
101
+ "A) Madrid\n",
102
+ "B) Paris\n",
103
+ "C) Rome\n",
104
+ "\"\"\"\n",
105
+ "messages = [[{\"role\": \"user\", \"content\": user_input + alternatives}] for user_input in user_inputs]\n",
106
+ "formatted_messages = [\n",
107
+ " tokenizer.apply_chat_template(message, tokenize=False, add_generation_prompt=True) for message in messages\n",
108
+ "]\n",
109
+ "inputs = tokenizer(\n",
110
+ " formatted_messages,\n",
111
+ " return_tensors=\"pt\",\n",
112
+ " padding=True,\n",
113
+ " truncation=True\n",
114
+ ").to(device)\n",
115
+ "prompt_length = inputs['input_ids'].shape[-1]"
116
+ ],
117
+ "metadata": {
118
+ "id": "6YLLQze67KV1"
119
+ },
120
+ "execution_count": 4,
121
+ "outputs": []
122
+ },
123
+ {
124
+ "cell_type": "markdown",
125
+ "source": [
126
+ "## 4. Define a processor through a regular expression"
127
+ ],
128
+ "metadata": {
129
+ "id": "9LaJrh0PKkcn"
130
+ }
131
+ },
132
+ {
133
+ "cell_type": "code",
134
+ "source": [
135
+ "from litelines.transformers import SchemaProcessor\n",
136
+ "\n",
137
+ "processor = SchemaProcessor(response_format=r\"A\\.|B\\.|C\\.\", tokenizer=tokenizer)\n",
138
+ "processor.show_graph()"
139
+ ],
140
+ "metadata": {
141
+ "colab": {
142
+ "base_uri": "https://localhost:8080/",
143
+ "height": 331
144
+ },
145
+ "id": "sVx6IzInKHoL",
146
+ "outputId": "9c3bf54f-95a5-4b7b-e870-dd7a3d2e45dd"
147
+ },
148
+ "execution_count": 5,
149
+ "outputs": [
150
+ {
151
+ "output_type": "display_data",
152
+ "data": {
153
+ "text/plain": [
154
+ "<IPython.core.display.SVG object>"
155
+ ],
156
+ "image/svg+xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401pt\" height=\"232pt\" viewBox=\"0.00 0.00 401.00 232.00\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 228)\">\n<title>%3</title>\n<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-228 397,-228 397,4 -4,4\"/>\n<text text-anchor=\"middle\" x=\"92\" y=\"-208.8\" font-family=\"Times,serif\" font-size=\"14.00\">Allowed Paths</text>\n<text text-anchor=\"middle\" x=\"92\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">Regular expression: A\\.|B\\.|C\\.</text>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"109\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"109\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-148\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-144.3\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge2\" class=\"edge\">\n<title>0-&gt;1</title>\n<path fill=\"none\" stroke=\"black\" d=\"M118.83,-98.31C125,-107.68 134.08,-119.14 145,-126 164.59,-138.31 190.49,-143.74 209.81,-146.13\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.48,-149.61 219.79,-147.16 210.21,-142.65 209.48,-149.61\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-165 145.5,-186 165.5,-186 165.5,-165 145.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-165 145.5,-186 165.5,-186 165.5,-165 145.5,-165\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-165 165.5,-186 202.5,-186 202.5,-165 165.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-165 165.5,-186 202.5,-186 202.5,-165 165.5,-165\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-144 145.5,-165 165.5,-165 165.5,-144 145.5,-144\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">34</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-144 165.5,-165 202.5,-165 202.5,-144 165.5,-144\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\">C</text>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n</g>\n<!-- 0&#45;&gt;2 -->\n<g id=\"edge3\" class=\"edge\">\n<title>0-&gt;2</title>\n<path fill=\"none\" stroke=\"black\" d=\"M127.13,-83C148.24,-83 184.4,-83 209.44,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.74,-86.5 219.74,-83 209.74,-79.5 209.74,-86.5\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-104 145.5,-125 165.5,-125 165.5,-104 145.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-104 145.5,-125 165.5,-125 165.5,-104 145.5,-104\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-104 165.5,-125 202.5,-125 202.5,-104 165.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-104 165.5,-125 202.5,-125 202.5,-104 165.5,-104\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-83 145.5,-104 165.5,-104 165.5,-83 145.5,-83\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">33</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-83 165.5,-104 202.5,-104 202.5,-83 165.5,-83\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\">B</text>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n</g>\n<!-- 0&#45;&gt;3 -->\n<g id=\"edge4\" class=\"edge\">\n<title>0-&gt;3</title>\n<path fill=\"none\" stroke=\"black\" d=\"M117.98,-67.39C124.03,-57.17 133.28,-44.38 145,-37 164.45,-24.75 190.36,-20.23 209.73,-18.64\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.96,-22.13 219.73,-18.03 209.53,-15.15 209.96,-22.13\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-58 145.5,-79 165.5,-79 165.5,-58 145.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-58 145.5,-79 165.5,-79 165.5,-58 145.5,-58\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-58 165.5,-79 202.5,-79 202.5,-58 165.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-58 165.5,-79 202.5,-79 202.5,-58 165.5,-58\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-37 145.5,-58 165.5,-58 165.5,-37 145.5,-37\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">32</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-37 165.5,-58 202.5,-58 202.5,-37 165.5,-37\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\">A</text>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"371\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"371\" cy=\"-83\" rx=\"22\" ry=\"22\"/>\n<text text-anchor=\"middle\" x=\"371\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n</g>\n<!-- 1&#45;&gt;4 -->\n<g id=\"edge5\" class=\"edge\">\n<title>1-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.07,-146.94C275.44,-145.08 307.4,-139.97 331,-126 338.44,-121.6 345.27,-115.32 351.07,-108.91\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"354.08,-110.77 357.83,-100.86 348.72,-106.27 354.08,-110.77\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-165 274.5,-186 294.5,-186 294.5,-165 274.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-165 274.5,-186 294.5,-186 294.5,-165 274.5,-165\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-165 294.5,-186 331.5,-186 331.5,-165 294.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-165 294.5,-186 331.5,-186 331.5,-165 294.5,-165\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-144 274.5,-165 294.5,-165 294.5,-144 274.5,-144\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-144 294.5,-165 331.5,-165 331.5,-144 294.5,-144\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge6\" class=\"edge\">\n<title>2-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.13,-83C277.09,-83 313.01,-83 338.9,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"338.97,-86.5 348.97,-83 338.97,-79.5 338.97,-86.5\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-104 274.5,-125 294.5,-125 294.5,-104 274.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-104 274.5,-125 294.5,-125 294.5,-104 274.5,-104\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-104 294.5,-125 331.5,-125 331.5,-104 294.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-104 294.5,-125 331.5,-125 331.5,-104 294.5,-104\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-83 274.5,-104 294.5,-104 294.5,-83 274.5,-83\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-83 294.5,-104 331.5,-104 331.5,-83 294.5,-83\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<!-- 3&#45;&gt;4 -->\n<g id=\"edge7\" class=\"edge\">\n<title>3-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.13,-18.25C275.56,-19.25 307.58,-23.1 331,-37 339.15,-41.84 346.42,-49.01 352.4,-56.26\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"349.97,-58.84 358.82,-64.67 355.54,-54.6 349.97,-58.84\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-58 274.5,-79 294.5,-79 294.5,-58 274.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-58 274.5,-79 294.5,-79 294.5,-58 274.5,-58\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-58 294.5,-79 331.5,-79 331.5,-58 294.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-58 294.5,-79 331.5,-79 331.5,-58 294.5,-58\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-37 274.5,-58 294.5,-58 294.5,-37 274.5,-37\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-37 294.5,-58 331.5,-58 331.5,-37 294.5,-37\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<g id=\"node6\" class=\"node\">\n<title/>\n</g>\n<!-- &#45;&gt;0 -->\n<g id=\"edge1\" class=\"edge\">\n<title>-&gt;0</title>\n<path fill=\"none\" stroke=\"black\" d=\"M54.19,-83C62.65,-83 72.05,-83 80.6,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"80.83,-86.5 90.83,-83 80.83,-79.5 80.83,-86.5\"/>\n</g>\n</g>\n</svg>"
157
+ },
158
+ "metadata": {}
159
+ }
160
+ ]
161
+ },
162
+ {
163
+ "cell_type": "markdown",
164
+ "source": [
165
+ "## 5. Generate a structured response"
166
+ ],
167
+ "metadata": {
168
+ "id": "UUkc7wXcOQlN"
169
+ }
170
+ },
171
+ {
172
+ "cell_type": "code",
173
+ "source": [
174
+ "outputs = model.generate(\n",
175
+ " inputs.input_ids,\n",
176
+ " attention_mask=inputs.attention_mask,\n",
177
+ " pad_token_id=tokenizer.eos_token_id,\n",
178
+ " logits_processor=[processor],\n",
179
+ " temperature=0.1\n",
180
+ ")\n",
181
+ "generated_texts = tokenizer.batch_decode([output[prompt_length:] for output in outputs], skip_special_tokens=True)\n",
182
+ "formatted_strings = [f\"Question: {user_inputs[i]+alternatives}\\n\\x1b[34mResponse:\\x1b[0m \\x1b[31m{generated_texts[i]}\\x1b[0m\" for i in range(len(user_inputs))]\n",
183
+ "for string in formatted_strings:\n",
184
+ " print(string)\n",
185
+ " print()"
186
+ ],
187
+ "metadata": {
188
+ "colab": {
189
+ "base_uri": "https://localhost:8080/"
190
+ },
191
+ "id": "h9dLX3Xl_9dy",
192
+ "outputId": "567cf76e-179c-463c-abb2-ff8522237f3f"
193
+ },
194
+ "execution_count": 6,
195
+ "outputs": [
196
+ {
197
+ "output_type": "stream",
198
+ "name": "stdout",
199
+ "text": [
200
+ "Question: What is the capital of France?\n",
201
+ "A) Madrid\n",
202
+ "B) Paris\n",
203
+ "C) Rome\n",
204
+ "\n",
205
+ "\u001b[34mResponse:\u001b[0m \u001b[31mB.\u001b[0m\n",
206
+ "\n",
207
+ "Question: What is the capital of Italy?\n",
208
+ "A) Madrid\n",
209
+ "B) Paris\n",
210
+ "C) Rome\n",
211
+ "\n",
212
+ "\u001b[34mResponse:\u001b[0m \u001b[31mC.\u001b[0m\n",
213
+ "\n",
214
+ "Question: What is the capital of Spain?\n",
215
+ "A) Madrid\n",
216
+ "B) Paris\n",
217
+ "C) Rome\n",
218
+ "\n",
219
+ "\u001b[34mResponse:\u001b[0m \u001b[31mA.\u001b[0m\n",
220
+ "\n"
221
+ ]
222
+ }
223
+ ]
224
+ },
225
+ {
226
+ "cell_type": "markdown",
227
+ "source": [
228
+ "## 6. Visualize the selected paths"
229
+ ],
230
+ "metadata": {
231
+ "id": "7ANqIJQ_M9fH"
232
+ }
233
+ },
234
+ {
235
+ "cell_type": "code",
236
+ "source": [
237
+ "processor.show_graph(batch_number=0)"
238
+ ],
239
+ "metadata": {
240
+ "colab": {
241
+ "base_uri": "https://localhost:8080/",
242
+ "height": 331
243
+ },
244
+ "id": "Pqo5AVexMnJ6",
245
+ "outputId": "116ec551-7bf9-4cd8-ec7a-d393fad7392f"
246
+ },
247
+ "execution_count": 7,
248
+ "outputs": [
249
+ {
250
+ "output_type": "display_data",
251
+ "data": {
252
+ "text/plain": [
253
+ "<IPython.core.display.SVG object>"
254
+ ],
255
+ "image/svg+xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401pt\" height=\"232pt\" viewBox=\"0.00 0.00 401.00 232.00\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 228)\">\n<title>%3</title>\n<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-228 397,-228 397,4 -4,4\"/>\n<text text-anchor=\"middle\" x=\"92\" y=\"-208.8\" font-family=\"Times,serif\" font-size=\"14.00\">Allowed Paths</text>\n<text text-anchor=\"middle\" x=\"92\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">Regular expression: A\\.|B\\.|C\\.</text>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"109\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"109\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-148\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-144.3\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge2\" class=\"edge\">\n<title>0-&gt;1</title>\n<path fill=\"none\" stroke=\"black\" d=\"M118.83,-98.31C125,-107.68 134.08,-119.14 145,-126 164.59,-138.31 190.49,-143.74 209.81,-146.13\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.48,-149.61 219.79,-147.16 210.21,-142.65 209.48,-149.61\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-165 145.5,-186 165.5,-186 165.5,-165 145.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-165 145.5,-186 165.5,-186 165.5,-165 145.5,-165\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-165 165.5,-186 202.5,-186 202.5,-165 165.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-165 165.5,-186 202.5,-186 202.5,-165 165.5,-165\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-144 145.5,-165 165.5,-165 165.5,-144 145.5,-144\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">34</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-144 165.5,-165 202.5,-165 202.5,-144 165.5,-144\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\">C</text>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n</g>\n<!-- 0&#45;&gt;2 -->\n<g id=\"edge3\" class=\"edge\">\n<title>0-&gt;2</title>\n<path fill=\"none\" stroke=\"red\" stroke-width=\"3\" d=\"M127.13,-83C148.24,-83 184.4,-83 209.44,-83\"/>\n<polygon fill=\"red\" stroke=\"red\" stroke-width=\"3\" points=\"209.74,-86.5 219.74,-83 209.74,-79.5 209.74,-86.5\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-104 145.5,-125 165.5,-125 165.5,-104 145.5,-104\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"145.5,-104 145.5,-125 165.5,-125 165.5,-104 145.5,-104\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-104 165.5,-125 202.5,-125 202.5,-104 165.5,-104\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"165.5,-104 165.5,-125 202.5,-125 202.5,-104 165.5,-104\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"145.5,-83 145.5,-104 165.5,-104 165.5,-83 145.5,-83\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">33</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"165.5,-83 165.5,-104 202.5,-104 202.5,-83 165.5,-83\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\">B</text>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n</g>\n<!-- 0&#45;&gt;3 -->\n<g id=\"edge4\" class=\"edge\">\n<title>0-&gt;3</title>\n<path fill=\"none\" stroke=\"black\" d=\"M117.98,-67.39C124.03,-57.17 133.28,-44.38 145,-37 164.45,-24.75 190.36,-20.23 209.73,-18.64\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.96,-22.13 219.73,-18.03 209.53,-15.15 209.96,-22.13\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-58 145.5,-79 165.5,-79 165.5,-58 145.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-58 145.5,-79 165.5,-79 165.5,-58 145.5,-58\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-58 165.5,-79 202.5,-79 202.5,-58 165.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-58 165.5,-79 202.5,-79 202.5,-58 165.5,-58\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-37 145.5,-58 165.5,-58 165.5,-37 145.5,-37\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">32</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-37 165.5,-58 202.5,-58 202.5,-37 165.5,-37\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\">A</text>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"371\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"371\" cy=\"-83\" rx=\"22\" ry=\"22\"/>\n<text text-anchor=\"middle\" x=\"371\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n</g>\n<!-- 1&#45;&gt;4 -->\n<g id=\"edge5\" class=\"edge\">\n<title>1-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.07,-146.94C275.44,-145.08 307.4,-139.97 331,-126 338.44,-121.6 345.27,-115.32 351.07,-108.91\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"354.08,-110.77 357.83,-100.86 348.72,-106.27 354.08,-110.77\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-165 274.5,-186 294.5,-186 294.5,-165 274.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-165 274.5,-186 294.5,-186 294.5,-165 274.5,-165\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-165 294.5,-186 331.5,-186 331.5,-165 294.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-165 294.5,-186 331.5,-186 331.5,-165 294.5,-165\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-144 274.5,-165 294.5,-165 294.5,-144 274.5,-144\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-144 294.5,-165 331.5,-165 331.5,-144 294.5,-144\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge6\" class=\"edge\">\n<title>2-&gt;4</title>\n<path fill=\"none\" stroke=\"red\" stroke-width=\"3\" d=\"M256.13,-83C277.09,-83 313.01,-83 338.9,-83\"/>\n<polygon fill=\"red\" stroke=\"red\" stroke-width=\"3\" points=\"338.97,-86.5 348.97,-83 338.97,-79.5 338.97,-86.5\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-104 274.5,-125 294.5,-125 294.5,-104 274.5,-104\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"274.5,-104 274.5,-125 294.5,-125 294.5,-104 274.5,-104\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-104 294.5,-125 331.5,-125 331.5,-104 294.5,-104\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"294.5,-104 294.5,-125 331.5,-125 331.5,-104 294.5,-104\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"274.5,-83 274.5,-104 294.5,-104 294.5,-83 274.5,-83\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"294.5,-83 294.5,-104 331.5,-104 331.5,-83 294.5,-83\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<!-- 3&#45;&gt;4 -->\n<g id=\"edge7\" class=\"edge\">\n<title>3-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.13,-18.25C275.56,-19.25 307.58,-23.1 331,-37 339.15,-41.84 346.42,-49.01 352.4,-56.26\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"349.97,-58.84 358.82,-64.67 355.54,-54.6 349.97,-58.84\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-58 274.5,-79 294.5,-79 294.5,-58 274.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-58 274.5,-79 294.5,-79 294.5,-58 274.5,-58\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-58 294.5,-79 331.5,-79 331.5,-58 294.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-58 294.5,-79 331.5,-79 331.5,-58 294.5,-58\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-37 274.5,-58 294.5,-58 294.5,-37 274.5,-37\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-37 294.5,-58 331.5,-58 331.5,-37 294.5,-37\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<g id=\"node6\" class=\"node\">\n<title/>\n</g>\n<!-- &#45;&gt;0 -->\n<g id=\"edge1\" class=\"edge\">\n<title>-&gt;0</title>\n<path fill=\"none\" stroke=\"black\" d=\"M54.19,-83C62.65,-83 72.05,-83 80.6,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"80.83,-86.5 90.83,-83 80.83,-79.5 80.83,-86.5\"/>\n</g>\n</g>\n</svg>"
256
+ },
257
+ "metadata": {}
258
+ }
259
+ ]
260
+ },
261
+ {
262
+ "cell_type": "code",
263
+ "source": [
264
+ "processor.show_graph(batch_number=1)"
265
+ ],
266
+ "metadata": {
267
+ "colab": {
268
+ "base_uri": "https://localhost:8080/",
269
+ "height": 331
270
+ },
271
+ "id": "sDvGUSXZAaC0",
272
+ "outputId": "ca2c16e0-7f96-4fbd-ef3f-570775394d93"
273
+ },
274
+ "execution_count": 8,
275
+ "outputs": [
276
+ {
277
+ "output_type": "display_data",
278
+ "data": {
279
+ "text/plain": [
280
+ "<IPython.core.display.SVG object>"
281
+ ],
282
+ "image/svg+xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401pt\" height=\"232pt\" viewBox=\"0.00 0.00 401.00 232.00\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 228)\">\n<title>%3</title>\n<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-228 397,-228 397,4 -4,4\"/>\n<text text-anchor=\"middle\" x=\"92\" y=\"-208.8\" font-family=\"Times,serif\" font-size=\"14.00\">Allowed Paths</text>\n<text text-anchor=\"middle\" x=\"92\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">Regular expression: A\\.|B\\.|C\\.</text>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"109\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"109\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-148\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-144.3\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge2\" class=\"edge\">\n<title>0-&gt;1</title>\n<path fill=\"none\" stroke=\"red\" stroke-width=\"3\" d=\"M118.83,-98.31C125,-107.68 134.08,-119.14 145,-126 164.59,-138.31 190.49,-143.74 209.81,-146.13\"/>\n<polygon fill=\"red\" stroke=\"red\" stroke-width=\"3\" points=\"209.48,-149.61 219.79,-147.16 210.21,-142.65 209.48,-149.61\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-165 145.5,-186 165.5,-186 165.5,-165 145.5,-165\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"145.5,-165 145.5,-186 165.5,-186 165.5,-165 145.5,-165\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-165 165.5,-186 202.5,-186 202.5,-165 165.5,-165\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"165.5,-165 165.5,-186 202.5,-186 202.5,-165 165.5,-165\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"145.5,-144 145.5,-165 165.5,-165 165.5,-144 145.5,-144\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">34</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"165.5,-144 165.5,-165 202.5,-165 202.5,-144 165.5,-144\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\">C</text>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n</g>\n<!-- 0&#45;&gt;2 -->\n<g id=\"edge3\" class=\"edge\">\n<title>0-&gt;2</title>\n<path fill=\"none\" stroke=\"black\" d=\"M127.13,-83C148.24,-83 184.4,-83 209.44,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.74,-86.5 219.74,-83 209.74,-79.5 209.74,-86.5\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-104 145.5,-125 165.5,-125 165.5,-104 145.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-104 145.5,-125 165.5,-125 165.5,-104 145.5,-104\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-104 165.5,-125 202.5,-125 202.5,-104 165.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-104 165.5,-125 202.5,-125 202.5,-104 165.5,-104\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-83 145.5,-104 165.5,-104 165.5,-83 145.5,-83\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">33</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-83 165.5,-104 202.5,-104 202.5,-83 165.5,-83\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\">B</text>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n</g>\n<!-- 0&#45;&gt;3 -->\n<g id=\"edge4\" class=\"edge\">\n<title>0-&gt;3</title>\n<path fill=\"none\" stroke=\"black\" d=\"M117.98,-67.39C124.03,-57.17 133.28,-44.38 145,-37 164.45,-24.75 190.36,-20.23 209.73,-18.64\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.96,-22.13 219.73,-18.03 209.53,-15.15 209.96,-22.13\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-58 145.5,-79 165.5,-79 165.5,-58 145.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-58 145.5,-79 165.5,-79 165.5,-58 145.5,-58\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-58 165.5,-79 202.5,-79 202.5,-58 165.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-58 165.5,-79 202.5,-79 202.5,-58 165.5,-58\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-37 145.5,-58 165.5,-58 165.5,-37 145.5,-37\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">32</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-37 165.5,-58 202.5,-58 202.5,-37 165.5,-37\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\">A</text>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"371\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"371\" cy=\"-83\" rx=\"22\" ry=\"22\"/>\n<text text-anchor=\"middle\" x=\"371\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n</g>\n<!-- 1&#45;&gt;4 -->\n<g id=\"edge5\" class=\"edge\">\n<title>1-&gt;4</title>\n<path fill=\"none\" stroke=\"red\" stroke-width=\"3\" d=\"M256.07,-146.94C275.44,-145.08 307.4,-139.97 331,-126 338.44,-121.6 345.27,-115.32 351.07,-108.91\"/>\n<polygon fill=\"red\" stroke=\"red\" stroke-width=\"3\" points=\"354.08,-110.77 357.83,-100.86 348.72,-106.27 354.08,-110.77\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-165 274.5,-186 294.5,-186 294.5,-165 274.5,-165\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"274.5,-165 274.5,-186 294.5,-186 294.5,-165 274.5,-165\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-165 294.5,-186 331.5,-186 331.5,-165 294.5,-165\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"294.5,-165 294.5,-186 331.5,-186 331.5,-165 294.5,-165\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"274.5,-144 274.5,-165 294.5,-165 294.5,-144 274.5,-144\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"294.5,-144 294.5,-165 331.5,-165 331.5,-144 294.5,-144\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge6\" class=\"edge\">\n<title>2-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.13,-83C277.09,-83 313.01,-83 338.9,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"338.97,-86.5 348.97,-83 338.97,-79.5 338.97,-86.5\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-104 274.5,-125 294.5,-125 294.5,-104 274.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-104 274.5,-125 294.5,-125 294.5,-104 274.5,-104\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-104 294.5,-125 331.5,-125 331.5,-104 294.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-104 294.5,-125 331.5,-125 331.5,-104 294.5,-104\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-83 274.5,-104 294.5,-104 294.5,-83 274.5,-83\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-83 294.5,-104 331.5,-104 331.5,-83 294.5,-83\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<!-- 3&#45;&gt;4 -->\n<g id=\"edge7\" class=\"edge\">\n<title>3-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.13,-18.25C275.56,-19.25 307.58,-23.1 331,-37 339.15,-41.84 346.42,-49.01 352.4,-56.26\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"349.97,-58.84 358.82,-64.67 355.54,-54.6 349.97,-58.84\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-58 274.5,-79 294.5,-79 294.5,-58 274.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-58 274.5,-79 294.5,-79 294.5,-58 274.5,-58\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-58 294.5,-79 331.5,-79 331.5,-58 294.5,-58\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-58 294.5,-79 331.5,-79 331.5,-58 294.5,-58\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-37 274.5,-58 294.5,-58 294.5,-37 274.5,-37\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-37 294.5,-58 331.5,-58 331.5,-37 294.5,-37\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<g id=\"node6\" class=\"node\">\n<title/>\n</g>\n<!-- &#45;&gt;0 -->\n<g id=\"edge1\" class=\"edge\">\n<title>-&gt;0</title>\n<path fill=\"none\" stroke=\"black\" d=\"M54.19,-83C62.65,-83 72.05,-83 80.6,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"80.83,-86.5 90.83,-83 80.83,-79.5 80.83,-86.5\"/>\n</g>\n</g>\n</svg>"
283
+ },
284
+ "metadata": {}
285
+ }
286
+ ]
287
+ },
288
+ {
289
+ "cell_type": "code",
290
+ "source": [
291
+ "processor.show_graph(batch_number=2)"
292
+ ],
293
+ "metadata": {
294
+ "colab": {
295
+ "base_uri": "https://localhost:8080/",
296
+ "height": 331
297
+ },
298
+ "id": "DDyE3bb2AT6V",
299
+ "outputId": "5b7243ec-a902-4cc8-c45e-e840a27094f0"
300
+ },
301
+ "execution_count": 9,
302
+ "outputs": [
303
+ {
304
+ "output_type": "display_data",
305
+ "data": {
306
+ "text/plain": [
307
+ "<IPython.core.display.SVG object>"
308
+ ],
309
+ "image/svg+xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"401pt\" height=\"232pt\" viewBox=\"0.00 0.00 401.00 232.00\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 228)\">\n<title>%3</title>\n<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-228 397,-228 397,4 -4,4\"/>\n<text text-anchor=\"middle\" x=\"92\" y=\"-208.8\" font-family=\"Times,serif\" font-size=\"14.00\">Allowed Paths</text>\n<text text-anchor=\"middle\" x=\"92\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">Regular expression: A\\.|B\\.|C\\.</text>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"109\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"109\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-148\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-144.3\" font-family=\"Times,serif\" font-size=\"14.00\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge2\" class=\"edge\">\n<title>0-&gt;1</title>\n<path fill=\"none\" stroke=\"black\" d=\"M118.83,-98.31C125,-107.68 134.08,-119.14 145,-126 164.59,-138.31 190.49,-143.74 209.81,-146.13\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.48,-149.61 219.79,-147.16 210.21,-142.65 209.48,-149.61\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-165 145.5,-186 165.5,-186 165.5,-165 145.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-165 145.5,-186 165.5,-186 165.5,-165 145.5,-165\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-165 165.5,-186 202.5,-186 202.5,-165 165.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-165 165.5,-186 202.5,-186 202.5,-165 165.5,-165\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-144 145.5,-165 165.5,-165 165.5,-144 145.5,-144\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">34</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-144 165.5,-165 202.5,-165 202.5,-144 165.5,-144\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\">C</text>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">2</text>\n</g>\n<!-- 0&#45;&gt;2 -->\n<g id=\"edge3\" class=\"edge\">\n<title>0-&gt;2</title>\n<path fill=\"none\" stroke=\"black\" d=\"M127.13,-83C148.24,-83 184.4,-83 209.44,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"209.74,-86.5 219.74,-83 209.74,-79.5 209.74,-86.5\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-104 145.5,-125 165.5,-125 165.5,-104 145.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-104 145.5,-125 165.5,-125 165.5,-104 145.5,-104\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-104 165.5,-125 202.5,-125 202.5,-104 165.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-104 165.5,-125 202.5,-125 202.5,-104 165.5,-104\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"145.5,-83 145.5,-104 165.5,-104 165.5,-83 145.5,-83\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">33</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"165.5,-83 165.5,-104 202.5,-104 202.5,-83 165.5,-83\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\">B</text>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"238\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"238\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">3</text>\n</g>\n<!-- 0&#45;&gt;3 -->\n<g id=\"edge4\" class=\"edge\">\n<title>0-&gt;3</title>\n<path fill=\"none\" stroke=\"red\" stroke-width=\"3\" d=\"M117.98,-67.39C124.03,-57.17 133.28,-44.38 145,-37 164.45,-24.75 190.36,-20.23 209.73,-18.64\"/>\n<polygon fill=\"red\" stroke=\"red\" stroke-width=\"3\" points=\"209.96,-22.13 219.73,-18.03 209.53,-15.15 209.96,-22.13\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"145.5,-58 145.5,-79 165.5,-79 165.5,-58 145.5,-58\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"145.5,-58 145.5,-79 165.5,-79 165.5,-58 145.5,-58\"/>\n<text text-anchor=\"start\" x=\"150\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"165.5,-58 165.5,-79 202.5,-79 202.5,-58 165.5,-58\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"165.5,-58 165.5,-79 202.5,-79 202.5,-58 165.5,-58\"/>\n<text text-anchor=\"start\" x=\"168.5\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"145.5,-37 145.5,-58 165.5,-58 165.5,-37 145.5,-37\"/>\n<text text-anchor=\"start\" x=\"148.5\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">32</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"165.5,-37 165.5,-58 202.5,-58 202.5,-37 165.5,-37\"/>\n<text text-anchor=\"start\" x=\"179\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\">A</text>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"371\" cy=\"-83\" rx=\"18\" ry=\"18\"/>\n<ellipse fill=\"none\" stroke=\"black\" cx=\"371\" cy=\"-83\" rx=\"22\" ry=\"22\"/>\n<text text-anchor=\"middle\" x=\"371\" y=\"-79.3\" font-family=\"Times,serif\" font-size=\"14.00\">4</text>\n</g>\n<!-- 1&#45;&gt;4 -->\n<g id=\"edge5\" class=\"edge\">\n<title>1-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.07,-146.94C275.44,-145.08 307.4,-139.97 331,-126 338.44,-121.6 345.27,-115.32 351.07,-108.91\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"354.08,-110.77 357.83,-100.86 348.72,-106.27 354.08,-110.77\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-165 274.5,-186 294.5,-186 294.5,-165 274.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-165 274.5,-186 294.5,-186 294.5,-165 274.5,-165\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-165 294.5,-186 331.5,-186 331.5,-165 294.5,-165\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-165 294.5,-186 331.5,-186 331.5,-165 294.5,-165\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-171.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-144 274.5,-165 294.5,-165 294.5,-144 274.5,-144\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-144 294.5,-165 331.5,-165 331.5,-144 294.5,-144\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-150.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge6\" class=\"edge\">\n<title>2-&gt;4</title>\n<path fill=\"none\" stroke=\"black\" d=\"M256.13,-83C277.09,-83 313.01,-83 338.9,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"338.97,-86.5 348.97,-83 338.97,-79.5 338.97,-86.5\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-104 274.5,-125 294.5,-125 294.5,-104 274.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-104 274.5,-125 294.5,-125 294.5,-104 274.5,-104\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-104 294.5,-125 331.5,-125 331.5,-104 294.5,-104\"/>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-104 294.5,-125 331.5,-125 331.5,-104 294.5,-104\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-110.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"274.5,-83 274.5,-104 294.5,-104 294.5,-83 274.5,-83\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"black\" points=\"294.5,-83 294.5,-104 331.5,-104 331.5,-83 294.5,-83\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-89.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<!-- 3&#45;&gt;4 -->\n<g id=\"edge7\" class=\"edge\">\n<title>3-&gt;4</title>\n<path fill=\"none\" stroke=\"red\" stroke-width=\"3\" d=\"M256.13,-18.25C275.56,-19.25 307.58,-23.1 331,-37 339.15,-41.84 346.42,-49.01 352.4,-56.26\"/>\n<polygon fill=\"red\" stroke=\"red\" stroke-width=\"3\" points=\"349.97,-58.84 358.82,-64.67 355.54,-54.6 349.97,-58.84\"/>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"274.5,-58 274.5,-79 294.5,-79 294.5,-58 274.5,-58\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"274.5,-58 274.5,-79 294.5,-79 294.5,-58 274.5,-58\"/>\n<text text-anchor=\"start\" x=\"279\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">id</text>\n<polygon fill=\"#ffebcd\" stroke=\"transparent\" points=\"294.5,-58 294.5,-79 331.5,-79 331.5,-58 294.5,-58\"/>\n<polygon fill=\"none\" stroke=\"red\" points=\"294.5,-58 294.5,-79 331.5,-79 331.5,-58 294.5,-58\"/>\n<text text-anchor=\"start\" x=\"297.5\" y=\"-64.8\" font-family=\"Times,serif\" font-size=\"14.00\">token</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"274.5,-37 274.5,-58 294.5,-58 294.5,-37 274.5,-37\"/>\n<text text-anchor=\"start\" x=\"277.5\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#00b4d8\">13</text>\n<polygon fill=\"none\" stroke=\"red\" points=\"294.5,-37 294.5,-58 331.5,-58 331.5,-37 294.5,-37\"/>\n<text text-anchor=\"start\" x=\"311\" y=\"-43.8\" font-family=\"Times,serif\" font-size=\"14.00\">.</text>\n</g>\n<g id=\"node6\" class=\"node\">\n<title/>\n</g>\n<!-- &#45;&gt;0 -->\n<g id=\"edge1\" class=\"edge\">\n<title>-&gt;0</title>\n<path fill=\"none\" stroke=\"black\" d=\"M54.19,-83C62.65,-83 72.05,-83 80.6,-83\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"80.83,-86.5 90.83,-83 80.83,-79.5 80.83,-86.5\"/>\n</g>\n</g>\n</svg>"
310
+ },
311
+ "metadata": {}
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ "cell_type": "code",
317
+ "source": [],
318
+ "metadata": {
319
+ "id": "xNEEh_naAY_w"
320
+ },
321
+ "execution_count": 9,
322
+ "outputs": []
323
+ }
324
+ ]
325
+ }
Litelines_Guaranteed_Valid_JSON.ipynb CHANGED
The diff for this file is too large to render. See raw diff