Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- .github/workflows/update_space.yml +28 -0
- .gitignore +1 -0
- README.md +3 -8
- app.py +37 -0
- demo.ipynb +123 -0
- dune.txt +0 -0
- test.ipynb +910 -0
- xsbpe/__init__.py +0 -0
- xsbpe/__pycache__/__init__.cpython-312.pyc +0 -0
- xsbpe/__pycache__/base.cpython-312.pyc +0 -0
- xsbpe/__pycache__/basic.cpython-312.pyc +0 -0
- xsbpe/base.py +63 -0
- xsbpe/basic.py +47 -0
.github/workflows/update_space.yml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Run Python script
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
branches:
|
6 |
+
- main
|
7 |
+
|
8 |
+
jobs:
|
9 |
+
build:
|
10 |
+
runs-on: ubuntu-latest
|
11 |
+
|
12 |
+
steps:
|
13 |
+
- name: Checkout
|
14 |
+
uses: actions/checkout@v2
|
15 |
+
|
16 |
+
- name: Set up Python
|
17 |
+
uses: actions/setup-python@v2
|
18 |
+
with:
|
19 |
+
python-version: '3.9'
|
20 |
+
|
21 |
+
- name: Install Gradio
|
22 |
+
run: python -m pip install gradio
|
23 |
+
|
24 |
+
- name: Log in to Hugging Face
|
25 |
+
run: python -c 'import huggingface_hub; huggingface_hub.login(token="${{ secrets.hf_token }}")'
|
26 |
+
|
27 |
+
- name: Deploy to Spaces
|
28 |
+
run: gradio deploy
|
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
venv
|
README.md
CHANGED
@@ -1,12 +1,7 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: pink
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.42.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: bpe-visualizer
|
3 |
+
app_file: app.py
|
|
|
|
|
4 |
sdk: gradio
|
5 |
sdk_version: 4.42.0
|
|
|
|
|
6 |
---
|
7 |
+
An extra-small BPE tokenizer inspired by Karpathy's minbpe.
|
|
app.py
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from xsbpe.basic import BasicTokenizer
|
3 |
+
|
4 |
+
tk = BasicTokenizer()
|
5 |
+
tk.train(open('dune.txt').read(), 256 + 10000, verbose=False)
|
6 |
+
|
7 |
+
def tokenize(text):
|
8 |
+
tokens = tk.encode(text)
|
9 |
+
|
10 |
+
colors = ['rgba(107,64,216,.3)', 'rgba(104,222,122,.4)', 'rgba(244,172,54,.4)', 'rgba(239,65,70,.4)', 'rgba(39,181,234,.4)']
|
11 |
+
colored_tokens = []
|
12 |
+
|
13 |
+
for i, token in enumerate(tokens):
|
14 |
+
token = tk.vocab[token].decode('utf-8').replace(' ', ' ')
|
15 |
+
span = f'<span style="background-color: {colors[i % len(colors)]}">{token}</span>'
|
16 |
+
colored_tokens.append(span)
|
17 |
+
|
18 |
+
return '<p style="margin-left: 2px; margin-right: 2px; word-wrap: break-word">' + ''.join(colored_tokens) + '</p>', tokens, len(tokens), len(text)
|
19 |
+
|
20 |
+
interface = gr.Interface(
|
21 |
+
fn=tokenize,
|
22 |
+
inputs=[gr.TextArea(label='Input Text', type='text')],
|
23 |
+
outputs=[
|
24 |
+
gr.HTML(label='Tokenized Text'),
|
25 |
+
gr.Textbox(label='Token IDs', lines=1, max_lines=5),
|
26 |
+
gr.Textbox(label='Tokens', max_lines=1),
|
27 |
+
gr.Textbox(label='Characters', max_lines=1)
|
28 |
+
],
|
29 |
+
title="BPE Tokenization Visualizer",
|
30 |
+
live=True,
|
31 |
+
examples=[
|
32 |
+
'BPE, or Byte Pair Encoding, is a method used to compress text by breaking it down into smaller units. In natural language processing, it helps tokenize words by merging the most frequent pairs of characters or symbols, creating more efficient and manageable tokens for analysis.'
|
33 |
+
],
|
34 |
+
show_progress='hidden',
|
35 |
+
api_name='tokenize',
|
36 |
+
allow_flagging='never'
|
37 |
+
).launch()
|
demo.ipynb
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [
|
8 |
+
{
|
9 |
+
"name": "stderr",
|
10 |
+
"output_type": "stream",
|
11 |
+
"text": [
|
12 |
+
"/Users/jamino/xsbpe/venv/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
|
13 |
+
" from .autonotebook import tqdm as notebook_tqdm\n"
|
14 |
+
]
|
15 |
+
}
|
16 |
+
],
|
17 |
+
"source": [
|
18 |
+
"import gradio as gr\n",
|
19 |
+
"from xsbpe.basic import BasicTokenizer"
|
20 |
+
]
|
21 |
+
},
|
22 |
+
{
|
23 |
+
"cell_type": "code",
|
24 |
+
"execution_count": 2,
|
25 |
+
"metadata": {},
|
26 |
+
"outputs": [],
|
27 |
+
"source": [
|
28 |
+
"tk = BasicTokenizer()\n",
|
29 |
+
"tk.train(open('dune.txt').read(), 256 + 10000, verbose=False)"
|
30 |
+
]
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"cell_type": "code",
|
34 |
+
"execution_count": 56,
|
35 |
+
"metadata": {},
|
36 |
+
"outputs": [
|
37 |
+
{
|
38 |
+
"name": "stdout",
|
39 |
+
"output_type": "stream",
|
40 |
+
"text": [
|
41 |
+
"Running on local URL: http://127.0.0.1:7896\n",
|
42 |
+
"Running on public URL: https://cb2bf07164e5cebb6e.gradio.live\n",
|
43 |
+
"\n",
|
44 |
+
"This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n"
|
45 |
+
]
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"data": {
|
49 |
+
"text/html": [
|
50 |
+
"<div><iframe src=\"https://cb2bf07164e5cebb6e.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
51 |
+
],
|
52 |
+
"text/plain": [
|
53 |
+
"<IPython.core.display.HTML object>"
|
54 |
+
]
|
55 |
+
},
|
56 |
+
"metadata": {},
|
57 |
+
"output_type": "display_data"
|
58 |
+
}
|
59 |
+
],
|
60 |
+
"source": [
|
61 |
+
"def tokenize(text):\n",
|
62 |
+
" tokens = tk.encode(text)\n",
|
63 |
+
" \n",
|
64 |
+
" colors = ['rgba(107,64,216,.3)', 'rgba(104,222,122,.4)', 'rgba(244,172,54,.4)', 'rgba(239,65,70,.4)', 'rgba(39,181,234,.4)']\n",
|
65 |
+
" colored_tokens = []\n",
|
66 |
+
" \n",
|
67 |
+
" for i, token in enumerate(tokens):\n",
|
68 |
+
" token = tk.vocab[token].decode('utf-8').replace(' ', ' ')\n",
|
69 |
+
" span = f'<span style=\"background-color: {colors[i % len(colors)]}\">{token}</span>'\n",
|
70 |
+
" colored_tokens.append(span)\n",
|
71 |
+
"\n",
|
72 |
+
" return '<p style=\"margin-left: 2px; margin-right: 2px; word-wrap: break-word\">' + ''.join(colored_tokens) + '</p>', tokens, len(tokens), len(text)\n",
|
73 |
+
"\n",
|
74 |
+
"interface = gr.Interface(\n",
|
75 |
+
" fn=tokenize, \n",
|
76 |
+
" inputs=[gr.TextArea(label='Input Text', type='text')], \n",
|
77 |
+
" outputs=[\n",
|
78 |
+
" gr.HTML(label='Tokenized Text'),\n",
|
79 |
+
" gr.Textbox(label='Token IDs', lines=1, max_lines=5),\n",
|
80 |
+
" gr.Textbox(label='Tokens', max_lines=1),\n",
|
81 |
+
" gr.Textbox(label='Characters', max_lines=1)\n",
|
82 |
+
" ],\n",
|
83 |
+
" title=\"BPE Tokenization Visualizer\",\n",
|
84 |
+
" live=True,\n",
|
85 |
+
" examples=[\n",
|
86 |
+
" 'BPE, or Byte Pair Encoding, is a method used to compress text by breaking it down into smaller units. In natural language processing, it helps tokenize words by merging the most frequent pairs of characters or symbols, creating more efficient and manageable tokens for analysis.'\n",
|
87 |
+
" ],\n",
|
88 |
+
" show_progress='hidden',\n",
|
89 |
+
" api_name='tokenize',\n",
|
90 |
+
" allow_flagging='never'\n",
|
91 |
+
").launch(share=True, inbrowser=True)"
|
92 |
+
]
|
93 |
+
},
|
94 |
+
{
|
95 |
+
"cell_type": "code",
|
96 |
+
"execution_count": null,
|
97 |
+
"metadata": {},
|
98 |
+
"outputs": [],
|
99 |
+
"source": []
|
100 |
+
}
|
101 |
+
],
|
102 |
+
"metadata": {
|
103 |
+
"kernelspec": {
|
104 |
+
"display_name": "venv",
|
105 |
+
"language": "python",
|
106 |
+
"name": "python3"
|
107 |
+
},
|
108 |
+
"language_info": {
|
109 |
+
"codemirror_mode": {
|
110 |
+
"name": "ipython",
|
111 |
+
"version": 3
|
112 |
+
},
|
113 |
+
"file_extension": ".py",
|
114 |
+
"mimetype": "text/x-python",
|
115 |
+
"name": "python",
|
116 |
+
"nbconvert_exporter": "python",
|
117 |
+
"pygments_lexer": "ipython3",
|
118 |
+
"version": "3.12.4"
|
119 |
+
}
|
120 |
+
},
|
121 |
+
"nbformat": 4,
|
122 |
+
"nbformat_minor": 2
|
123 |
+
}
|
dune.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
test.ipynb
ADDED
@@ -0,0 +1,910 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [],
|
8 |
+
"source": [
|
9 |
+
"import time\n",
|
10 |
+
"\n",
|
11 |
+
"from xsbpe.basic import BasicTokenizer"
|
12 |
+
]
|
13 |
+
},
|
14 |
+
{
|
15 |
+
"cell_type": "code",
|
16 |
+
"execution_count": 2,
|
17 |
+
"metadata": {},
|
18 |
+
"outputs": [],
|
19 |
+
"source": [
|
20 |
+
"sentence = \"Jessica, looking down the length of the table, saw a faint trembling at the corners of Leto's mouth, noted the dark flush of anger on his cheeks. What has angered him? she asked herself. Surely not my invitation to the smuggler.\""
|
21 |
+
]
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"cell_type": "code",
|
25 |
+
"execution_count": 3,
|
26 |
+
"metadata": {},
|
27 |
+
"outputs": [
|
28 |
+
{
|
29 |
+
"name": "stdout",
|
30 |
+
"output_type": "stream",
|
31 |
+
"text": [
|
32 |
+
"[74, 101, 115, 115, 105, 99, 97, 44, 32, 108, 111, 111, 107, 105, 110, 103, 32, 100, 111, 119, 110, 32, 116, 104, 101, 32, 108, 101, 110, 103, 116, 104, 32, 111, 102, 32, 116, 104, 101, 32, 116, 97, 98, 108, 101, 44, 32, 115, 97, 119, 32, 97, 32, 102, 97, 105, 110, 116, 32, 116, 114, 101, 109, 98, 108, 105, 110, 103, 32, 97, 116, 32, 116, 104, 101, 32, 99, 111, 114, 110, 101, 114, 115, 32, 111, 102, 32, 76, 101, 116, 111, 39, 115, 32, 109, 111, 117, 116, 104, 44, 32, 110, 111, 116, 101, 100, 32, 116, 104, 101, 32, 100, 97, 114, 107, 32, 102, 108, 117, 115, 104, 32, 111, 102, 32, 97, 110, 103, 101, 114, 32, 111, 110, 32, 104, 105, 115, 32, 99, 104, 101, 101, 107, 115, 46, 32, 87, 104, 97, 116, 32, 104, 97, 115, 32, 97, 110, 103, 101, 114, 101, 100, 32, 104, 105, 109, 63, 32, 115, 104, 101, 32, 97, 115, 107, 101, 100, 32, 104, 101, 114, 115, 101, 108, 102, 46, 32, 83, 117, 114, 101, 108, 121, 32, 110, 111, 116, 32, 109, 121, 32, 105, 110, 118, 105, 116, 97, 116, 105, 111, 110, 32, 116, 111, 32, 116, 104, 101, 32, 115, 109, 117, 103, 103, 108, 101, 114, 46]\n",
|
33 |
+
"LEN: 228\n"
|
34 |
+
]
|
35 |
+
}
|
36 |
+
],
|
37 |
+
"source": [
|
38 |
+
"tk = BasicTokenizer()\n",
|
39 |
+
"# only using individual chars, no merging\n",
|
40 |
+
"encoded1 = tk.encode(sentence)\n",
|
41 |
+
"print(encoded1)\n",
|
42 |
+
"print('LEN:', len(encoded1))"
|
43 |
+
]
|
44 |
+
},
|
45 |
+
{
|
46 |
+
"cell_type": "code",
|
47 |
+
"execution_count": 4,
|
48 |
+
"metadata": {},
|
49 |
+
"outputs": [
|
50 |
+
{
|
51 |
+
"name": "stdout",
|
52 |
+
"output_type": "stream",
|
53 |
+
"text": [
|
54 |
+
"merge 1/44: (101, 32) -> 256 (b'e ') had 37476 occurrences\n",
|
55 |
+
"merge 2/44: (116, 104) -> 257 (b'th') had 26021 occurrences\n",
|
56 |
+
"merge 3/44: (32, 32) -> 258 (b' ') had 23243 occurrences\n",
|
57 |
+
"merge 4/44: (100, 32) -> 259 (b'd ') had 19923 occurrences\n",
|
58 |
+
"merge 5/44: (115, 32) -> 260 (b's ') had 17700 occurrences\n",
|
59 |
+
"merge 6/44: (116, 32) -> 261 (b't ') had 16514 occurrences\n",
|
60 |
+
"merge 7/44: (105, 110) -> 262 (b'in') had 14704 occurrences\n",
|
61 |
+
"merge 8/44: (101, 114) -> 263 (b'er') had 14496 occurrences\n",
|
62 |
+
"merge 9/44: (257, 256) -> 264 (b'the ') had 12705 occurrences\n",
|
63 |
+
"merge 10/44: (46, 32) -> 265 (b'. ') had 12182 occurrences\n",
|
64 |
+
"merge 11/44: (97, 110) -> 266 (b'an') had 11336 occurrences\n",
|
65 |
+
"merge 12/44: (111, 117) -> 267 (b'ou') had 9967 occurrences\n",
|
66 |
+
"merge 13/44: (44, 32) -> 268 (b', ') had 9853 occurrences\n",
|
67 |
+
"merge 14/44: (101, 110) -> 269 (b'en') had 9128 occurrences\n",
|
68 |
+
"merge 15/44: (111, 110) -> 270 (b'on') had 9008 occurrences\n",
|
69 |
+
"merge 16/44: (101, 259) -> 271 (b'ed ') had 8847 occurrences\n",
|
70 |
+
"merge 17/44: (10, 258) -> 272 (b'\\n ') had 7751 occurrences\n",
|
71 |
+
"merge 18/44: (272, 258) -> 273 (b'\\n ') had 7743 occurrences\n",
|
72 |
+
"merge 19/44: (97, 114) -> 274 (b'ar') had 7736 occurrences\n",
|
73 |
+
"merge 20/44: (32, 264) -> 275 (b' the ') had 7594 occurrences\n",
|
74 |
+
"merge 21/44: (32, 115) -> 276 (b' s') had 7368 occurrences\n",
|
75 |
+
"merge 22/44: (116, 111) -> 277 (b'to') had 6860 occurrences\n",
|
76 |
+
"merge 23/44: (121, 32) -> 278 (b'y ') had 6406 occurrences\n",
|
77 |
+
"merge 24/44: (262, 103) -> 279 (b'ing') had 6242 occurrences\n",
|
78 |
+
"merge 25/44: (114, 101) -> 280 (b're') had 5900 occurrences\n",
|
79 |
+
"merge 26/44: (111, 102) -> 281 (b'of') had 5743 occurrences\n",
|
80 |
+
"merge 27/44: (111, 114) -> 282 (b'or') had 5571 occurrences\n",
|
81 |
+
"merge 28/44: (32, 104) -> 283 (b' h') had 5278 occurrences\n",
|
82 |
+
"merge 29/44: (101, 115) -> 284 (b'es') had 5073 occurrences\n",
|
83 |
+
"merge 30/44: (105, 260) -> 285 (b'is ') had 4829 occurrences\n",
|
84 |
+
"merge 31/44: (32, 97) -> 286 (b' a') had 4595 occurrences\n",
|
85 |
+
"merge 32/44: (108, 108) -> 287 (b'll') had 4557 occurrences\n",
|
86 |
+
"merge 33/44: (104, 256) -> 288 (b'he ') had 4393 occurrences\n",
|
87 |
+
"merge 34/44: (116, 105) -> 289 (b'ti') had 4062 occurrences\n",
|
88 |
+
"merge 35/44: (97, 261) -> 290 (b'at ') had 3947 occurrences\n",
|
89 |
+
"merge 36/44: (34, 32) -> 291 (b'\" ') had 3834 occurrences\n",
|
90 |
+
"merge 37/44: (32, 119) -> 292 (b' w') had 3725 occurrences\n",
|
91 |
+
"merge 38/44: (266, 259) -> 293 (b'and ') had 3660 occurrences\n",
|
92 |
+
"merge 39/44: (273, 34) -> 294 (b'\\n \"') had 3644 occurrences\n",
|
93 |
+
"merge 40/44: (111, 119) -> 295 (b'ow') had 3555 occurrences\n",
|
94 |
+
"merge 41/44: (32, 257) -> 296 (b' th') had 3477 occurrences\n",
|
95 |
+
"merge 42/44: (105, 100) -> 297 (b'id') had 3458 occurrences\n",
|
96 |
+
"merge 43/44: (111, 109) -> 298 (b'om') had 3262 occurrences\n",
|
97 |
+
"merge 44/44: (97, 116) -> 299 (b'at') had 3101 occurrences\n",
|
98 |
+
"Text Length: 203588 | Time to train: 4.710334777832031\n",
|
99 |
+
"[74, 284, 115, 105, 99, 97, 268, 108, 111, 111, 107, 279, 32, 100, 295, 110, 275, 108, 269, 103, 257, 32, 281, 275, 116, 97, 98, 108, 101, 268, 115, 97, 119, 286, 32, 102, 97, 262, 261, 116, 280, 109, 98, 108, 279, 286, 261, 264, 99, 282, 110, 263, 260, 281, 32, 76, 101, 277, 39, 260, 109, 267, 257, 268, 110, 111, 116, 271, 264, 100, 274, 107, 32, 102, 108, 117, 115, 104, 32, 281, 32, 266, 103, 263, 32, 270, 283, 285, 99, 104, 101, 101, 107, 115, 265, 87, 104, 290, 104, 97, 260, 266, 103, 263, 271, 104, 105, 109, 63, 276, 288, 97, 115, 107, 271, 104, 263, 115, 101, 108, 102, 265, 83, 117, 280, 108, 278, 110, 111, 261, 109, 278, 262, 118, 105, 116, 97, 289, 270, 32, 277, 275, 115, 109, 117, 103, 103, 108, 263, 46]\n",
|
100 |
+
"LEN: 150\n"
|
101 |
+
]
|
102 |
+
}
|
103 |
+
],
|
104 |
+
"source": [
|
105 |
+
"text = open('dune.txt').read()\n",
|
106 |
+
"\n",
|
107 |
+
"st = time.time()\n",
|
108 |
+
"tk.train(text, 300, verbose=True)\n",
|
109 |
+
"et = time.time()\n",
|
110 |
+
"\n",
|
111 |
+
"print(f'Text Length: {len(text.split())} | Time to train: {et-st}')\n",
|
112 |
+
"encoded2 = tk.encode(sentence)\n",
|
113 |
+
"print(encoded2)\n",
|
114 |
+
"print('LEN:', len(encoded2))"
|
115 |
+
]
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"cell_type": "code",
|
119 |
+
"execution_count": 5,
|
120 |
+
"metadata": {},
|
121 |
+
"outputs": [
|
122 |
+
{
|
123 |
+
"name": "stdout",
|
124 |
+
"output_type": "stream",
|
125 |
+
"text": [
|
126 |
+
"merge 1/744: (101, 32) -> 256 (b'e ') had 37476 occurrences\n",
|
127 |
+
"merge 2/744: (116, 104) -> 257 (b'th') had 26021 occurrences\n",
|
128 |
+
"merge 3/744: (32, 32) -> 258 (b' ') had 23243 occurrences\n",
|
129 |
+
"merge 4/744: (100, 32) -> 259 (b'd ') had 19923 occurrences\n",
|
130 |
+
"merge 5/744: (115, 32) -> 260 (b's ') had 17700 occurrences\n",
|
131 |
+
"merge 6/744: (116, 32) -> 261 (b't ') had 16514 occurrences\n",
|
132 |
+
"merge 7/744: (105, 110) -> 262 (b'in') had 14704 occurrences\n",
|
133 |
+
"merge 8/744: (101, 114) -> 263 (b'er') had 14496 occurrences\n",
|
134 |
+
"merge 9/744: (257, 256) -> 264 (b'the ') had 12705 occurrences\n",
|
135 |
+
"merge 10/744: (46, 32) -> 265 (b'. ') had 12182 occurrences\n",
|
136 |
+
"merge 11/744: (97, 110) -> 266 (b'an') had 11336 occurrences\n",
|
137 |
+
"merge 12/744: (111, 117) -> 267 (b'ou') had 9967 occurrences\n",
|
138 |
+
"merge 13/744: (44, 32) -> 268 (b', ') had 9853 occurrences\n",
|
139 |
+
"merge 14/744: (101, 110) -> 269 (b'en') had 9128 occurrences\n",
|
140 |
+
"merge 15/744: (111, 110) -> 270 (b'on') had 9008 occurrences\n",
|
141 |
+
"merge 16/744: (101, 259) -> 271 (b'ed ') had 8847 occurrences\n",
|
142 |
+
"merge 17/744: (10, 258) -> 272 (b'\\n ') had 7751 occurrences\n",
|
143 |
+
"merge 18/744: (272, 258) -> 273 (b'\\n ') had 7743 occurrences\n",
|
144 |
+
"merge 19/744: (97, 114) -> 274 (b'ar') had 7736 occurrences\n",
|
145 |
+
"merge 20/744: (32, 264) -> 275 (b' the ') had 7594 occurrences\n",
|
146 |
+
"merge 21/744: (32, 115) -> 276 (b' s') had 7368 occurrences\n",
|
147 |
+
"merge 22/744: (116, 111) -> 277 (b'to') had 6860 occurrences\n",
|
148 |
+
"merge 23/744: (121, 32) -> 278 (b'y ') had 6406 occurrences\n",
|
149 |
+
"merge 24/744: (262, 103) -> 279 (b'ing') had 6242 occurrences\n",
|
150 |
+
"merge 25/744: (114, 101) -> 280 (b're') had 5900 occurrences\n",
|
151 |
+
"merge 26/744: (111, 102) -> 281 (b'of') had 5743 occurrences\n",
|
152 |
+
"merge 27/744: (111, 114) -> 282 (b'or') had 5571 occurrences\n",
|
153 |
+
"merge 28/744: (32, 104) -> 283 (b' h') had 5278 occurrences\n",
|
154 |
+
"merge 29/744: (101, 115) -> 284 (b'es') had 5073 occurrences\n",
|
155 |
+
"merge 30/744: (105, 260) -> 285 (b'is ') had 4829 occurrences\n",
|
156 |
+
"merge 31/744: (32, 97) -> 286 (b' a') had 4595 occurrences\n",
|
157 |
+
"merge 32/744: (108, 108) -> 287 (b'll') had 4557 occurrences\n",
|
158 |
+
"merge 33/744: (104, 256) -> 288 (b'he ') had 4393 occurrences\n",
|
159 |
+
"merge 34/744: (116, 105) -> 289 (b'ti') had 4062 occurrences\n",
|
160 |
+
"merge 35/744: (97, 261) -> 290 (b'at ') had 3947 occurrences\n",
|
161 |
+
"merge 36/744: (34, 32) -> 291 (b'\" ') had 3834 occurrences\n",
|
162 |
+
"merge 37/744: (32, 119) -> 292 (b' w') had 3725 occurrences\n",
|
163 |
+
"merge 38/744: (266, 259) -> 293 (b'and ') had 3660 occurrences\n",
|
164 |
+
"merge 39/744: (273, 34) -> 294 (b'\\n \"') had 3644 occurrences\n",
|
165 |
+
"merge 40/744: (111, 119) -> 295 (b'ow') had 3555 occurrences\n",
|
166 |
+
"merge 41/744: (32, 257) -> 296 (b' th') had 3477 occurrences\n",
|
167 |
+
"merge 42/744: (105, 100) -> 297 (b'id') had 3458 occurrences\n",
|
168 |
+
"merge 43/744: (111, 109) -> 298 (b'om') had 3262 occurrences\n",
|
169 |
+
"merge 44/744: (97, 116) -> 299 (b'at') had 3101 occurrences\n",
|
170 |
+
"merge 45/744: (32, 109) -> 300 (b' m') had 2939 occurrences\n",
|
171 |
+
"merge 46/744: (105, 116) -> 301 (b'it') had 2934 occurrences\n",
|
172 |
+
"merge 47/744: (97, 99) -> 302 (b'ac') had 2889 occurrences\n",
|
173 |
+
"merge 48/744: (103, 104) -> 303 (b'gh') had 2824 occurrences\n",
|
174 |
+
"merge 49/744: (101, 100) -> 304 (b'ed') had 2824 occurrences\n",
|
175 |
+
"merge 50/744: (32, 99) -> 305 (b' c') had 2740 occurrences\n",
|
176 |
+
"merge 51/744: (105, 99) -> 306 (b'ic') had 2721 occurrences\n",
|
177 |
+
"merge 52/744: (105, 115) -> 307 (b'is') had 2678 occurrences\n",
|
178 |
+
"merge 53/744: (97, 117) -> 308 (b'au') had 2641 occurrences\n",
|
179 |
+
"merge 54/744: (101, 108) -> 309 (b'el') had 2605 occurrences\n",
|
180 |
+
"merge 55/744: (97, 108) -> 310 (b'al') had 2586 occurrences\n",
|
181 |
+
"merge 56/744: (32, 102) -> 311 (b' f') had 2539 occurrences\n",
|
182 |
+
"merge 57/744: (32, 98) -> 312 (b' b') had 2492 occurrences\n",
|
183 |
+
"merge 58/744: (121, 267) -> 313 (b'you') had 2475 occurrences\n",
|
184 |
+
"merge 59/744: (97, 260) -> 314 (b'as ') had 2357 occurrences\n",
|
185 |
+
"merge 60/744: (117, 114) -> 315 (b'ur') had 2200 occurrences\n",
|
186 |
+
"merge 61/744: (97, 115) -> 316 (b'as') had 2194 occurrences\n",
|
187 |
+
"merge 62/744: (114, 111) -> 317 (b'ro') had 2176 occurrences\n",
|
188 |
+
"merge 63/744: (46, 273) -> 318 (b'.\\n ') had 2169 occurrences\n",
|
189 |
+
"merge 64/744: (97, 297) -> 319 (b'aid') had 2135 occurrences\n",
|
190 |
+
"merge 65/744: (101, 260) -> 320 (b'es ') had 2112 occurrences\n",
|
191 |
+
"merge 66/744: (39, 260) -> 321 (b\"'s \") had 2111 occurrences\n",
|
192 |
+
"merge 67/744: (32, 100) -> 322 (b' d') had 2089 occurrences\n",
|
193 |
+
"merge 68/744: (104, 97) -> 323 (b'ha') had 2087 occurrences\n",
|
194 |
+
"merge 69/744: (265, 34) -> 324 (b'. \"') had 2076 occurrences\n",
|
195 |
+
"merge 70/744: (118, 256) -> 325 (b've ') had 2056 occurrences\n",
|
196 |
+
"merge 71/744: (105, 109) -> 326 (b'im') had 2038 occurrences\n",
|
197 |
+
"merge 72/744: (279, 32) -> 327 (b'ing ') had 1976 occurrences\n",
|
198 |
+
"merge 73/744: (263, 32) -> 328 (b'er ') had 1961 occurrences\n",
|
199 |
+
"merge 74/744: (117, 115) -> 329 (b'us') had 1859 occurrences\n",
|
200 |
+
"merge 75/744: (108, 101) -> 330 (b'le') had 1856 occurrences\n",
|
201 |
+
"merge 76/744: (110, 111) -> 331 (b'no') had 1837 occurrences\n",
|
202 |
+
"merge 77/744: (84, 288) -> 332 (b'The ') had 1830 occurrences\n",
|
203 |
+
"merge 78/744: (105, 257) -> 333 (b'ith') had 1792 occurrences\n",
|
204 |
+
"merge 79/744: (101, 109) -> 334 (b'em') had 1787 occurrences\n",
|
205 |
+
"merge 80/744: (97, 100) -> 335 (b'ad') had 1733 occurrences\n",
|
206 |
+
"merge 81/744: (308, 108) -> 336 (b'aul') had 1733 occurrences\n",
|
207 |
+
"merge 82/744: (116, 114) -> 337 (b'tr') had 1730 occurrences\n",
|
208 |
+
"merge 83/744: (108, 105) -> 338 (b'li') had 1725 occurrences\n",
|
209 |
+
"merge 84/744: (80, 336) -> 339 (b'Paul') had 1722 occurrences\n",
|
210 |
+
"merge 85/744: (263, 256) -> 340 (b'ere ') had 1718 occurrences\n",
|
211 |
+
"merge 86/744: (84, 104) -> 341 (b'Th') had 1704 occurrences\n",
|
212 |
+
"merge 87/744: (99, 104) -> 342 (b'ch') had 1690 occurrences\n",
|
213 |
+
"merge 88/744: (105, 114) -> 343 (b'ir') had 1688 occurrences\n",
|
214 |
+
"merge 89/744: (32, 112) -> 344 (b' p') had 1670 occurrences\n",
|
215 |
+
"merge 90/744: (108, 259) -> 345 (b'ld ') had 1635 occurrences\n",
|
216 |
+
"merge 91/744: (265, 265) -> 346 (b'. . ') had 1604 occurrences\n",
|
217 |
+
"merge 92/744: (117, 110) -> 347 (b'un') had 1590 occurrences\n",
|
218 |
+
"merge 93/744: (284, 115) -> 348 (b'ess') had 1585 occurrences\n",
|
219 |
+
"merge 94/744: (256, 115) -> 349 (b'e s') had 1529 occurrences\n",
|
220 |
+
"merge 95/744: (46, 291) -> 350 (b'.\" ') had 1514 occurrences\n",
|
221 |
+
"merge 96/744: (281, 32) -> 351 (b'of ') had 1509 occurrences\n",
|
222 |
+
"merge 97/744: (105, 261) -> 352 (b'it ') had 1472 occurrences\n",
|
223 |
+
"merge 98/744: (108, 111) -> 353 (b'lo') had 1467 occurrences\n",
|
224 |
+
"merge 99/744: (289, 270) -> 354 (b'tion') had 1463 occurrences\n",
|
225 |
+
"merge 100/744: (101, 99) -> 355 (b'ec') had 1452 occurrences\n",
|
226 |
+
"merge 101/744: (97, 287) -> 356 (b'all') had 1428 occurrences\n",
|
227 |
+
"merge 102/744: (277, 32) -> 357 (b'to ') had 1379 occurrences\n",
|
228 |
+
"merge 103/744: (116, 263) -> 358 (b'ter') had 1373 occurrences\n",
|
229 |
+
"merge 104/744: (267, 303) -> 359 (b'ough') had 1371 occurrences\n",
|
230 |
+
"merge 105/744: (102, 282) -> 360 (b'for') had 1358 occurrences\n",
|
231 |
+
"merge 106/744: (118, 263) -> 361 (b'ver') had 1353 occurrences\n",
|
232 |
+
"merge 107/744: (281, 275) -> 362 (b'of the ') had 1340 occurrences\n",
|
233 |
+
"merge 108/744: (101, 121) -> 363 (b'ey') had 1323 occurrences\n",
|
234 |
+
"merge 109/744: (46, 294) -> 364 (b'.\\n \"') had 1291 occurrences\n",
|
235 |
+
"merge 110/744: (97, 119) -> 365 (b'aw') had 1274 occurrences\n",
|
236 |
+
"merge 111/744: (97, 262) -> 366 (b'ain') had 1247 occurrences\n",
|
237 |
+
"merge 112/744: (101, 268) -> 367 (b'e, ') had 1240 occurrences\n",
|
238 |
+
"merge 113/744: (97, 107) -> 368 (b'ak') had 1216 occurrences\n",
|
239 |
+
"merge 114/744: (283, 285) -> 369 (b' his ') had 1201 occurrences\n",
|
240 |
+
"merge 115/744: (110, 259) -> 370 (b'nd ') had 1187 occurrences\n",
|
241 |
+
"merge 116/744: (97, 109) -> 371 (b'am') had 1181 occurrences\n",
|
242 |
+
"merge 117/744: (97, 32) -> 372 (b'a ') had 1177 occurrences\n",
|
243 |
+
"merge 118/744: (108, 256) -> 373 (b'le ') had 1177 occurrences\n",
|
244 |
+
"merge 119/744: (119, 104) -> 374 (b'wh') had 1176 occurrences\n",
|
245 |
+
"merge 120/744: (257, 263) -> 375 (b'ther') had 1154 occurrences\n",
|
246 |
+
"merge 121/744: (45, 45) -> 376 (b'--') had 1153 occurrences\n",
|
247 |
+
"merge 122/744: (269, 32) -> 377 (b'en ') had 1142 occurrences\n",
|
248 |
+
"merge 123/744: (98, 101) -> 378 (b'be') had 1117 occurrences\n",
|
249 |
+
"merge 124/744: (44, 291) -> 379 (b',\" ') had 1109 occurrences\n",
|
250 |
+
"merge 125/744: (266, 100) -> 380 (b'and') had 1097 occurrences\n",
|
251 |
+
"merge 126/744: (276, 319) -> 381 (b' said') had 1097 occurrences\n",
|
252 |
+
"merge 127/744: (257, 290) -> 382 (b'that ') had 1087 occurrences\n",
|
253 |
+
"merge 128/744: (104, 285) -> 383 (b'his ') had 1087 occurrences\n",
|
254 |
+
"merge 129/744: (115, 116) -> 384 (b'st') had 1079 occurrences\n",
|
255 |
+
"merge 130/744: (119, 314) -> 385 (b'was ') had 1068 occurrences\n",
|
256 |
+
"merge 131/744: (111, 112) -> 386 (b'op') had 1063 occurrences\n",
|
257 |
+
"merge 132/744: (105, 108) -> 387 (b'il') had 1062 occurrences\n",
|
258 |
+
"merge 133/744: (117, 261) -> 388 (b'ut ') had 1059 occurrences\n",
|
259 |
+
"merge 134/744: (119, 333) -> 389 (b'with') had 1047 occurrences\n",
|
260 |
+
"merge 135/744: (265, 72) -> 390 (b'. H') had 1032 occurrences\n",
|
261 |
+
"merge 136/744: (58, 32) -> 391 (b': ') had 1024 occurrences\n",
|
262 |
+
"merge 137/744: (114, 105) -> 392 (b'ri') had 1023 occurrences\n",
|
263 |
+
"merge 138/744: (114, 298) -> 393 (b'rom') had 1022 occurrences\n",
|
264 |
+
"merge 139/744: (110, 101) -> 394 (b'ne') had 1022 occurrences\n",
|
265 |
+
"merge 140/744: (266, 32) -> 395 (b'an ') had 1016 occurrences\n",
|
266 |
+
"merge 141/744: (267, 261) -> 396 (b'out ') had 1009 occurrences\n",
|
267 |
+
"merge 142/744: (112, 263) -> 397 (b'per') had 998 occurrences\n",
|
268 |
+
"merge 143/744: (44, 34) -> 398 (b',\"') had 993 occurrences\n",
|
269 |
+
"merge 144/744: (46, 34) -> 399 (b'.\"') had 992 occurrences\n",
|
270 |
+
"merge 145/744: (111, 107) -> 400 (b'ok') had 985 occurrences\n",
|
271 |
+
"merge 146/744: (97, 121) -> 401 (b'ay') had 952 occurrences\n",
|
272 |
+
"merge 147/744: (280, 109) -> 402 (b'rem') had 951 occurrences\n",
|
273 |
+
"merge 148/744: (97, 98) -> 403 (b'ab') had 941 occurrences\n",
|
274 |
+
"merge 149/744: (110, 295) -> 404 (b'now') had 931 occurrences\n",
|
275 |
+
"merge 150/744: (111, 115) -> 405 (b'os') had 927 occurrences\n",
|
276 |
+
"merge 151/744: (32, 262) -> 406 (b' in') had 918 occurrences\n",
|
277 |
+
"merge 152/744: (267, 345) -> 407 (b'ould ') had 917 occurrences\n",
|
278 |
+
"merge 153/744: (265, 73) -> 408 (b'. I') had 917 occurrences\n",
|
279 |
+
"merge 154/744: (269, 116) -> 409 (b'ent') had 912 occurrences\n",
|
280 |
+
"merge 155/744: (105, 287) -> 410 (b'ill') had 901 occurrences\n",
|
281 |
+
"merge 156/744: (74, 348) -> 411 (b'Jess') had 899 occurrences\n",
|
282 |
+
"merge 157/744: (411, 306) -> 412 (b'Jessic') had 899 occurrences\n",
|
283 |
+
"merge 158/744: (97, 103) -> 413 (b'ag') had 892 occurrences\n",
|
284 |
+
"merge 159/744: (97, 112) -> 414 (b'ap') had 890 occurrences\n",
|
285 |
+
"merge 160/744: (268, 115) -> 415 (b', s') had 888 occurrences\n",
|
286 |
+
"merge 161/744: (116, 271) -> 416 (b'ted ') had 887 occurrences\n",
|
287 |
+
"merge 162/744: (108, 278) -> 417 (b'ly ') had 872 occurrences\n",
|
288 |
+
"merge 163/744: (277, 275) -> 418 (b'to the ') had 869 occurrences\n",
|
289 |
+
"merge 164/744: (101, 274) -> 419 (b'ear') had 866 occurrences\n",
|
290 |
+
"merge 165/744: (331, 261) -> 420 (b'not ') had 857 occurrences\n",
|
291 |
+
"merge 166/744: (97, 278) -> 421 (b'ay ') had 851 occurrences\n",
|
292 |
+
"merge 167/744: (101, 116) -> 422 (b'et') had 832 occurrences\n",
|
293 |
+
"merge 168/744: (101, 112) -> 423 (b'ep') had 815 occurrences\n",
|
294 |
+
"merge 169/744: (104, 326) -> 424 (b'him') had 814 occurrences\n",
|
295 |
+
"merge 170/744: (89, 267) -> 425 (b'You') had 812 occurrences\n",
|
296 |
+
"merge 171/744: (269, 261) -> 426 (b'ent ') had 786 occurrences\n",
|
297 |
+
"merge 172/744: (97, 259) -> 427 (b'ad ') had 777 occurrences\n",
|
298 |
+
"merge 173/744: (111, 32) -> 428 (b'o ') had 771 occurrences\n",
|
299 |
+
"merge 174/744: (101, 278) -> 429 (b'ey ') had 770 occurrences\n",
|
300 |
+
"merge 175/744: (117, 112) -> 430 (b'up') had 765 occurrences\n",
|
301 |
+
"merge 176/744: (412, 97) -> 431 (b'Jessica') had 757 occurrences\n",
|
302 |
+
"merge 177/744: (302, 107) -> 432 (b'ack') had 757 occurrences\n",
|
303 |
+
"merge 178/744: (295, 110) -> 433 (b'own') had 753 occurrences\n",
|
304 |
+
"merge 179/744: (323, 259) -> 434 (b'had ') had 752 occurrences\n",
|
305 |
+
"merge 180/744: (270, 32) -> 435 (b'on ') had 749 occurrences\n",
|
306 |
+
"merge 181/744: (346, 265) -> 436 (b'. . . ') had 738 occurrences\n",
|
307 |
+
"merge 182/744: (270, 256) -> 437 (b'one ') had 726 occurrences\n",
|
308 |
+
"merge 183/744: (280, 115) -> 438 (b'res') had 716 occurrences\n",
|
309 |
+
"merge 184/744: (265, 332) -> 439 (b'. The ') had 711 occurrences\n",
|
310 |
+
"merge 185/744: (350, 294) -> 440 (b'.\" \\n \"') had 710 occurrences\n",
|
311 |
+
"merge 186/744: (101, 261) -> 441 (b'et ') had 701 occurrences\n",
|
312 |
+
"merge 187/744: (105, 102) -> 442 (b'if') had 699 occurrences\n",
|
313 |
+
"merge 188/744: (108, 266) -> 443 (b'lan') had 694 occurrences\n",
|
314 |
+
"merge 189/744: (296, 290) -> 444 (b' that ') had 693 occurrences\n",
|
315 |
+
"merge 190/744: (265, 341) -> 445 (b'. Th') had 690 occurrences\n",
|
316 |
+
"merge 191/744: (104, 263) -> 446 (b'her') had 688 occurrences\n",
|
317 |
+
"merge 192/744: (315, 110) -> 447 (b'urn') had 687 occurrences\n",
|
318 |
+
"merge 193/744: (105, 303) -> 448 (b'igh') had 685 occurrences\n",
|
319 |
+
"merge 194/744: (262, 275) -> 449 (b'in the ') had 685 occurrences\n",
|
320 |
+
"merge 195/744: (292, 104) -> 450 (b' wh') had 684 occurrences\n",
|
321 |
+
"merge 196/744: (265, 65) -> 451 (b'. A') had 678 occurrences\n",
|
322 |
+
"merge 197/744: (117, 109) -> 452 (b'um') had 673 occurrences\n",
|
323 |
+
"merge 198/744: (271, 264) -> 453 (b'ed the ') had 672 occurrences\n",
|
324 |
+
"merge 199/744: (111, 375) -> 454 (b'other') had 649 occurrences\n",
|
325 |
+
"merge 200/744: (87, 104) -> 455 (b'Wh') had 648 occurrences\n",
|
326 |
+
"merge 201/744: (107, 256) -> 456 (b'ke ') had 646 occurrences\n",
|
327 |
+
"merge 202/744: (63, 291) -> 457 (b'?\" ') had 642 occurrences\n",
|
328 |
+
"merge 203/744: (102, 393) -> 458 (b'from') had 640 occurrences\n",
|
329 |
+
"merge 204/744: (83, 288) -> 459 (b'She ') had 640 occurrences\n",
|
330 |
+
"merge 205/744: (115, 268) -> 460 (b's, ') had 639 occurrences\n",
|
331 |
+
"merge 206/744: (274, 107) -> 461 (b'ark') had 636 occurrences\n",
|
332 |
+
"merge 207/744: (100, 263) -> 462 (b'der') had 635 occurrences\n",
|
333 |
+
"merge 208/744: (111, 108) -> 463 (b'ol') had 632 occurrences\n",
|
334 |
+
"merge 209/744: (104, 101) -> 464 (b'he') had 622 occurrences\n",
|
335 |
+
"merge 210/744: (115, 309) -> 465 (b'sel') had 615 occurrences\n",
|
336 |
+
"merge 211/744: (267, 114) -> 466 (b'our') had 615 occurrences\n",
|
337 |
+
"merge 212/744: (32, 281) -> 467 (b' of') had 614 occurrences\n",
|
338 |
+
"merge 213/744: (270, 103) -> 468 (b'ong') had 606 occurrences\n",
|
339 |
+
"merge 214/744: (97, 354) -> 469 (b'ation') had 605 occurrences\n",
|
340 |
+
"merge 215/744: (292, 333) -> 470 (b' with') had 605 occurrences\n",
|
341 |
+
"merge 216/744: (313, 114) -> 471 (b'your') had 604 occurrences\n",
|
342 |
+
"merge 217/744: (99, 256) -> 472 (b'ce ') had 604 occurrences\n",
|
343 |
+
"merge 218/744: (329, 261) -> 473 (b'ust ') had 598 occurrences\n",
|
344 |
+
"merge 219/744: (66, 274) -> 474 (b'Bar') had 595 occurrences\n",
|
345 |
+
"merge 220/744: (117, 108) -> 475 (b'ul') had 593 occurrences\n",
|
346 |
+
"merge 221/744: (32, 293) -> 476 (b' and ') had 592 occurrences\n",
|
347 |
+
"merge 222/744: (32, 277) -> 477 (b' to') had 591 occurrences\n",
|
348 |
+
"merge 223/744: (391, 34) -> 478 (b': \"') had 589 occurrences\n",
|
349 |
+
"merge 224/744: (113, 117) -> 479 (b'qu') had 584 occurrences\n",
|
350 |
+
"merge 225/744: (274, 256) -> 480 (b'are ') had 583 occurrences\n",
|
351 |
+
"merge 226/744: (390, 256) -> 481 (b'. He ') had 582 occurrences\n",
|
352 |
+
"merge 227/744: (101, 287) -> 482 (b'ell') had 572 occurrences\n",
|
353 |
+
"merge 228/744: (101, 120) -> 483 (b'ex') had 571 occurrences\n",
|
354 |
+
"merge 229/744: (68, 117) -> 484 (b'Du') had 571 occurrences\n",
|
355 |
+
"merge 230/744: (97, 325) -> 485 (b'ave ') had 566 occurrences\n",
|
356 |
+
"merge 231/744: (107, 404) -> 486 (b'know') had 563 occurrences\n",
|
357 |
+
"merge 232/744: (115, 101) -> 487 (b'se') had 559 occurrences\n",
|
358 |
+
"merge 233/744: (115, 256) -> 488 (b'se ') had 557 occurrences\n",
|
359 |
+
"merge 234/744: (101, 343) -> 489 (b'eir') had 556 occurrences\n",
|
360 |
+
"merge 235/744: (116, 269) -> 490 (b'ten') had 553 occurrences\n",
|
361 |
+
"merge 236/744: (465, 102) -> 491 (b'self') had 553 occurrences\n",
|
362 |
+
"merge 237/744: (39, 261) -> 492 (b\"'t \") had 553 occurrences\n",
|
363 |
+
"merge 238/744: (266, 103) -> 493 (b'ang') had 552 occurrences\n",
|
364 |
+
"merge 239/744: (268, 264) -> 494 (b', the ') had 551 occurrences\n",
|
365 |
+
"merge 240/744: (399, 273) -> 495 (b'.\"\\n ') had 551 occurrences\n",
|
366 |
+
"merge 241/744: (286, 32) -> 496 (b' a ') had 549 occurrences\n",
|
367 |
+
"merge 242/744: (284, 260) -> 497 (b'ess ') had 536 occurrences\n",
|
368 |
+
"merge 243/744: (115, 104) -> 498 (b'sh') had 534 occurrences\n",
|
369 |
+
"merge 244/744: (115, 319) -> 499 (b'said') had 530 occurrences\n",
|
370 |
+
"merge 245/744: (267, 370) -> 500 (b'ound ') had 526 occurrences\n",
|
371 |
+
"merge 246/744: (267, 110) -> 501 (b'oun') had 524 occurrences\n",
|
372 |
+
"merge 247/744: (105, 98) -> 502 (b'ib') had 520 occurrences\n",
|
373 |
+
"merge 248/744: (70, 402) -> 503 (b'Frem') had 520 occurrences\n",
|
374 |
+
"merge 249/744: (283, 263) -> 504 (b' her') had 519 occurrences\n",
|
375 |
+
"merge 250/744: (359, 116) -> 505 (b'ought') had 515 occurrences\n",
|
376 |
+
"merge 251/744: (63, 34) -> 506 (b'?\"') had 512 occurrences\n",
|
377 |
+
"merge 252/744: (289, 108) -> 507 (b'til') had 512 occurrences\n",
|
378 |
+
"merge 253/744: (119, 282) -> 508 (b'wor') had 511 occurrences\n",
|
379 |
+
"merge 254/744: (98, 388) -> 509 (b'but ') had 508 occurrences\n",
|
380 |
+
"merge 255/744: (311, 282) -> 510 (b' for') had 506 occurrences\n",
|
381 |
+
"merge 256/744: (97, 257) -> 511 (b'ath') had 504 occurrences\n",
|
382 |
+
"merge 257/744: (381, 324) -> 512 (b' said. \"') had 502 occurrences\n",
|
383 |
+
"merge 258/744: (115, 112) -> 513 (b'sp') had 501 occurrences\n",
|
384 |
+
"merge 259/744: (304, 268) -> 514 (b'ed, ') had 499 occurrences\n",
|
385 |
+
"merge 260/744: (474, 270) -> 515 (b'Baron') had 497 occurrences\n",
|
386 |
+
"merge 261/744: (98, 256) -> 516 (b'be ') had 494 occurrences\n",
|
387 |
+
"merge 262/744: (105, 103) -> 517 (b'ig') had 493 occurrences\n",
|
388 |
+
"merge 263/744: (283, 326) -> 518 (b' him') had 487 occurrences\n",
|
389 |
+
"merge 264/744: (111, 100) -> 519 (b'od') had 482 occurrences\n",
|
390 |
+
"merge 265/744: (276, 116) -> 520 (b' st') had 481 occurrences\n",
|
391 |
+
"merge 266/744: (279, 275) -> 521 (b'ing the ') had 480 occurrences\n",
|
392 |
+
"merge 267/744: (289, 109) -> 522 (b'tim') had 476 occurrences\n",
|
393 |
+
"merge 268/744: (102, 302) -> 523 (b'fac') had 476 occurrences\n",
|
394 |
+
"merge 269/744: (99, 107) -> 524 (b'ck') had 470 occurrences\n",
|
395 |
+
"merge 270/744: (277, 114) -> 525 (b'tor') had 469 occurrences\n",
|
396 |
+
"merge 271/744: (109, 266) -> 526 (b'man') had 469 occurrences\n",
|
397 |
+
"merge 272/744: (32, 103) -> 527 (b' g') had 467 occurrences\n",
|
398 |
+
"merge 273/744: (261, 264) -> 528 (b't the ') had 466 occurrences\n",
|
399 |
+
"merge 274/744: (112, 108) -> 529 (b'pl') had 464 occurrences\n",
|
400 |
+
"merge 275/744: (276, 104) -> 530 (b' sh') had 461 occurrences\n",
|
401 |
+
"merge 276/744: (99, 298) -> 531 (b'com') had 459 occurrences\n",
|
402 |
+
"merge 277/744: (105, 259) -> 532 (b'id ') had 457 occurrences\n",
|
403 |
+
"merge 278/744: (98, 108) -> 533 (b'bl') had 455 occurrences\n",
|
404 |
+
"merge 279/744: (111, 361) -> 534 (b'over') had 454 occurrences\n",
|
405 |
+
"merge 280/744: (116, 447) -> 535 (b'turn') had 454 occurrences\n",
|
406 |
+
"merge 281/744: (262, 107) -> 536 (b'ink') had 453 occurrences\n",
|
407 |
+
"merge 282/744: (353, 400) -> 537 (b'look') had 452 occurrences\n",
|
408 |
+
"merge 283/744: (108, 121) -> 538 (b'ly') had 451 occurrences\n",
|
409 |
+
"merge 284/744: (257, 285) -> 539 (b'this ') had 451 occurrences\n",
|
410 |
+
"merge 285/744: (109, 111) -> 540 (b'mo') had 449 occurrences\n",
|
411 |
+
"merge 286/744: (72, 256) -> 541 (b'He ') had 445 occurrences\n",
|
412 |
+
"merge 287/744: (119, 274) -> 542 (b'war') had 445 occurrences\n",
|
413 |
+
"merge 288/744: (276, 288) -> 543 (b' she ') had 444 occurrences\n",
|
414 |
+
"merge 289/744: (276, 101) -> 544 (b' se') had 443 occurrences\n",
|
415 |
+
"merge 290/744: (398, 275) -> 545 (b',\" the ') had 441 occurrences\n",
|
416 |
+
"merge 291/744: (105, 270) -> 546 (b'ion') had 440 occurrences\n",
|
417 |
+
"merge 292/744: (262, 32) -> 547 (b'in ') had 439 occurrences\n",
|
418 |
+
"merge 293/744: (301, 260) -> 548 (b'its ') had 439 occurrences\n",
|
419 |
+
"merge 294/744: (100, 101) -> 549 (b'de') had 433 occurrences\n",
|
420 |
+
"merge 295/744: (103, 274) -> 550 (b'gar') had 433 occurrences\n",
|
421 |
+
"merge 296/744: (271, 98) -> 551 (b'ed b') had 430 occurrences\n",
|
422 |
+
"merge 297/744: (296, 285) -> 552 (b' this ') had 429 occurrences\n",
|
423 |
+
"merge 298/744: (97, 118) -> 553 (b'av') had 427 occurrences\n",
|
424 |
+
"merge 299/744: (280, 99) -> 554 (b'rec') had 424 occurrences\n",
|
425 |
+
"merge 300/744: (65, 114) -> 555 (b'Ar') had 424 occurrences\n",
|
426 |
+
"merge 301/744: (39, 287) -> 556 (b\"'ll\") had 422 occurrences\n",
|
427 |
+
"merge 302/744: (99, 270) -> 557 (b'con') had 420 occurrences\n",
|
428 |
+
"merge 303/744: (112, 112) -> 558 (b'pp') had 420 occurrences\n",
|
429 |
+
"merge 304/744: (117, 116) -> 559 (b'ut') had 419 occurrences\n",
|
430 |
+
"merge 305/744: (39, 325) -> 560 (b\"'ve \") had 418 occurrences\n",
|
431 |
+
"merge 306/744: (271, 277) -> 561 (b'ed to') had 417 occurrences\n",
|
432 |
+
"merge 307/744: (83, 507) -> 562 (b'Stil') had 417 occurrences\n",
|
433 |
+
"merge 308/744: (101, 265) -> 563 (b'e. ') had 415 occurrences\n",
|
434 |
+
"merge 309/744: (306, 256) -> 564 (b'ice ') had 414 occurrences\n",
|
435 |
+
"merge 310/744: (262, 259) -> 565 (b'ind ') had 414 occurrences\n",
|
436 |
+
"merge 311/744: (117, 100) -> 566 (b'ud') had 413 occurrences\n",
|
437 |
+
"merge 312/744: (350, 273) -> 567 (b'.\" \\n ') had 411 occurrences\n",
|
438 |
+
"merge 313/744: (72, 365) -> 568 (b'Haw') had 405 occurrences\n",
|
439 |
+
"merge 314/744: (262, 100) -> 569 (b'ind') had 405 occurrences\n",
|
440 |
+
"merge 315/744: (119, 340) -> 570 (b'were ') had 404 occurrences\n",
|
441 |
+
"merge 316/744: (270, 275) -> 571 (b'on the ') had 404 occurrences\n",
|
442 |
+
"merge 317/744: (399, 294) -> 572 (b'.\"\\n \"') had 402 occurrences\n",
|
443 |
+
"merge 318/744: (271, 290) -> 573 (b'ed at ') had 402 occurrences\n",
|
444 |
+
"merge 319/744: (562, 550) -> 574 (b'Stilgar') had 401 occurrences\n",
|
445 |
+
"merge 320/744: (63, 32) -> 575 (b'? ') had 399 occurrences\n",
|
446 |
+
"merge 321/744: (101, 361) -> 576 (b'ever') had 396 occurrences\n",
|
447 |
+
"merge 322/744: (256, 264) -> 577 (b'e the ') had 396 occurrences\n",
|
448 |
+
"merge 323/744: (302, 104) -> 578 (b'ach') had 395 occurrences\n",
|
449 |
+
"merge 324/744: (114, 368) -> 579 (b'rak') had 389 occurrences\n",
|
450 |
+
"merge 325/744: (121, 110) -> 580 (b'yn') had 387 occurrences\n",
|
451 |
+
"merge 326/744: (109, 397) -> 581 (b'mper') had 383 occurrences\n",
|
452 |
+
"merge 327/744: (268, 293) -> 582 (b', and ') had 383 occurrences\n",
|
453 |
+
"merge 328/744: (114, 359) -> 583 (b'rough') had 383 occurrences\n",
|
454 |
+
"merge 329/744: (109, 278) -> 584 (b'my ') had 382 occurrences\n",
|
455 |
+
"merge 330/744: (296, 334) -> 585 (b' them') had 377 occurrences\n",
|
456 |
+
"merge 331/744: (116, 119) -> 586 (b'tw') had 376 occurrences\n",
|
457 |
+
"merge 332/744: (111, 259) -> 587 (b'od ') had 375 occurrences\n",
|
458 |
+
"merge 333/744: (276, 112) -> 588 (b' sp') had 374 occurrences\n",
|
459 |
+
"merge 334/744: (100, 111) -> 589 (b'do') had 373 occurrences\n",
|
460 |
+
"merge 335/744: (555, 579) -> 590 (b'Arrak') had 372 occurrences\n",
|
461 |
+
"merge 336/744: (108, 295) -> 591 (b'low') had 372 occurrences\n",
|
462 |
+
"merge 337/744: (503, 269) -> 592 (b'Fremen') had 369 occurrences\n",
|
463 |
+
"merge 338/744: (279, 286) -> 593 (b'ing a') had 367 occurrences\n",
|
464 |
+
"merge 339/744: (115, 107) -> 594 (b'sk') had 367 occurrences\n",
|
465 |
+
"merge 340/744: (32, 313) -> 595 (b' you') had 366 occurrences\n",
|
466 |
+
"merge 341/744: (75, 580) -> 596 (b'Kyn') had 365 occurrences\n",
|
467 |
+
"merge 342/744: (269, 115) -> 597 (b'ens') had 364 occurrences\n",
|
468 |
+
"merge 343/744: (66, 388) -> 598 (b'But ') had 364 occurrences\n",
|
469 |
+
"merge 344/744: (271, 383) -> 599 (b'ed his ') had 362 occurrences\n",
|
470 |
+
"merge 345/744: (118, 111) -> 600 (b'vo') had 362 occurrences\n",
|
471 |
+
"merge 346/744: (312, 256) -> 601 (b' be ') had 362 occurrences\n",
|
472 |
+
"merge 347/744: (103, 114) -> 602 (b'gr') had 361 occurrences\n",
|
473 |
+
"merge 348/744: (274, 100) -> 603 (b'ard') had 359 occurrences\n",
|
474 |
+
"merge 349/744: (115, 261) -> 604 (b'st ') had 358 occurrences\n",
|
475 |
+
"merge 350/744: (292, 314) -> 605 (b' was ') had 358 occurrences\n",
|
476 |
+
"merge 351/744: (349, 319) -> 606 (b'e said') had 358 occurrences\n",
|
477 |
+
"merge 352/744: (101, 118) -> 607 (b'ev') had 355 occurrences\n",
|
478 |
+
"merge 353/744: (111, 345) -> 608 (b'old ') had 350 occurrences\n",
|
479 |
+
"merge 354/744: (270, 110) -> 609 (b'onn') had 350 occurrences\n",
|
480 |
+
"merge 355/744: (101, 321) -> 610 (b\"e's \") had 349 occurrences\n",
|
481 |
+
"merge 356/744: (111, 257) -> 611 (b'oth') had 349 occurrences\n",
|
482 |
+
"merge 357/744: (101, 102) -> 612 (b'ef') had 348 occurrences\n",
|
483 |
+
"merge 358/744: (72, 461) -> 613 (b'Hark') had 346 occurrences\n",
|
484 |
+
"merge 359/744: (33, 32) -> 614 (b'! ') had 346 occurrences\n",
|
485 |
+
"merge 360/744: (303, 261) -> 615 (b'ght ') had 345 occurrences\n",
|
486 |
+
"merge 361/744: (338, 102) -> 616 (b'lif') had 345 occurrences\n",
|
487 |
+
"merge 362/744: (310, 32) -> 617 (b'al ') had 345 occurrences\n",
|
488 |
+
"merge 363/744: (283, 256) -> 618 (b' he ') had 345 occurrences\n",
|
489 |
+
"merge 364/744: (283, 427) -> 619 (b' had ') had 345 occurrences\n",
|
490 |
+
"merge 365/744: (65, 370) -> 620 (b'And ') had 344 occurrences\n",
|
491 |
+
"merge 366/744: (299, 263) -> 621 (b'ater') had 344 occurrences\n",
|
492 |
+
"merge 367/744: (304, 324) -> 622 (b'ed. \"') had 343 occurrences\n",
|
493 |
+
"merge 368/744: (613, 609) -> 623 (b'Harkonn') had 342 occurrences\n",
|
494 |
+
"merge 369/744: (256, 281) -> 624 (b'e of') had 339 occurrences\n",
|
495 |
+
"merge 370/744: (265, 294) -> 625 (b'. \\n \"') had 338 occurrences\n",
|
496 |
+
"merge 371/744: (115, 288) -> 626 (b'she ') had 337 occurrences\n",
|
497 |
+
"merge 372/744: (115, 117) -> 627 (b'su') had 337 occurrences\n",
|
498 |
+
"merge 373/744: (257, 334) -> 628 (b'them') had 329 occurrences\n",
|
499 |
+
"merge 374/744: (316, 115) -> 629 (b'ass') had 328 occurrences\n",
|
500 |
+
"merge 375/744: (99, 407) -> 630 (b'could ') had 327 occurrences\n",
|
501 |
+
"merge 376/744: (269, 99) -> 631 (b'enc') had 326 occurrences\n",
|
502 |
+
"merge 377/744: (284, 116) -> 632 (b'est') had 325 occurrences\n",
|
503 |
+
"merge 378/744: (323, 325) -> 633 (b'have ') had 323 occurrences\n",
|
504 |
+
"merge 379/744: (371, 256) -> 634 (b'ame ') had 322 occurrences\n",
|
505 |
+
"merge 380/744: (307, 116) -> 635 (b'ist') had 319 occurrences\n",
|
506 |
+
"merge 381/744: (317, 115) -> 636 (b'ros') had 318 occurrences\n",
|
507 |
+
"merge 382/744: (451, 370) -> 637 (b'. And ') had 317 occurrences\n",
|
508 |
+
"merge 383/744: (257, 279) -> 638 (b'thing') had 317 occurrences\n",
|
509 |
+
"merge 384/744: (265, 273) -> 639 (b'. \\n ') had 317 occurrences\n",
|
510 |
+
"merge 385/744: (318, 332) -> 640 (b'.\\n The ') had 316 occurrences\n",
|
511 |
+
"merge 386/744: (298, 101) -> 641 (b'ome') had 316 occurrences\n",
|
512 |
+
"merge 387/744: (114, 117) -> 642 (b'ru') had 314 occurrences\n",
|
513 |
+
"merge 388/744: (338, 456) -> 643 (b'like ') had 314 occurrences\n",
|
514 |
+
"merge 389/744: (289, 287) -> 644 (b'till') had 313 occurrences\n",
|
515 |
+
"merge 390/744: (268, 509) -> 645 (b', but ') had 312 occurrences\n",
|
516 |
+
"merge 391/744: (379, 339) -> 646 (b',\" Paul') had 310 occurrences\n",
|
517 |
+
"merge 392/744: (112, 405) -> 647 (b'pos') had 308 occurrences\n",
|
518 |
+
"merge 393/744: (104, 111) -> 648 (b'ho') had 307 occurrences\n",
|
519 |
+
"merge 394/744: (296, 489) -> 649 (b' their') had 304 occurrences\n",
|
520 |
+
"merge 395/744: (311, 393) -> 650 (b' from') had 304 occurrences\n",
|
521 |
+
"merge 396/744: (269, 259) -> 651 (b'end ') had 303 occurrences\n",
|
522 |
+
"merge 397/744: (87, 256) -> 652 (b'We ') had 303 occurrences\n",
|
523 |
+
"merge 398/744: (67, 104) -> 653 (b'Ch') had 303 occurrences\n",
|
524 |
+
"merge 399/744: (297, 256) -> 654 (b'ide ') had 302 occurrences\n",
|
525 |
+
"merge 400/744: (112, 111) -> 655 (b'po') had 298 occurrences\n",
|
526 |
+
"merge 401/744: (298, 256) -> 656 (b'ome ') had 297 occurrences\n",
|
527 |
+
"merge 402/744: (112, 317) -> 657 (b'pro') had 295 occurrences\n",
|
528 |
+
"merge 403/744: (266, 105) -> 658 (b'ani') had 294 occurrences\n",
|
529 |
+
"merge 404/744: (283, 485) -> 659 (b' have ') had 293 occurrences\n",
|
530 |
+
"merge 405/744: (97, 276) -> 660 (b'a s') had 292 occurrences\n",
|
531 |
+
"merge 406/744: (484, 107) -> 661 (b'Duk') had 291 occurrences\n",
|
532 |
+
"merge 407/744: (312, 101) -> 662 (b' be') had 290 occurrences\n",
|
533 |
+
"merge 408/744: (408, 261) -> 663 (b'. It ') had 290 occurrences\n",
|
534 |
+
"merge 409/744: (257, 429) -> 664 (b'they ') had 290 occurrences\n",
|
535 |
+
"merge 410/744: (596, 320) -> 665 (b'Kynes ') had 290 occurrences\n",
|
536 |
+
"merge 411/744: (286, 260) -> 666 (b' as ') had 289 occurrences\n",
|
537 |
+
"merge 412/744: (315, 256) -> 667 (b'ure ') had 287 occurrences\n",
|
538 |
+
"merge 413/744: (355, 107) -> 668 (b'eck') had 286 occurrences\n",
|
539 |
+
"merge 414/744: (119, 101) -> 669 (b'we') had 285 occurrences\n",
|
540 |
+
"merge 415/744: (313, 32) -> 670 (b'you ') had 284 occurrences\n",
|
541 |
+
"merge 416/744: (117, 342) -> 671 (b'uch') had 284 occurrences\n",
|
542 |
+
"merge 417/744: (105, 309) -> 672 (b'iel') had 284 occurrences\n",
|
543 |
+
"merge 418/744: (110, 492) -> 673 (b\"n't \") had 282 occurrences\n",
|
544 |
+
"merge 419/744: (265, 459) -> 674 (b'. She ') had 281 occurrences\n",
|
545 |
+
"merge 420/744: (105, 112) -> 675 (b'ip') had 281 occurrences\n",
|
546 |
+
"merge 421/744: (117, 260) -> 676 (b'us ') had 279 occurrences\n",
|
547 |
+
"merge 422/744: (61, 32) -> 677 (b'= ') had 278 occurrences\n",
|
548 |
+
"merge 423/744: (275, 115) -> 678 (b' the s') had 278 occurrences\n",
|
549 |
+
"merge 424/744: (116, 260) -> 679 (b'ts ') had 278 occurrences\n",
|
550 |
+
"merge 425/744: (271, 262) -> 680 (b'ed in') had 277 occurrences\n",
|
551 |
+
"merge 426/744: (32, 351) -> 681 (b' of ') had 277 occurrences\n",
|
552 |
+
"merge 427/744: (289, 99) -> 682 (b'tic') had 276 occurrences\n",
|
553 |
+
"merge 428/744: (394, 119) -> 683 (b'new') had 274 occurrences\n",
|
554 |
+
"merge 429/744: (484, 456) -> 684 (b'Duke ') had 274 occurrences\n",
|
555 |
+
"merge 430/744: (257, 505) -> 685 (b'thought') had 274 occurrences\n",
|
556 |
+
"merge 431/744: (69, 581) -> 686 (b'Emper') had 273 occurrences\n",
|
557 |
+
"merge 432/744: (686, 282) -> 687 (b'Emperor') had 273 occurrences\n",
|
558 |
+
"merge 433/744: (103, 111) -> 688 (b'go') had 273 occurrences\n",
|
559 |
+
"merge 434/744: (112, 101) -> 689 (b'pe') had 273 occurrences\n",
|
560 |
+
"merge 435/744: (97, 375) -> 690 (b'ather') had 272 occurrences\n",
|
561 |
+
"merge 436/744: (99, 114) -> 691 (b'cr') had 270 occurrences\n",
|
562 |
+
"merge 437/744: (300, 278) -> 692 (b' my ') had 270 occurrences\n",
|
563 |
+
"merge 438/744: (267, 260) -> 693 (b'ous ') had 269 occurrences\n",
|
564 |
+
"merge 439/744: (102, 111) -> 694 (b'fo') had 268 occurrences\n",
|
565 |
+
"merge 440/744: (119, 401) -> 695 (b'way') had 268 occurrences\n",
|
566 |
+
"merge 441/744: (568, 290) -> 696 (b'Hawat ') had 268 occurrences\n",
|
567 |
+
"merge 442/744: (305, 270) -> 697 (b' con') had 268 occurrences\n",
|
568 |
+
"merge 443/744: (114, 256) -> 698 (b're ') had 268 occurrences\n",
|
569 |
+
"merge 444/744: (117, 280) -> 699 (b'ure') had 267 occurrences\n",
|
570 |
+
"merge 445/744: (302, 256) -> 700 (b'ace ') had 266 occurrences\n",
|
571 |
+
"merge 446/744: (542, 259) -> 701 (b'ward ') had 265 occurrences\n",
|
572 |
+
"merge 447/744: (457, 294) -> 702 (b'?\" \\n \"') had 264 occurrences\n",
|
573 |
+
"merge 448/744: (121, 275) -> 703 (b'y the ') had 263 occurrences\n",
|
574 |
+
"merge 449/744: (266, 261) -> 704 (b'ant ') had 263 occurrences\n",
|
575 |
+
"merge 450/744: (100, 433) -> 705 (b'down') had 262 occurrences\n",
|
576 |
+
"merge 451/744: (257, 340) -> 706 (b'there ') had 262 occurrences\n",
|
577 |
+
"merge 452/744: (100, 260) -> 707 (b'ds ') had 261 occurrences\n",
|
578 |
+
"merge 453/744: (299, 342) -> 708 (b'atch') had 260 occurrences\n",
|
579 |
+
"merge 454/744: (117, 101) -> 709 (b'ue') had 259 occurrences\n",
|
580 |
+
"merge 455/744: (653, 658) -> 710 (b'Chani') had 259 occurrences\n",
|
581 |
+
"merge 456/744: (378, 269) -> 711 (b'been') had 258 occurrences\n",
|
582 |
+
"merge 457/744: (73, 32) -> 712 (b'I ') had 258 occurrences\n",
|
583 |
+
"merge 458/744: (264, 115) -> 713 (b'the s') had 257 occurrences\n",
|
584 |
+
"merge 459/744: (304, 364) -> 714 (b'ed.\\n \"') had 257 occurrences\n",
|
585 |
+
"merge 460/744: (111, 118) -> 715 (b'ov') had 254 occurrences\n",
|
586 |
+
"merge 461/744: (347, 462) -> 716 (b'under') had 254 occurrences\n",
|
587 |
+
"merge 462/744: (266, 278) -> 717 (b'any ') had 253 occurrences\n",
|
588 |
+
"merge 463/744: (112, 438) -> 718 (b'pres') had 253 occurrences\n",
|
589 |
+
"merge 464/744: (102, 101) -> 719 (b'fe') had 252 occurrences\n",
|
590 |
+
"merge 465/744: (103, 105) -> 720 (b'gi') had 252 occurrences\n",
|
591 |
+
"merge 466/744: (263, 116) -> 721 (b'ert') had 251 occurrences\n",
|
592 |
+
"merge 467/744: (282, 256) -> 722 (b'ore ') had 251 occurrences\n",
|
593 |
+
"merge 468/744: (284, 268) -> 723 (b'es, ') had 251 occurrences\n",
|
594 |
+
"merge 469/744: (76, 101) -> 724 (b'Le') had 250 occurrences\n",
|
595 |
+
"merge 470/744: (267, 116) -> 725 (b'out') had 249 occurrences\n",
|
596 |
+
"merge 471/744: (99, 108) -> 726 (b'cl') had 249 occurrences\n",
|
597 |
+
"merge 472/744: (109, 101) -> 727 (b'me') had 249 occurrences\n",
|
598 |
+
"merge 473/744: (517, 110) -> 728 (b'ign') had 249 occurrences\n",
|
599 |
+
"merge 474/744: (304, 318) -> 729 (b'ed.\\n ') had 248 occurrences\n",
|
600 |
+
"merge 475/744: (100, 45) -> 730 (b'd-') had 248 occurrences\n",
|
601 |
+
"merge 476/744: (448, 261) -> 731 (b'ight ') had 247 occurrences\n",
|
602 |
+
"merge 477/744: (117, 287) -> 732 (b'ull') had 247 occurrences\n",
|
603 |
+
"merge 478/744: (286, 594) -> 733 (b' ask') had 246 occurrences\n",
|
604 |
+
"merge 479/744: (274, 500) -> 734 (b'around ') had 246 occurrences\n",
|
605 |
+
"merge 480/744: (99, 266) -> 735 (b'can') had 246 occurrences\n",
|
606 |
+
"merge 481/744: (39, 259) -> 736 (b\"'d \") had 245 occurrences\n",
|
607 |
+
"merge 482/744: (270, 417) -> 737 (b'only ') had 245 occurrences\n",
|
608 |
+
"merge 483/744: (108, 468) -> 738 (b'long') had 245 occurrences\n",
|
609 |
+
"merge 484/744: (299, 256) -> 739 (b'ate ') had 244 occurrences\n",
|
610 |
+
"merge 485/744: (368, 256) -> 740 (b'ake ') had 244 occurrences\n",
|
611 |
+
"merge 486/744: (100, 114) -> 741 (b'dr') had 244 occurrences\n",
|
612 |
+
"merge 487/744: (116, 317) -> 742 (b'tro') had 244 occurrences\n",
|
613 |
+
"merge 488/744: (286, 276) -> 743 (b' a s') had 243 occurrences\n",
|
614 |
+
"merge 489/744: (292, 410) -> 744 (b' will') had 243 occurrences\n",
|
615 |
+
"merge 490/744: (458, 275) -> 745 (b'from the ') had 243 occurrences\n",
|
616 |
+
"merge 491/744: (339, 32) -> 746 (b'Paul ') had 242 occurrences\n",
|
617 |
+
"merge 492/744: (307, 104) -> 747 (b'ish') had 242 occurrences\n",
|
618 |
+
"merge 493/744: (119, 256) -> 748 (b'we ') had 241 occurrences\n",
|
619 |
+
"merge 494/744: (100, 284) -> 749 (b'des') had 241 occurrences\n",
|
620 |
+
"merge 495/744: (119, 410) -> 750 (b'will') had 241 occurrences\n",
|
621 |
+
"merge 496/744: (322, 111) -> 751 (b' do') had 240 occurrences\n",
|
622 |
+
"merge 497/744: (116, 280) -> 752 (b'tre') had 238 occurrences\n",
|
623 |
+
"merge 498/744: (32, 357) -> 753 (b' to ') had 238 occurrences\n",
|
624 |
+
"merge 499/744: (32, 362) -> 754 (b' of the ') had 237 occurrences\n",
|
625 |
+
"merge 500/744: (103, 117) -> 755 (b'gu') had 237 occurrences\n",
|
626 |
+
"merge 501/744: (267, 108) -> 756 (b'oul') had 237 occurrences\n",
|
627 |
+
"merge 502/744: (636, 260) -> 757 (b'ross ') had 237 occurrences\n",
|
628 |
+
"merge 503/744: (283, 606) -> 758 (b' he said') had 237 occurrences\n",
|
629 |
+
"merge 504/744: (103, 280) -> 759 (b'gre') had 236 occurrences\n",
|
630 |
+
"merge 505/744: (266, 99) -> 760 (b'anc') had 235 occurrences\n",
|
631 |
+
"merge 506/744: (100, 105) -> 761 (b'di') had 235 occurrences\n",
|
632 |
+
"merge 507/744: (102, 343) -> 762 (b'fir') had 234 occurrences\n",
|
633 |
+
"merge 508/744: (46, 10) -> 763 (b'.\\n') had 232 occurrences\n",
|
634 |
+
"merge 509/744: (267, 115) -> 764 (b'ous') had 232 occurrences\n",
|
635 |
+
"merge 510/744: (97, 102) -> 765 (b'af') had 232 occurrences\n",
|
636 |
+
"merge 511/744: (257, 359) -> 766 (b'though') had 232 occurrences\n",
|
637 |
+
"merge 512/744: (70, 363) -> 767 (b'Fey') had 232 occurrences\n",
|
638 |
+
"merge 513/744: (405, 261) -> 768 (b'ost ') had 231 occurrences\n",
|
639 |
+
"merge 514/744: (398, 543) -> 769 (b',\" she ') had 231 occurrences\n",
|
640 |
+
"merge 515/744: (386, 269) -> 770 (b'open') had 230 occurrences\n",
|
641 |
+
"merge 516/744: (296, 505) -> 771 (b' thought') had 230 occurrences\n",
|
642 |
+
"merge 517/744: (99, 274) -> 772 (b'car') had 229 occurrences\n",
|
643 |
+
"merge 518/744: (33, 34) -> 773 (b'!\"') had 229 occurrences\n",
|
644 |
+
"merge 519/744: (398, 758) -> 774 (b',\" he said') had 229 occurrences\n",
|
645 |
+
"merge 520/744: (300, 101) -> 775 (b' me') had 228 occurrences\n",
|
646 |
+
"merge 521/744: (299, 321) -> 776 (b\"at's \") had 228 occurrences\n",
|
647 |
+
"merge 522/744: (455, 290) -> 777 (b'What ') had 228 occurrences\n",
|
648 |
+
"merge 523/744: (303, 116) -> 778 (b'ght') had 227 occurrences\n",
|
649 |
+
"merge 524/744: (105, 122) -> 779 (b'iz') had 227 occurrences\n",
|
650 |
+
"merge 525/744: (316, 107) -> 780 (b'ask') had 226 occurrences\n",
|
651 |
+
"merge 526/744: (360, 32) -> 781 (b'for ') had 225 occurrences\n",
|
652 |
+
"merge 527/744: (121, 276) -> 782 (b'y s') had 225 occurrences\n",
|
653 |
+
"merge 528/744: (282, 100) -> 783 (b'ord') had 225 occurrences\n",
|
654 |
+
"merge 529/744: (115, 265) -> 784 (b's. ') had 224 occurrences\n",
|
655 |
+
"merge 530/744: (103, 108) -> 785 (b'gl') had 224 occurrences\n",
|
656 |
+
"merge 531/744: (104, 328) -> 786 (b'her ') had 224 occurrences\n",
|
657 |
+
"merge 532/744: (677, 677) -> 787 (b'= = ') had 223 occurrences\n",
|
658 |
+
"merge 533/744: (405, 256) -> 788 (b'ose ') had 221 occurrences\n",
|
659 |
+
"merge 534/744: (317, 298) -> 789 (b'room') had 220 occurrences\n",
|
660 |
+
"merge 535/744: (316, 261) -> 790 (b'ast ') had 220 occurrences\n",
|
661 |
+
"merge 536/744: (116, 321) -> 791 (b\"t's \") had 220 occurrences\n",
|
662 |
+
"merge 537/744: (623, 269) -> 792 (b'Harkonnen') had 218 occurrences\n",
|
663 |
+
"merge 538/744: (104, 380) -> 793 (b'hand') had 218 occurrences\n",
|
664 |
+
"merge 539/744: (72, 356) -> 794 (b'Hall') had 218 occurrences\n",
|
665 |
+
"merge 540/744: (389, 32) -> 795 (b'with ') had 217 occurrences\n",
|
666 |
+
"merge 541/744: (112, 443) -> 796 (b'plan') had 216 occurrences\n",
|
667 |
+
"merge 542/744: (414, 112) -> 797 (b'app') had 216 occurrences\n",
|
668 |
+
"merge 543/744: (111, 98) -> 798 (b'ob') had 216 occurrences\n",
|
669 |
+
"merge 544/744: (260, 281) -> 799 (b's of') had 215 occurrences\n",
|
670 |
+
"merge 545/744: (39, 698) -> 800 (b\"'re \") had 215 occurrences\n",
|
671 |
+
"merge 546/744: (317, 524) -> 801 (b'rock') had 214 occurrences\n",
|
672 |
+
"merge 547/744: (116, 279) -> 802 (b'ting') had 213 occurrences\n",
|
673 |
+
"merge 548/744: (119, 421) -> 803 (b'way ') had 213 occurrences\n",
|
674 |
+
"merge 549/744: (274, 109) -> 804 (b'arm') had 212 occurrences\n",
|
675 |
+
"merge 550/744: (283, 328) -> 805 (b' her ') had 212 occurrences\n",
|
676 |
+
"merge 551/744: (322, 101) -> 806 (b' de') had 212 occurrences\n",
|
677 |
+
"merge 552/744: (116, 373) -> 807 (b'tle ') had 210 occurrences\n",
|
678 |
+
"merge 553/744: (374, 340) -> 808 (b'where ') had 210 occurrences\n",
|
679 |
+
"merge 554/744: (33, 291) -> 809 (b'!\" ') had 210 occurrences\n",
|
680 |
+
"merge 555/744: (97, 300) -> 810 (b'a m') had 209 occurrences\n",
|
681 |
+
"merge 556/744: (282, 32) -> 811 (b'or ') had 209 occurrences\n",
|
682 |
+
"merge 557/744: (257, 583) -> 812 (b'through') had 209 occurrences\n",
|
683 |
+
"merge 558/744: (97, 311) -> 813 (b'a f') had 209 occurrences\n",
|
684 |
+
"merge 559/744: (284, 261) -> 814 (b'est ') had 208 occurrences\n",
|
685 |
+
"merge 560/744: (506, 294) -> 815 (b'?\"\\n \"') had 208 occurrences\n",
|
686 |
+
"merge 561/744: (374, 290) -> 816 (b'what ') had 208 occurrences\n",
|
687 |
+
"merge 562/744: (73, 261) -> 817 (b'It ') had 206 occurrences\n",
|
688 |
+
"merge 563/744: (260, 293) -> 818 (b's and ') had 206 occurrences\n",
|
689 |
+
"merge 564/744: (121, 268) -> 819 (b'y, ') had 205 occurrences\n",
|
690 |
+
"merge 565/744: (301, 278) -> 820 (b'ity ') had 205 occurrences\n",
|
691 |
+
"merge 566/744: (330, 102) -> 821 (b'lef') had 205 occurrences\n",
|
692 |
+
"merge 567/744: (308, 257) -> 822 (b'auth') had 205 occurrences\n",
|
693 |
+
"merge 568/744: (77, 117) -> 823 (b'Mu') had 204 occurrences\n",
|
694 |
+
"merge 569/744: (97, 532) -> 824 (b'aid ') had 204 occurrences\n",
|
695 |
+
"merge 570/744: (271, 115) -> 825 (b'ed s') had 204 occurrences\n",
|
696 |
+
"merge 571/744: (794, 668) -> 826 (b'Halleck') had 204 occurrences\n",
|
697 |
+
"merge 572/744: (269, 472) -> 827 (b'ence ') had 203 occurrences\n",
|
698 |
+
"merge 573/744: (103, 366) -> 828 (b'gain') had 203 occurrences\n",
|
699 |
+
"merge 574/744: (118, 105) -> 829 (b'vi') had 203 occurrences\n",
|
700 |
+
"merge 575/744: (45, 104) -> 830 (b'-h') had 203 occurrences\n",
|
701 |
+
"merge 576/744: (767, 730) -> 831 (b'Feyd-') had 203 occurrences\n",
|
702 |
+
"merge 577/744: (831, 82) -> 832 (b'Feyd-R') had 203 occurrences\n",
|
703 |
+
"merge 578/744: (98, 111) -> 833 (b'bo') had 202 occurrences\n",
|
704 |
+
"merge 579/744: (337, 117) -> 834 (b'tru') had 202 occurrences\n",
|
705 |
+
"merge 580/744: (269, 100) -> 835 (b'end') had 202 occurrences\n",
|
706 |
+
"merge 581/744: (832, 822) -> 836 (b'Feyd-Rauth') had 202 occurrences\n",
|
707 |
+
"merge 582/744: (39, 68) -> 837 (b\"'D\") had 201 occurrences\n",
|
708 |
+
"merge 583/744: (306, 107) -> 838 (b'ick') had 201 occurrences\n",
|
709 |
+
"merge 584/744: (413, 366) -> 839 (b'again') had 201 occurrences\n",
|
710 |
+
"merge 585/744: (110, 497) -> 840 (b'ness ') had 200 occurrences\n",
|
711 |
+
"merge 586/744: (97, 344) -> 841 (b'a p') had 200 occurrences\n",
|
712 |
+
"merge 587/744: (823, 335) -> 842 (b'Muad') had 199 occurrences\n",
|
713 |
+
"merge 588/744: (305, 104) -> 843 (b' ch') had 199 occurrences\n",
|
714 |
+
"merge 589/744: (306, 104) -> 844 (b'ich') had 199 occurrences\n",
|
715 |
+
"merge 590/744: (305, 266) -> 845 (b' can') had 199 occurrences\n",
|
716 |
+
"merge 591/744: (109, 473) -> 846 (b'must ') had 199 occurrences\n",
|
717 |
+
"merge 592/744: (842, 837) -> 847 (b\"Muad'D\") had 198 occurrences\n",
|
718 |
+
"merge 593/744: (847, 502) -> 848 (b\"Muad'Dib\") had 198 occurrences\n",
|
719 |
+
"merge 594/744: (323, 100) -> 849 (b'had') had 198 occurrences\n",
|
720 |
+
"merge 595/744: (769, 499) -> 850 (b',\" she said') had 198 occurrences\n",
|
721 |
+
"merge 596/744: (323, 287) -> 851 (b'hall') had 195 occurrences\n",
|
722 |
+
"merge 597/744: (271, 424) -> 852 (b'ed him') had 195 occurrences\n",
|
723 |
+
"merge 598/744: (270, 492) -> 853 (b\"on't \") had 195 occurrences\n",
|
724 |
+
"merge 599/744: (107, 274) -> 854 (b'kar') had 195 occurrences\n",
|
725 |
+
"merge 600/744: (269, 256) -> 855 (b'ene ') had 194 occurrences\n",
|
726 |
+
"merge 601/744: (32, 436) -> 856 (b' . . . ') had 194 occurrences\n",
|
727 |
+
"merge 602/744: (271, 446) -> 857 (b'ed her') had 194 occurrences\n",
|
728 |
+
"merge 603/744: (309, 261) -> 858 (b'elt ') had 194 occurrences\n",
|
729 |
+
"merge 604/744: (112, 274) -> 859 (b'par') had 194 occurrences\n",
|
730 |
+
"merge 605/744: (277, 276) -> 860 (b'to s') had 193 occurrences\n",
|
731 |
+
"merge 606/744: (611, 328) -> 861 (b'other ') had 193 occurrences\n",
|
732 |
+
"merge 607/744: (257, 489) -> 862 (b'their') had 192 occurrences\n",
|
733 |
+
"merge 608/744: (305, 298) -> 863 (b' com') had 192 occurrences\n",
|
734 |
+
"merge 609/744: (71, 447) -> 864 (b'Gurn') had 192 occurrences\n",
|
735 |
+
"merge 610/744: (864, 363) -> 865 (b'Gurney') had 192 occurrences\n",
|
736 |
+
"merge 611/744: (286, 261) -> 866 (b' at ') had 191 occurrences\n",
|
737 |
+
"merge 612/744: (98, 263) -> 867 (b'ber') had 191 occurrences\n",
|
738 |
+
"merge 613/744: (83, 603) -> 868 (b'Sard') had 191 occurrences\n",
|
739 |
+
"merge 614/744: (868, 308) -> 869 (b'Sardau') had 191 occurrences\n",
|
740 |
+
"merge 615/744: (869, 854) -> 870 (b'Sardaukar') had 191 occurrences\n",
|
741 |
+
"merge 616/744: (348, 263) -> 871 (b'esser') had 189 occurrences\n",
|
742 |
+
"merge 617/744: (403, 373) -> 872 (b'able ') had 189 occurrences\n",
|
743 |
+
"merge 618/744: (316, 116) -> 873 (b'ast') had 189 occurrences\n",
|
744 |
+
"merge 619/744: (330, 274) -> 874 (b'lear') had 188 occurrences\n",
|
745 |
+
"merge 620/744: (71, 871) -> 875 (b'Gesser') had 186 occurrences\n",
|
746 |
+
"merge 621/744: (66, 855) -> 876 (b'Bene ') had 185 occurrences\n",
|
747 |
+
"merge 622/744: (876, 875) -> 877 (b'Bene Gesser') had 185 occurrences\n",
|
748 |
+
"merge 623/744: (413, 256) -> 878 (b'age ') had 185 occurrences\n",
|
749 |
+
"merge 624/744: (108, 301) -> 879 (b'lit') had 185 occurrences\n",
|
750 |
+
"merge 625/744: (268, 34) -> 880 (b', \"') had 185 occurrences\n",
|
751 |
+
"merge 626/744: (324, 73) -> 881 (b'. \"I') had 185 occurrences\n",
|
752 |
+
"merge 627/744: (112, 114) -> 882 (b'pr') had 185 occurrences\n",
|
753 |
+
"merge 628/744: (32, 73) -> 883 (b' I') had 184 occurrences\n",
|
754 |
+
"merge 629/744: (363, 320) -> 884 (b'eyes ') had 184 occurrences\n",
|
755 |
+
"merge 630/744: (337, 366) -> 885 (b'train') had 184 occurrences\n",
|
756 |
+
"merge 631/744: (105, 345) -> 886 (b'ild ') had 184 occurrences\n",
|
757 |
+
"merge 632/744: (112, 282) -> 887 (b'por') had 184 occurrences\n",
|
758 |
+
"merge 633/744: (263, 118) -> 888 (b'erv') had 183 occurrences\n",
|
759 |
+
"merge 634/744: (110, 442) -> 889 (b'nif') had 183 occurrences\n",
|
760 |
+
"merge 635/744: (501, 100) -> 890 (b'ound') had 183 occurrences\n",
|
761 |
+
"merge 636/744: (119, 298) -> 891 (b'wom') had 182 occurrences\n",
|
762 |
+
"merge 637/744: (443, 99) -> 892 (b'lanc') had 181 occurrences\n",
|
763 |
+
"merge 638/744: (269, 101) -> 893 (b'ene') had 180 occurrences\n",
|
764 |
+
"merge 639/744: (281, 102) -> 894 (b'off') had 180 occurrences\n",
|
765 |
+
"merge 640/744: (257, 327) -> 895 (b'thing ') had 179 occurrences\n",
|
766 |
+
"merge 641/744: (99, 414) -> 896 (b'cap') had 179 occurrences\n",
|
767 |
+
"merge 642/744: (109, 768) -> 897 (b'most ') had 178 occurrences\n",
|
768 |
+
"merge 643/744: (104, 314) -> 898 (b'has ') had 178 occurrences\n",
|
769 |
+
"merge 644/744: (544, 256) -> 899 (b' see ') had 177 occurrences\n",
|
770 |
+
"merge 645/744: (263, 260) -> 900 (b'ers ') had 177 occurrences\n",
|
771 |
+
"merge 646/744: (292, 282) -> 901 (b' wor') had 176 occurrences\n",
|
772 |
+
"merge 647/744: (286, 109) -> 902 (b' am') had 174 occurrences\n",
|
773 |
+
"merge 648/744: (286, 99) -> 903 (b' ac') had 174 occurrences\n",
|
774 |
+
"merge 649/744: (102, 108) -> 904 (b'fl') had 174 occurrences\n",
|
775 |
+
"merge 650/744: (305, 407) -> 905 (b' could ') had 173 occurrences\n",
|
776 |
+
"merge 651/744: (522, 256) -> 906 (b'time ') had 172 occurrences\n",
|
777 |
+
"merge 652/744: (300, 473) -> 907 (b' must ') had 172 occurrences\n",
|
778 |
+
"merge 653/744: (724, 277) -> 908 (b'Leto') had 172 occurrences\n",
|
779 |
+
"merge 654/744: (406, 275) -> 909 (b' in the ') had 171 occurrences\n",
|
780 |
+
"merge 655/744: (97, 343) -> 910 (b'air') had 171 occurrences\n",
|
781 |
+
"merge 656/744: (279, 260) -> 911 (b'ings ') had 171 occurrences\n",
|
782 |
+
"merge 657/744: (101, 318) -> 912 (b'e.\\n ') had 170 occurrences\n",
|
783 |
+
"merge 658/744: (103, 256) -> 913 (b'ge ') had 170 occurrences\n",
|
784 |
+
"merge 659/744: (282, 110) -> 914 (b'orn') had 169 occurrences\n",
|
785 |
+
"merge 660/744: (419, 259) -> 915 (b'eard ') had 169 occurrences\n",
|
786 |
+
"merge 661/744: (119, 407) -> 916 (b'would ') had 168 occurrences\n",
|
787 |
+
"merge 662/744: (268, 288) -> 917 (b', he ') had 168 occurrences\n",
|
788 |
+
"merge 663/744: (384, 274) -> 918 (b'star') had 168 occurrences\n",
|
789 |
+
"merge 664/744: (341, 429) -> 919 (b'They ') had 167 occurrences\n",
|
790 |
+
"merge 665/744: (458, 32) -> 920 (b'from ') had 166 occurrences\n",
|
791 |
+
"merge 666/744: (600, 564) -> 921 (b'voice ') had 166 occurrences\n",
|
792 |
+
"merge 667/744: (271, 357) -> 922 (b'ed to ') had 166 occurrences\n",
|
793 |
+
"merge 668/744: (445, 429) -> 923 (b'. They ') had 166 occurrences\n",
|
794 |
+
"merge 669/744: (590, 307) -> 924 (b'Arrakis') had 165 occurrences\n",
|
795 |
+
"merge 670/744: (101, 101) -> 925 (b'ee') had 165 occurrences\n",
|
796 |
+
"merge 671/744: (32, 270) -> 926 (b' on') had 165 occurrences\n",
|
797 |
+
"merge 672/744: (79, 110) -> 927 (b'On') had 164 occurrences\n",
|
798 |
+
"merge 673/744: (471, 32) -> 928 (b'your ') had 163 occurrences\n",
|
799 |
+
"merge 674/744: (97, 104) -> 929 (b'ah') had 163 occurrences\n",
|
800 |
+
"merge 675/744: (109, 269) -> 930 (b'men') had 163 occurrences\n",
|
801 |
+
"merge 676/744: (689, 386) -> 931 (b'peop') had 162 occurrences\n",
|
802 |
+
"merge 677/744: (98, 114) -> 932 (b'br') had 162 occurrences\n",
|
803 |
+
"merge 678/744: (403, 396) -> 933 (b'about ') had 161 occurrences\n",
|
804 |
+
"merge 679/744: (299, 271) -> 934 (b'ated ') had 161 occurrences\n",
|
805 |
+
"merge 680/744: (600, 306) -> 935 (b'voic') had 161 occurrences\n",
|
806 |
+
"merge 681/744: (284, 256) -> 936 (b'ese ') had 161 occurrences\n",
|
807 |
+
"merge 682/744: (394, 278) -> 937 (b'ney ') had 161 occurrences\n",
|
808 |
+
"merge 683/744: (99, 105) -> 938 (b'ci') had 160 occurrences\n",
|
809 |
+
"merge 684/744: (108, 262) -> 939 (b'lin') had 160 occurrences\n",
|
810 |
+
"merge 685/744: (32, 352) -> 940 (b' it ') had 160 occurrences\n",
|
811 |
+
"merge 686/744: (100, 269) -> 941 (b'den') had 160 occurrences\n",
|
812 |
+
"merge 687/744: (353, 115) -> 942 (b'los') had 159 occurrences\n",
|
813 |
+
"merge 688/744: (98, 432) -> 943 (b'back') had 159 occurrences\n",
|
814 |
+
"merge 689/744: (266, 107) -> 944 (b'ank') had 158 occurrences\n",
|
815 |
+
"merge 690/744: (89, 709) -> 945 (b'Yue') had 158 occurrences\n",
|
816 |
+
"merge 691/744: (945, 104) -> 946 (b'Yueh') had 158 occurrences\n",
|
817 |
+
"merge 692/744: (265, 83) -> 947 (b'. S') had 158 occurrences\n",
|
818 |
+
"merge 693/744: (309, 278) -> 948 (b'ely ') had 158 occurrences\n",
|
819 |
+
"merge 694/744: (119, 621) -> 949 (b'water') had 158 occurrences\n",
|
820 |
+
"merge 695/744: (115, 337) -> 950 (b'str') had 157 occurrences\n",
|
821 |
+
"merge 696/744: (265, 425) -> 951 (b'. You') had 157 occurrences\n",
|
822 |
+
"merge 697/744: (76, 783) -> 952 (b'Lord') had 157 occurrences\n",
|
823 |
+
"merge 698/744: (267, 257) -> 953 (b'outh') had 156 occurrences\n",
|
824 |
+
"merge 699/744: (448, 116) -> 954 (b'ight') had 156 occurrences\n",
|
825 |
+
"merge 700/744: (71, 315) -> 955 (b'Gur') had 156 occurrences\n",
|
826 |
+
"merge 701/744: (955, 937) -> 956 (b'Gurney ') had 156 occurrences\n",
|
827 |
+
"merge 702/744: (82, 576) -> 957 (b'Rever') had 155 occurrences\n",
|
828 |
+
"merge 703/744: (102, 690) -> 958 (b'father') had 155 occurrences\n",
|
829 |
+
"merge 704/744: (118, 101) -> 959 (b've') had 155 occurrences\n",
|
830 |
+
"merge 705/744: (268, 257) -> 960 (b', th') had 154 occurrences\n",
|
831 |
+
"merge 706/744: (98, 278) -> 961 (b'by ') had 154 occurrences\n",
|
832 |
+
"merge 707/744: (280, 335) -> 962 (b'read') had 154 occurrences\n",
|
833 |
+
"merge 708/744: (32, 116) -> 963 (b' t') had 154 occurrences\n",
|
834 |
+
"merge 709/744: (360, 256) -> 964 (b'fore ') had 153 occurrences\n",
|
835 |
+
"merge 710/744: (590, 285) -> 965 (b'Arrakis ') had 153 occurrences\n",
|
836 |
+
"merge 711/744: (537, 271) -> 966 (b'looked ') had 153 occurrences\n",
|
837 |
+
"merge 712/744: (877, 352) -> 967 (b'Bene Gesserit ') had 152 occurrences\n",
|
838 |
+
"merge 713/744: (117, 98) -> 968 (b'ub') had 152 occurrences\n",
|
839 |
+
"merge 714/744: (107, 683) -> 969 (b'knew') had 152 occurrences\n",
|
840 |
+
"merge 715/744: (302, 757) -> 970 (b'across ') had 152 occurrences\n",
|
841 |
+
"merge 716/744: (286, 287) -> 971 (b' all') had 151 occurrences\n",
|
842 |
+
"merge 717/744: (323, 112) -> 972 (b'hap') had 151 occurrences\n",
|
843 |
+
"merge 718/744: (101, 119) -> 973 (b'ew') had 151 occurrences\n",
|
844 |
+
"merge 719/744: (318, 339) -> 974 (b'.\\n Paul') had 151 occurrences\n",
|
845 |
+
"merge 720/744: (403, 98) -> 975 (b'abb') had 151 occurrences\n",
|
846 |
+
"merge 721/744: (296, 536) -> 976 (b' think') had 151 occurrences\n",
|
847 |
+
"merge 722/744: (318, 65) -> 977 (b'.\\n A') had 151 occurrences\n",
|
848 |
+
"merge 723/744: (274, 114) -> 978 (b'arr') had 151 occurrences\n",
|
849 |
+
"merge 724/744: (32, 418) -> 979 (b' to the ') had 151 occurrences\n",
|
850 |
+
"merge 725/744: (312, 432) -> 980 (b' back') had 150 occurrences\n",
|
851 |
+
"merge 726/744: (293, 264) -> 981 (b'and the ') had 150 occurrences\n",
|
852 |
+
"merge 727/744: (107, 410) -> 982 (b'kill') had 150 occurrences\n",
|
853 |
+
"merge 728/744: (109, 256) -> 983 (b'me ') had 150 occurrences\n",
|
854 |
+
"merge 729/744: (312, 108) -> 984 (b' bl') had 149 occurrences\n",
|
855 |
+
"merge 730/744: (756, 100) -> 985 (b'ould') had 149 occurrences\n",
|
856 |
+
"merge 731/744: (300, 256) -> 986 (b' me ') had 149 occurrences\n",
|
857 |
+
"merge 732/744: (957, 651) -> 987 (b'Reverend ') had 148 occurrences\n",
|
858 |
+
"merge 733/744: (987, 77) -> 988 (b'Reverend M') had 148 occurrences\n",
|
859 |
+
"merge 734/744: (100, 307) -> 989 (b'dis') had 148 occurrences\n",
|
860 |
+
"merge 735/744: (99, 280) -> 990 (b'cre') had 148 occurrences\n",
|
861 |
+
"merge 736/744: (32, 280) -> 991 (b' re') had 148 occurrences\n",
|
862 |
+
"merge 737/744: (821, 261) -> 992 (b'left ') had 147 occurrences\n",
|
863 |
+
"merge 738/744: (97, 283) -> 993 (b'a h') had 147 occurrences\n",
|
864 |
+
"merge 739/744: (374, 111) -> 994 (b'who') had 146 occurrences\n",
|
865 |
+
"merge 740/744: (752, 297) -> 995 (b'treid') had 145 occurrences\n",
|
866 |
+
"merge 741/744: (589, 282) -> 996 (b'door') had 145 occurrences\n",
|
867 |
+
"merge 742/744: (279, 276) -> 997 (b'ing s') had 145 occurrences\n",
|
868 |
+
"merge 743/744: (100, 100) -> 998 (b'dd') had 145 occurrences\n",
|
869 |
+
"merge 744/744: (32, 285) -> 999 (b' is ') had 145 occurrences\n",
|
870 |
+
"Text Length: 203588 | Time to train: 52.854437828063965\n",
|
871 |
+
"[431, 268, 537, 279, 322, 433, 275, 108, 269, 103, 257, 754, 116, 403, 330, 415, 365, 286, 311, 366, 261, 116, 402, 533, 593, 528, 99, 914, 900, 351, 908, 321, 109, 953, 268, 331, 416, 264, 100, 461, 311, 108, 329, 104, 681, 493, 328, 270, 369, 342, 925, 107, 784, 777, 898, 493, 263, 852, 63, 543, 780, 857, 491, 947, 699, 417, 420, 584, 262, 118, 301, 469, 979, 115, 109, 117, 103, 785, 263, 46]\n",
|
872 |
+
"LEN: 80\n"
|
873 |
+
]
|
874 |
+
}
|
875 |
+
],
|
876 |
+
"source": [
|
877 |
+
"tk2 = BasicTokenizer()\n",
|
878 |
+
"st = time.time()\n",
|
879 |
+
"tk2.train(text, 1000, verbose=True)\n",
|
880 |
+
"et = time.time()\n",
|
881 |
+
"\n",
|
882 |
+
"print(f'Text Length: {len(text.split())} | Time to train: {et-st}')\n",
|
883 |
+
"encoded2 = tk2.encode(sentence)\n",
|
884 |
+
"print(encoded2)\n",
|
885 |
+
"print('LEN:', len(encoded2))"
|
886 |
+
]
|
887 |
+
}
|
888 |
+
],
|
889 |
+
"metadata": {
|
890 |
+
"kernelspec": {
|
891 |
+
"display_name": "venv",
|
892 |
+
"language": "python",
|
893 |
+
"name": "python3"
|
894 |
+
},
|
895 |
+
"language_info": {
|
896 |
+
"codemirror_mode": {
|
897 |
+
"name": "ipython",
|
898 |
+
"version": 3
|
899 |
+
},
|
900 |
+
"file_extension": ".py",
|
901 |
+
"mimetype": "text/x-python",
|
902 |
+
"name": "python",
|
903 |
+
"nbconvert_exporter": "python",
|
904 |
+
"pygments_lexer": "ipython3",
|
905 |
+
"version": "3.12.4"
|
906 |
+
}
|
907 |
+
},
|
908 |
+
"nbformat": 4,
|
909 |
+
"nbformat_minor": 2
|
910 |
+
}
|
xsbpe/__init__.py
ADDED
File without changes
|
xsbpe/__pycache__/__init__.cpython-312.pyc
ADDED
Binary file (134 Bytes). View file
|
|
xsbpe/__pycache__/base.cpython-312.pyc
ADDED
Binary file (3.45 kB). View file
|
|
xsbpe/__pycache__/basic.cpython-312.pyc
ADDED
Binary file (3.13 kB). View file
|
|
xsbpe/base.py
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import unicodedata
|
2 |
+
from collections import defaultdict
|
3 |
+
from itertools import pairwise
|
4 |
+
|
5 |
+
def get_adjacent_pair_counts(ids) -> defaultdict:
|
6 |
+
counts = defaultdict(int)
|
7 |
+
for pair in pairwise(ids):
|
8 |
+
counts[pair] += 1
|
9 |
+
return counts
|
10 |
+
|
11 |
+
def merge_pairs(ids, pair, idx):
|
12 |
+
newids = []
|
13 |
+
i = 0
|
14 |
+
n = len(ids)
|
15 |
+
while i < n:
|
16 |
+
if i < n - 1 and ids[i] == pair[0] and ids[i+1] == pair[1]:
|
17 |
+
newids.append(idx)
|
18 |
+
i += 2
|
19 |
+
else:
|
20 |
+
newids.append(ids[i])
|
21 |
+
i += 1
|
22 |
+
return newids
|
23 |
+
|
24 |
+
def replace_control_characters(s: str) -> str:
|
25 |
+
chars = []
|
26 |
+
for ch in s:
|
27 |
+
if unicodedata.category(ch)[0] != 'C':
|
28 |
+
chars.append(ch)
|
29 |
+
else:
|
30 |
+
chars.append(f'\\u{ord(ch):04x}') # escape
|
31 |
+
return ''.join(chars)
|
32 |
+
|
33 |
+
def render_token(t: bytes) -> str:
|
34 |
+
s = t.decode('utf-8', errors='replace')
|
35 |
+
s = replace_control_characters(s)
|
36 |
+
return s
|
37 |
+
|
38 |
+
|
39 |
+
class Tokenizer:
|
40 |
+
"""Base class for Tokenizers"""
|
41 |
+
|
42 |
+
def __init__(self):
|
43 |
+
self.merges = {}
|
44 |
+
self.pattern = ''
|
45 |
+
self.special_tokens = {}
|
46 |
+
self.vocab = self._build_vocab()
|
47 |
+
|
48 |
+
def train(self, text, vocab_size, verbose=False):
|
49 |
+
raise NotImplementedError
|
50 |
+
|
51 |
+
def encode(self, text):
|
52 |
+
raise NotImplementedError
|
53 |
+
|
54 |
+
def decode(self, ids):
|
55 |
+
raise NotImplementedError
|
56 |
+
|
57 |
+
def _build_vocab(self):
|
58 |
+
vocab = {idx: bytes([idx]) for idx in range(256)}
|
59 |
+
for (p0, p1), idx in self.merges.items():
|
60 |
+
vocab[idx] = vocab[p0] + vocab[p1]
|
61 |
+
for special, idx in self.special_tokens.items():
|
62 |
+
vocab[idx] = special.encode('utf-8')
|
63 |
+
return vocab
|
xsbpe/basic.py
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from xsbpe.base import Tokenizer, get_adjacent_pair_counts, merge_pairs
|
2 |
+
|
3 |
+
|
4 |
+
class BasicTokenizer(Tokenizer):
|
5 |
+
def __init__(self):
|
6 |
+
super().__init__()
|
7 |
+
|
8 |
+
def train(self, text, vocab_size, verbose=False):
|
9 |
+
assert vocab_size >= 256
|
10 |
+
num_merges = vocab_size - 256
|
11 |
+
|
12 |
+
text_bytes = text.encode('utf-8')
|
13 |
+
ids = list(text_bytes)
|
14 |
+
|
15 |
+
merges = {}
|
16 |
+
vocab = {idx: bytes([idx]) for idx in range(256)}
|
17 |
+
for i in range(num_merges):
|
18 |
+
stats = get_adjacent_pair_counts(ids)
|
19 |
+
pair = max(stats, key=stats.get)
|
20 |
+
idx = 256 + i
|
21 |
+
ids = merge_pairs(ids, pair, idx)
|
22 |
+
|
23 |
+
merges[pair] = idx
|
24 |
+
vocab[idx] = vocab[pair[0]] + vocab[pair[1]]
|
25 |
+
|
26 |
+
if verbose:
|
27 |
+
print(f"merge {i+1}/{num_merges}: {pair} -> {idx} ({vocab[idx]}) had {stats[pair]} occurrences")
|
28 |
+
|
29 |
+
self.merges = merges
|
30 |
+
self.vocab = vocab
|
31 |
+
|
32 |
+
def decode(self, ids):
|
33 |
+
text_bytes = b''.join(self.vocab[idx] for idx in ids)
|
34 |
+
text = text_bytes.decode('utf-8', errors='replace')
|
35 |
+
return text
|
36 |
+
|
37 |
+
def encode(self, text):
|
38 |
+
text_bytes = text.encode('utf-8')
|
39 |
+
ids = list(text_bytes)
|
40 |
+
while len(ids) >= 2:
|
41 |
+
stats = get_adjacent_pair_counts(ids)
|
42 |
+
pair = min(stats, key=lambda p: self.merges.get(p, float('inf')))
|
43 |
+
if pair not in self.merges:
|
44 |
+
break
|
45 |
+
idx = self.merges[pair]
|
46 |
+
ids = merge_pairs(ids, pair, idx)
|
47 |
+
return ids
|