-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc_id and source_doc_id params in doc_chunk (#598)
* doc_id and source_doc_id params in doc_chunk This expands the doc_chunk parameters with the possibility to tune the propagation of the doc_id from the input tables to the results. Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * align document_id naming Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> --------- Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
- Loading branch information
1 parent
5d56398
commit 1b8db48
Showing
8 changed files
with
193 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 53 additions & 47 deletions
100
transforms/language/doc_chunk/python/test-data/expected/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,54 @@ | ||
{ | ||
"pipeline": "pipeline_id", | ||
"job details": { | ||
"job category": "preprocessing", | ||
"job name": "doc_chunk", | ||
"job type": "pure python", | ||
"job id": "job_id", | ||
"start_time": "2024-07-31 21:18:32", | ||
"end_time": "2024-07-31 21:18:32", | ||
"status": "success" | ||
}, | ||
"code": { | ||
"github": "github", | ||
"commit_hash": "12345", | ||
"path": "path" | ||
}, | ||
"job_input_params": { | ||
"chunking_type": "dl_json", | ||
"content_column_name": "contents", | ||
"output_chunk_column_name": "contents", | ||
"output_jsonpath_column_name": "doc_jsonpath", | ||
"output_pageno_column_name": "page_number", | ||
"output_bbox_column_name": "bbox", | ||
"checkpointing": false, | ||
"max_files": -1, | ||
"random_samples": -1, | ||
"files_to_use": [".parquet"] | ||
}, | ||
"job_output_stats": { | ||
"source_files": 1, | ||
"source_size": 50276, | ||
"result_files": 1, | ||
"result_size": 27400, | ||
"processing_time": 0.051286935806274414, | ||
"nfiles": 1, | ||
"nrows": 88, | ||
"source_doc_count": 1, | ||
"result_doc_count": 88 | ||
}, | ||
"source": { | ||
"name": "/Users/dol/scratch/dpk-dev/data-prep-kit/transforms/language/doc_chunk/python/test-data/input", | ||
"type": "path" | ||
}, | ||
"target": { | ||
"name": "/Users/dol/scratch/dpk-dev/data-prep-kit/transforms/language/doc_chunk/python/output", | ||
"type": "path" | ||
} | ||
} | ||
"pipeline": "pipeline_id", | ||
"job details": { | ||
"job category": "preprocessing", | ||
"job name": "doc_chunk", | ||
"job type": "pure python", | ||
"job id": "job_id", | ||
"start_time": "2024-09-18 16:05:04", | ||
"end_time": "2024-09-18 16:05:04", | ||
"status": "success" | ||
}, | ||
"code": { | ||
"github": "github", | ||
"commit_hash": "12345", | ||
"path": "path" | ||
}, | ||
"job_input_params": { | ||
"chunking_type": "dl_json", | ||
"content_column_name": "contents", | ||
"doc_id_column_name": "document_id", | ||
"dl_min_chunk_len": null, | ||
"output_chunk_column_name": "contents", | ||
"output_source_doc_id_column_name": "source_document_id", | ||
"output_jsonpath_column_name": "doc_jsonpath", | ||
"output_pageno_column_name": "page_number", | ||
"output_bbox_column_name": "bbox", | ||
"checkpointing": false, | ||
"max_files": -1, | ||
"random_samples": -1, | ||
"files_to_use": [ | ||
".parquet" | ||
], | ||
"num_processors": 0 | ||
}, | ||
"job_output_stats": { | ||
"source_files": 1, | ||
"source_size": 50276, | ||
"result_files": 1, | ||
"result_size": 31246, | ||
"processing_time": 0.071, | ||
"nfiles": 1, | ||
"nrows": 88, | ||
"source_doc_count": 1, | ||
"result_doc_count": 88 | ||
}, | ||
"source": { | ||
"name": "/Users/dol/codes/data-prep-kit/transforms/language/doc_chunk/python/test-data/input", | ||
"type": "path" | ||
}, | ||
"target": { | ||
"name": "/Users/dol/codes/data-prep-kit/transforms/language/doc_chunk/python/output", | ||
"type": "path" | ||
} | ||
} |
Binary file modified
BIN
+3.76 KB
(110%)
transforms/language/doc_chunk/python/test-data/expected/test1.parquet
Binary file not shown.
Binary file modified
BIN
+1.36 KB
(110%)
transforms/language/doc_chunk/python/test-data/expected_md/2206.01062.parquet
Binary file not shown.
98 changes: 53 additions & 45 deletions
98
transforms/language/doc_chunk/python/test-data/expected_md/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,54 @@ | ||
{ | ||
"pipeline": "pipeline_id", | ||
"job details": { | ||
"job category": "preprocessing", | ||
"job name": "doc_chunk", | ||
"job type": "pure python", | ||
"job id": "job_id", | ||
"start_time": "2024-07-30 18:27:44", | ||
"end_time": "2024-07-30 18:27:44", | ||
"status": "success" | ||
}, | ||
"code": { | ||
"github": "github", | ||
"commit_hash": "12345", | ||
"path": "path" | ||
}, | ||
"job_input_params": { | ||
"chunking_type": "li_markdown", | ||
"content_column_name": "contents", | ||
"output_chunk_column_name": "contents", | ||
"output_jsonpath_column_name": "doc_jsonpath", | ||
"checkpointing": false, | ||
"max_files": -1, | ||
"random_samples": -1, | ||
"files_to_use": [".parquet"] | ||
}, | ||
"job_output_stats": { | ||
"source_files": 1, | ||
"source_size": 23756, | ||
"result_files": 1, | ||
"result_size": 23781, | ||
"processing_time": 0.014858007431030273, | ||
"nfiles": 1, | ||
"nrows": 18, | ||
"source_doc_count": 1, | ||
"result_doc_count": 18 | ||
}, | ||
"source": { | ||
"name": "/Users/dol/scratch/dpk-dev/data-prep-kit-outer/transforms/language/doc_chunk/python/test-data/input_md", | ||
"type": "path" | ||
}, | ||
"target": { | ||
"name": "/Users/dol/scratch/dpk-dev/data-prep-kit-outer/transforms/language/doc_chunk/python/output", | ||
"type": "path" | ||
} | ||
} | ||
"pipeline": "pipeline_id", | ||
"job details": { | ||
"job category": "preprocessing", | ||
"job name": "doc_chunk", | ||
"job type": "pure python", | ||
"job id": "job_id", | ||
"start_time": "2024-09-18 16:04:28", | ||
"end_time": "2024-09-18 16:04:29", | ||
"status": "success" | ||
}, | ||
"code": { | ||
"github": "github", | ||
"commit_hash": "12345", | ||
"path": "path" | ||
}, | ||
"job_input_params": { | ||
"chunking_type": "li_markdown", | ||
"content_column_name": "contents", | ||
"doc_id_column_name": "document_id", | ||
"dl_min_chunk_len": null, | ||
"output_chunk_column_name": "contents", | ||
"output_source_doc_id_column_name": "source_document_id", | ||
"output_jsonpath_column_name": "doc_jsonpath", | ||
"output_pageno_column_name": "page_number", | ||
"output_bbox_column_name": "bbox", | ||
"checkpointing": false, | ||
"max_files": -1, | ||
"random_samples": -1, | ||
"files_to_use": [ | ||
".parquet" | ||
], | ||
"num_processors": 0 | ||
}, | ||
"job_output_stats": { | ||
"source_files": 1, | ||
"source_size": 23756, | ||
"result_files": 1, | ||
"result_size": 25170, | ||
"processing_time": 1.277, | ||
"nfiles": 1, | ||
"nrows": 18, | ||
"source_doc_count": 1, | ||
"result_doc_count": 18 | ||
}, | ||
"source": { | ||
"name": "/Users/dol/codes/data-prep-kit/transforms/language/doc_chunk/python/test-data/input_md", | ||
"type": "path" | ||
}, | ||
"target": { | ||
"name": "/Users/dol/codes/data-prep-kit/transforms/language/doc_chunk/python/output", | ||
"type": "path" | ||
} | ||
} |
Oops, something went wrong.