a few more
Browse files- .gitignore +1 -0
- cyberpunk.parquet +2 -2
- epub-processing.ipynb +35 -9
.gitignore
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
source
|
2 |
local
|
|
|
|
1 |
source
|
2 |
local
|
3 |
+
bad
|
cyberpunk.parquet
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5e2ece676a87abd0bdda7109f1e109abad8d76e89ad0b4fc48a1ed00ecb1c1ae
|
3 |
+
size 11751919
|
epub-processing.ipynb
CHANGED
@@ -118,14 +118,15 @@
|
|
118 |
},
|
119 |
{
|
120 |
"cell_type": "code",
|
121 |
-
"execution_count":
|
122 |
"metadata": {},
|
123 |
"outputs": [
|
124 |
{
|
125 |
"name": "stdout",
|
126 |
"output_type": "stream",
|
127 |
"text": [
|
128 |
-
"Processing
|
|
|
129 |
]
|
130 |
},
|
131 |
{
|
@@ -140,20 +141,32 @@
|
|
140 |
"name": "stdout",
|
141 |
"output_type": "stream",
|
142 |
"text": [
|
|
|
|
|
|
|
|
|
143 |
"Clipping (1, 2)\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
"Processing neuromancer\n",
|
145 |
"Clipping (1, 49)\n",
|
146 |
-
"Processing
|
|
|
|
|
147 |
"Processing snowcrash\n",
|
148 |
"Clipping (1, 80)\n",
|
149 |
"Clipping (4590, 4636)\n",
|
150 |
-
"Processing
|
151 |
-
"Processing monalisa\n",
|
152 |
-
"Clipping (2969, 2984)\n",
|
153 |
-
"Processing theconfusion\n",
|
154 |
"Processing systemofworld\n",
|
155 |
"Clipping (261, 331)\n",
|
156 |
-
"
|
|
|
|
|
157 |
]
|
158 |
}
|
159 |
],
|
@@ -172,10 +185,23 @@
|
|
172 |
" 'monalisa' : {'clip': [(2969, 2984)], 'drop': [6]},\n",
|
173 |
" 'theconfusion' : {},\n",
|
174 |
" 'systemofworld' : {'clip': [(261, 331)]},\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
"}\n",
|
176 |
"\n",
|
177 |
"all_books = pd.DataFrame([], columns=['book_name', 'paragraph_ix', 'chapter_ix', 'chapter_title', 'text', 'word_count', 'cumsum_word_count'])\n",
|
178 |
-
"for book in glob('source/*.epub'):\n",
|
179 |
" name = os.path.splitext(os.path.basename(book))[0]\n",
|
180 |
" print(f\"Processing {name}\")\n",
|
181 |
" try_chapter = False\n",
|
|
|
118 |
},
|
119 |
{
|
120 |
"cell_type": "code",
|
121 |
+
"execution_count": 2,
|
122 |
"metadata": {},
|
123 |
"outputs": [
|
124 |
{
|
125 |
"name": "stdout",
|
126 |
"output_type": "stream",
|
127 |
"text": [
|
128 |
+
"Processing allsystemsred\n",
|
129 |
+
"Processing alteredcarbon\n"
|
130 |
]
|
131 |
},
|
132 |
{
|
|
|
141 |
"name": "stdout",
|
142 |
"output_type": "stream",
|
143 |
"text": [
|
144 |
+
"Processing artificialcondition\n",
|
145 |
+
"Processing burningchrome\n",
|
146 |
+
"Processing canticleforleibowitz\n",
|
147 |
+
"Processing cryptonomicon\n",
|
148 |
"Clipping (1, 2)\n",
|
149 |
+
"Processing exitstrategy\n",
|
150 |
+
"Processing forwearemany\n",
|
151 |
+
"Processing fugutuvetelemetry\n",
|
152 |
+
"Processing gnomon\n",
|
153 |
+
"Processing monalisa\n",
|
154 |
+
"Clipping (2969, 2984)\n",
|
155 |
+
"Processing networkeffect\n",
|
156 |
"Processing neuromancer\n",
|
157 |
"Clipping (1, 49)\n",
|
158 |
+
"Processing quicksilver\n",
|
159 |
+
"Processing readyplayerone\n",
|
160 |
+
"Processing rogueprotocol\n",
|
161 |
"Processing snowcrash\n",
|
162 |
"Clipping (1, 80)\n",
|
163 |
"Clipping (4590, 4636)\n",
|
164 |
+
"Processing systemcollapse\n",
|
|
|
|
|
|
|
165 |
"Processing systemofworld\n",
|
166 |
"Clipping (261, 331)\n",
|
167 |
+
"Processing theconfusion\n",
|
168 |
+
"Processing themoonisaharshmistress\n",
|
169 |
+
"Saved 72413 paragraphs to cyberpunk.parquet\n"
|
170 |
]
|
171 |
}
|
172 |
],
|
|
|
185 |
" 'monalisa' : {'clip': [(2969, 2984)], 'drop': [6]},\n",
|
186 |
" 'theconfusion' : {},\n",
|
187 |
" 'systemofworld' : {'clip': [(261, 331)]},\n",
|
188 |
+
" 'forwearemany': {'try_chapter': True, 'drop': [1,2,3,4,5,6, 84, 85, 86]},\n",
|
189 |
+
" 'allsystemsred': {'drop': [1,2,11,12,13,14,15]},\n",
|
190 |
+
" 'artificialcondition': {'try_chapter': True, 'drop': [1,2,12,13,14,15,16]},\n",
|
191 |
+
" 'rogueprotocol': {'drop': [1,2,10,11,12,13]},\n",
|
192 |
+
" 'exitstrategy': {'try_chapter': True, 'drop': [1,2,11,12,13,14,15]},\n",
|
193 |
+
" 'networkeffect': {'drop': [1,2,24,25,26,27,28]}, \n",
|
194 |
+
" 'fugitivetelemetry': {'drop': [1,2,11,12,13,14]},\n",
|
195 |
+
" 'systemcollapse': {'drop': [1,2,16,17,18,19]},\n",
|
196 |
+
" 'alteredcarbon': {'drop': [1,2,3,4,5]},\n",
|
197 |
+
" 'readyplayerone': {'drop': [1,2,3,4, 48, 49]},\n",
|
198 |
+
" 'gnomon': {'drop': [1,2,3,4,5,34,35,36]},\n",
|
199 |
+
" 'themoonisaharshmistress': {'drop': [1,2,3,4]},\n",
|
200 |
+
" 'cantileforleibowitz': {'drop': [1,2,3,4,37,38]},\n",
|
201 |
"}\n",
|
202 |
"\n",
|
203 |
"all_books = pd.DataFrame([], columns=['book_name', 'paragraph_ix', 'chapter_ix', 'chapter_title', 'text', 'word_count', 'cumsum_word_count'])\n",
|
204 |
+
"for book in sorted(glob('source/*.epub')):\n",
|
205 |
" name = os.path.splitext(os.path.basename(book))[0]\n",
|
206 |
" print(f\"Processing {name}\")\n",
|
207 |
" try_chapter = False\n",
|