Skip to content

Commit cc8ef45

Browse files
committed
Minor adjustments for beter usability
Signed-off-by: Fabiano Franz <[email protected]> Signed-off-by: Fabiano Franz <[email protected]>
1 parent bf6a8c4 commit cc8ef45

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

notebooks/instructlab-knowledge/level1.ipynb

+31-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "af99f876-0ffd-4079-aeb7-4cead05daaf4",
6+
"metadata": {},
7+
"source": [
8+
"# 🐶 Data Pre-Processing\n",
9+
"\n",
10+
"This notebook goes through each of the stages of data pre-processing. Once a SDG seed dataset is created, a user can run through an SDG notebook and generate samples.\n",
11+
"\n",
12+
"1. [Document Conversion](#Document-Conversion)\n",
13+
"1. [Chunking](#Chunking)\n",
14+
"1. [Authoring](#Authoring)\n",
15+
"1. [Create Seed Dataset](#Create-Seed-Dataset-for-SDG)\n",
16+
"\n",
17+
"***"
18+
]
19+
},
320
{
421
"cell_type": "code",
522
"execution_count": 1,
@@ -58,7 +75,7 @@
5875
"id": "344b7ac5-fc2a-40a8-8e1f-e8dd8b1153e7",
5976
"metadata": {},
6077
"source": [
61-
"# Document Conversion\n",
78+
"## Document Conversion\n",
6279
"\n",
6380
"This notebook uses [Docling](https://github.com/docling-project/docling) to convert any type of document into a Docling Document. A Docling Document is the representation of the document after conversion that can be exported as JSON. The JSON output of this notebook can then be used in others such as one that uses Docling's chunking methods."
6481
]
@@ -186,7 +203,7 @@
186203
"id": "2482060c-a49f-4345-aa47-d54301939387",
187204
"metadata": {},
188205
"source": [
189-
"## Initialize the Chunker\n",
206+
"### Initialize the Chunker\n",
190207
"\n",
191208
"Docling provides two chunkers, the `HierarchicalChunker` and the `HybridChunker`.\n",
192209
"The `HierarchicalChunker` creates chunks based on the hierarchy in the Docling document\n",
@@ -213,7 +230,7 @@
213230
"id": "54ce1d6f-b8d3-470c-b3c9-675911f0ee92",
214231
"metadata": {},
215232
"source": [
216-
"## Load and chunk the converted docling document\n",
233+
"### Load and chunk the converted docling document\n",
217234
"\n",
218235
"Next lets convert the document we want to chunk up into a Docling Document."
219236
]
@@ -264,7 +281,7 @@
264281
"id": "0fb38545-eb84-4923-8fc4-d10ed08eab26",
265282
"metadata": {},
266283
"source": [
267-
"## View the Chunks\n",
284+
"### View the Chunks\n",
268285
"\n",
269286
"To view the chunks, run through the following cell. As you can see the document is broken into small pieces with metadata about the chunk based on the document's format"
270287
]
@@ -295,7 +312,7 @@
295312
"id": "42c4160f-7508-4c72-b28d-b56aa4975b26",
296313
"metadata": {},
297314
"source": [
298-
"## Save the chunks to a text file for each chunk\n",
315+
"### Save the chunks to a text file for each chunk\n",
299316
"\n",
300317
"Each chunk is saved to an individual text file in the format: `{docling-json-file-name}-{chunk #}.txt`. Having chunking in this format is important as an input to create-sdg-seed-data notebook."
301318
]
@@ -318,7 +335,7 @@
318335
"id": "a510f8c7-8cd3-4867-8742-9f4f9cda9e9f",
319336
"metadata": {},
320337
"source": [
321-
"# Authoring"
338+
"## Authoring"
322339
]
323340
},
324341
{
@@ -383,7 +400,7 @@
383400
"id": "d65ec755-e3de-40ab-bf3a-23ebb29a705d",
384401
"metadata": {},
385402
"source": [
386-
"## Initialize QA generator, supplying details for which model to use\n",
403+
"### Initialize QA generator, supplying details for which model to use\n",
387404
"\n",
388405
"GenerateOptions controls which model is used for QA generation by setting generate_options.provider below. Three options are available:\n",
389406
"\n",
@@ -418,7 +435,7 @@
418435
"id": "919199c0-3747-409a-85ab-0155ef3ebe9d",
419436
"metadata": {},
420437
"source": [
421-
"## Configure subset selection"
438+
"### Configure subset selection"
422439
]
423440
},
424441
{
@@ -436,7 +453,7 @@
436453
"id": "d2421d07-3e6c-4355-95f4-da8e157557c7",
437454
"metadata": {},
438455
"source": [
439-
"## Run QA generation on selected chunks"
456+
"### Run QA generation on selected chunks"
440457
]
441458
},
442459
{
@@ -499,7 +516,7 @@
499516
"id": "ea64b8f0-dd6c-4776-8646-9731433f909b",
500517
"metadata": {},
501518
"source": [
502-
"## Read generated QAs and restructure"
519+
"### Read generated QAs and restructure"
503520
]
504521
},
505522
{
@@ -543,7 +560,7 @@
543560
"id": "9b6d6c26-f4d5-420d-ae78-ac28cf39efd3",
544561
"metadata": {},
545562
"source": [
546-
"## Define metadata for qna.yaml"
563+
"### Define metadata for qna.yaml"
547564
]
548565
},
549566
{
@@ -562,7 +579,7 @@
562579
"id": "dafa8927-e56c-448b-b88b-f8d854c25d4d",
563580
"metadata": {},
564581
"source": [
565-
"## Output qna.yaml"
582+
"### Output qna.yaml"
566583
]
567584
},
568585
{
@@ -626,7 +643,7 @@
626643
"id": "ed9ea149-844b-4330-90ec-d0ca7ab12b90",
627644
"metadata": {},
628645
"source": [
629-
"## View generated qna.yaml"
646+
"### View generated qna.yaml"
630647
]
631648
},
632649
{
@@ -813,7 +830,7 @@
813830
"id": "1f101076-a50f-49ea-a83b-46eaa8b39cc4",
814831
"metadata": {},
815832
"source": [
816-
"# Create Seed Dataset for SDG\n",
833+
"## Create Seed Dataset for SDG\n",
817834
"\n",
818835
"This notebook combines the contents from the qna.yaml and the chunks from the source document to create a seed dataset for the synthetic data generation process.\n",
819836
"\n",

0 commit comments

Comments
 (0)