visual-parser 2.2.1__tar.gz → 2.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {visual_parser-2.2.1/visual_parser.egg-info → visual_parser-2.2.2}/PKG-INFO +9 -5
  2. {visual_parser-2.2.1 → visual_parser-2.2.2}/README.md +8 -4
  3. {visual_parser-2.2.1 → visual_parser-2.2.2}/pyproject.toml +1 -1
  4. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_config.py +14 -0
  5. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/__init__.py +1 -1
  6. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/cli.py +10 -0
  7. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/cli_main.py +10 -0
  8. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/config.py +9 -0
  9. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/pipeline.py +1 -0
  10. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/text_extractor.py +5 -1
  11. {visual_parser-2.2.1 → visual_parser-2.2.2/visual_parser.egg-info}/PKG-INFO +9 -5
  12. {visual_parser-2.2.1 → visual_parser-2.2.2}/LICENSE +0 -0
  13. {visual_parser-2.2.1 → visual_parser-2.2.2}/setup.cfg +0 -0
  14. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_cli_parity.py +0 -0
  15. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_figure_describer.py +0 -0
  16. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_image_describer.py +0 -0
  17. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_image_tracker.py +0 -0
  18. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_integration.py +0 -0
  19. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_jsonl_writer.py +0 -0
  20. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_kb_redo.py +0 -0
  21. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_metadata_extractor.py +0 -0
  22. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_model_catalog.py +0 -0
  23. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_ollama_local.py +0 -0
  24. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_pdf_tracker.py +0 -0
  25. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_pipeline.py +0 -0
  26. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_prompts.py +0 -0
  27. {visual_parser-2.2.1 → visual_parser-2.2.2}/tests/test_vision_llm.py +0 -0
  28. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/__main__.py +0 -0
  29. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/figure_describer.py +0 -0
  30. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/image_describer.py +0 -0
  31. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/image_tracker.py +0 -0
  32. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/jsonl_writer.py +0 -0
  33. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/kb_redo.py +0 -0
  34. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/metadata_extractor.py +0 -0
  35. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/model_catalog.py +0 -0
  36. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/nougat_engine.py +0 -0
  37. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/ollama_local.py +0 -0
  38. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/openai_gateway.py +0 -0
  39. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/pdf_tracker.py +0 -0
  40. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/prompts.py +0 -0
  41. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser/vision_llm.py +0 -0
  42. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser.egg-info/SOURCES.txt +0 -0
  43. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser.egg-info/dependency_links.txt +0 -0
  44. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser.egg-info/entry_points.txt +0 -0
  45. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser.egg-info/requires.txt +0 -0
  46. {visual_parser-2.2.1 → visual_parser-2.2.2}/visual_parser.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: visual-parser
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Standalone Visual-RAG PDF Parser - text extraction and Vision-LLM figure descriptions to JSONL
5
5
  Author: Zavier N. Ndum
6
6
  Author-email: zavier.ndum@tamu.edu
@@ -50,7 +50,7 @@ Dynamic: license-file
50
50
  ![LangChain](https://img.shields.io/badge/LangChain-0.1%2B-1C3C3C.svg)
51
51
  ![CUDA](https://img.shields.io/badge/CUDA-optional-76B900.svg)
52
52
 
53
- `visual-parser` converts PDFs into a multi-modal JSONL knowledge base (text chunks, figure descriptions, metadata). It was extracted from [RADIANT-LLM](https://github.com/SmartLabNuclear/RADIANT_LLM) as a standalone PDF-ingestion tool, independent of any chatbot.
53
+ `visual-parser` converts PDFs (and standalone images alongside them) into a multi-modal JSONL knowledge base (text chunks, figure descriptions, standalone image descriptions, metadata). It was extracted from [RADIANT-LLM](https://github.com/SmartLabNuclear/RADIANT_LLM) as a standalone PDF-ingestion tool, independent of any chatbot.
54
54
 
55
55
  1) Run `visual-parser` on curated PDFs to generate JSONL KB files.
56
56
  2) Point any downstream RAG system at the generated KB — RADIANT-LLM, AutoSAM, and AutoFLUKA all consume the identical JSONL/registry format, so the same KB works with any of them without re-parsing.
@@ -72,10 +72,11 @@ Dynamic: license-file
72
72
 
73
73
  By default, the pipeline writes:
74
74
  - `01_chunks_kb.jsonl`: chunked text extracted from PDFs (Nougat by default).
75
- - `02_visuals_kb.jsonl`: figure/page visual descriptions (Vision LLM).
75
+ - `02_visuals_kb.jsonl`: figure/page visual descriptions (Vision LLM), one row per figure found in a PDF.
76
76
  - `03_metadata_kb.jsonl`: document metadata rows (title/author/etc.).
77
+ - `image_descriptions.jsonl`: one holistic description per **standalone image** file found alongside your PDFs in `--input-dir` (not a PDF's own figures) — auto-detected by extension, no separate flag needed; disable with `--skip-images`.
77
78
 
78
- Alongside the KB, the pipeline also writes two bookkeeping files: `04_processed_pdfs.txt` (tracks which PDFs have already been processed, so re-runs skip them unless `--rebuild`) and `05_pipeline.log` (run log at the verbosity set by `--log-level`, default `ERROR`).
79
+ Alongside the KB, the pipeline also writes bookkeeping files: `04_processed_pdfs.txt` / `parsed_images.txt` (track which PDFs/images have already been processed, so re-runs skip them unless `--rebuild` or `--redo NAME`) and `05_pipeline.log` (run log at the verbosity set by `--log-level`, default `ERROR`).
79
80
 
80
81
  ## API Keys (.env)
81
82
 
@@ -262,6 +263,7 @@ Text extraction:
262
263
  - `--nougat-model facebook/nougat-small`
263
264
  - `--chunk-size 500`
264
265
  - `--chunk-overlap 100`
266
+ - `--nougat-crop-margin` (off by default — lets Nougat autocrop whitespace margins instead of this package's long-standing uncropped behavior; autocropping can silently crop into real content on unusual page layouts)
265
267
 
266
268
  Vision LLM:
267
269
  - `--vision-provider gpt|gemini|ollama` (default: `gpt`) — see [Local Ollama vision provider](#local-ollama-vision-provider) for the `ollama` option
@@ -273,8 +275,10 @@ Vision LLM:
273
275
 
274
276
  Performance / misc:
275
277
  - `--max-workers 4`
276
- - `--rebuild` (reprocess everything; ignore `04_processed_pdfs.txt`)
278
+ - `--rebuild` (reprocess everything; ignore `04_processed_pdfs.txt`/`parsed_images.txt`)
279
+ - `--redo NAME` (surgically clear one PDF/image's rows from every KB file + both registries, so it's reprocessed fresh on the next run — a targeted alternative to `--rebuild`)
277
280
  - `--skip-text` (skip text extraction and resume only the vision steps; use after an interrupted run)
281
+ - `--skip-images` (don't process standalone images in `--input-dir`, PDFs only)
278
282
  - `--list-models` — print the live, currently-available vision models for whichever provider(s) you have a key configured for, then exit (no PDF processing). Reflects Portkey's catalog too when that's active.
279
283
  - `--version` / `-V`
280
284
  - `--log-level DEBUG|INFO|WARNING|ERROR` (default: `ERROR`)
@@ -5,7 +5,7 @@
5
5
  ![LangChain](https://img.shields.io/badge/LangChain-0.1%2B-1C3C3C.svg)
6
6
  ![CUDA](https://img.shields.io/badge/CUDA-optional-76B900.svg)
7
7
 
8
- `visual-parser` converts PDFs into a multi-modal JSONL knowledge base (text chunks, figure descriptions, metadata). It was extracted from [RADIANT-LLM](https://github.com/SmartLabNuclear/RADIANT_LLM) as a standalone PDF-ingestion tool, independent of any chatbot.
8
+ `visual-parser` converts PDFs (and standalone images alongside them) into a multi-modal JSONL knowledge base (text chunks, figure descriptions, standalone image descriptions, metadata). It was extracted from [RADIANT-LLM](https://github.com/SmartLabNuclear/RADIANT_LLM) as a standalone PDF-ingestion tool, independent of any chatbot.
9
9
 
10
10
  1) Run `visual-parser` on curated PDFs to generate JSONL KB files.
11
11
  2) Point any downstream RAG system at the generated KB — RADIANT-LLM, AutoSAM, and AutoFLUKA all consume the identical JSONL/registry format, so the same KB works with any of them without re-parsing.
@@ -27,10 +27,11 @@
27
27
 
28
28
  By default, the pipeline writes:
29
29
  - `01_chunks_kb.jsonl`: chunked text extracted from PDFs (Nougat by default).
30
- - `02_visuals_kb.jsonl`: figure/page visual descriptions (Vision LLM).
30
+ - `02_visuals_kb.jsonl`: figure/page visual descriptions (Vision LLM), one row per figure found in a PDF.
31
31
  - `03_metadata_kb.jsonl`: document metadata rows (title/author/etc.).
32
+ - `image_descriptions.jsonl`: one holistic description per **standalone image** file found alongside your PDFs in `--input-dir` (not a PDF's own figures) — auto-detected by extension, no separate flag needed; disable with `--skip-images`.
32
33
 
33
- Alongside the KB, the pipeline also writes two bookkeeping files: `04_processed_pdfs.txt` (tracks which PDFs have already been processed, so re-runs skip them unless `--rebuild`) and `05_pipeline.log` (run log at the verbosity set by `--log-level`, default `ERROR`).
34
+ Alongside the KB, the pipeline also writes bookkeeping files: `04_processed_pdfs.txt` / `parsed_images.txt` (track which PDFs/images have already been processed, so re-runs skip them unless `--rebuild` or `--redo NAME`) and `05_pipeline.log` (run log at the verbosity set by `--log-level`, default `ERROR`).
34
35
 
35
36
  ## API Keys (.env)
36
37
 
@@ -217,6 +218,7 @@ Text extraction:
217
218
  - `--nougat-model facebook/nougat-small`
218
219
  - `--chunk-size 500`
219
220
  - `--chunk-overlap 100`
221
+ - `--nougat-crop-margin` (off by default — lets Nougat autocrop whitespace margins instead of this package's long-standing uncropped behavior; autocropping can silently crop into real content on unusual page layouts)
220
222
 
221
223
  Vision LLM:
222
224
  - `--vision-provider gpt|gemini|ollama` (default: `gpt`) — see [Local Ollama vision provider](#local-ollama-vision-provider) for the `ollama` option
@@ -228,8 +230,10 @@ Vision LLM:
228
230
 
229
231
  Performance / misc:
230
232
  - `--max-workers 4`
231
- - `--rebuild` (reprocess everything; ignore `04_processed_pdfs.txt`)
233
+ - `--rebuild` (reprocess everything; ignore `04_processed_pdfs.txt`/`parsed_images.txt`)
234
+ - `--redo NAME` (surgically clear one PDF/image's rows from every KB file + both registries, so it's reprocessed fresh on the next run — a targeted alternative to `--rebuild`)
232
235
  - `--skip-text` (skip text extraction and resume only the vision steps; use after an interrupted run)
236
+ - `--skip-images` (don't process standalone images in `--input-dir`, PDFs only)
233
237
  - `--list-models` — print the live, currently-available vision models for whichever provider(s) you have a key configured for, then exit (no PDF processing). Reflects Portkey's catalog too when that's active.
234
238
  - `--version` / `-V`
235
239
  - `--log-level DEBUG|INFO|WARNING|ERROR` (default: `ERROR`)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "visual-parser"
7
- version = "2.2.1"
7
+ version = "2.2.2"
8
8
  description = "Standalone Visual-RAG PDF Parser - text extraction and Vision-LLM figure descriptions to JSONL"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -59,6 +59,20 @@ def test_from_env_reads_redo_names_comma_separated(monkeypatch):
59
59
  assert ParserConfig.from_env().redo_names == ["doc1.pdf", "diagram2.png", "doc3.pdf"]
60
60
 
61
61
 
62
+ def test_nougat_crop_margin_defaults_to_false():
63
+ assert ParserConfig(input_dir=".").nougat_crop_margin is False
64
+
65
+
66
+ def test_from_env_nougat_crop_margin_defaults_to_false(monkeypatch):
67
+ monkeypatch.delenv("VISUAL_PARSER_NOUGAT_CROP_MARGIN", raising=False)
68
+ assert ParserConfig.from_env().nougat_crop_margin is False
69
+
70
+
71
+ def test_from_env_reads_nougat_crop_margin(monkeypatch):
72
+ monkeypatch.setenv("VISUAL_PARSER_NOUGAT_CROP_MARGIN", "true")
73
+ assert ParserConfig.from_env().nougat_crop_margin is True
74
+
75
+
62
76
  def test_vision_context_pages_defaults_to_zero(monkeypatch):
63
77
  monkeypatch.delenv("VISUAL_PARSER_VISION_CONTEXT_PAGES", raising=False)
64
78
  assert ParserConfig.from_env().vision_context_pages == 0
@@ -17,4 +17,4 @@ from visual_parser.config import ParserConfig
17
17
  from visual_parser.pipeline import run_pipeline
18
18
 
19
19
  __all__ = ["ParserConfig", "run_pipeline"]
20
- __version__ = "2.2.1"
20
+ __version__ = "2.2.2"
@@ -111,6 +111,15 @@ def _build_arg_parser() -> argparse.ArgumentParser:
111
111
  metavar="N",
112
112
  help="Overlap characters between adjacent chunks (default: 100).",
113
113
  )
114
+ text_group.add_argument(
115
+ "--nougat-crop-margin",
116
+ action="store_true",
117
+ help=(
118
+ "Let Nougat autocrop whitespace margins (its own default). "
119
+ "Off by default -- autocropping can silently crop into real "
120
+ "content on unusual page layouts."
121
+ ),
122
+ )
114
123
 
115
124
  # ---- Vision LLM ---------------------------------------------------------
116
125
  vision_group = p.add_argument_group("Vision LLM (figure descriptions & metadata)")
@@ -366,6 +375,7 @@ def main(argv=None) -> int:
366
375
  nougat_model = args.nougat_model,
367
376
  chunk_size = args.chunk_size,
368
377
  chunk_overlap = args.chunk_overlap,
378
+ nougat_crop_margin = args.nougat_crop_margin,
369
379
  vision_provider = args.vision_provider,
370
380
  gpt_vision_model = args.vision_model if args.vision_provider == "gpt" else "gpt-5.4",
371
381
  gemini_vision_model = args.vision_model if args.vision_provider == "gemini" else "gemini-3.8-flash",
@@ -109,6 +109,15 @@ def _build_arg_parser() -> argparse.ArgumentParser:
109
109
  metavar="N",
110
110
  help="Overlap characters between adjacent chunks (default: 100).",
111
111
  )
112
+ text_group.add_argument(
113
+ "--nougat-crop-margin",
114
+ action="store_true",
115
+ help=(
116
+ "Let Nougat autocrop whitespace margins (its own default). "
117
+ "Off by default -- autocropping can silently crop into real "
118
+ "content on unusual page layouts."
119
+ ),
120
+ )
112
121
 
113
122
  vision_group = parser.add_argument_group("Vision LLM (figure descriptions & metadata)")
114
123
  vision_group.add_argument(
@@ -282,6 +291,7 @@ def main(argv=None) -> int:
282
291
  nougat_model=args.nougat_model,
283
292
  chunk_size=args.chunk_size,
284
293
  chunk_overlap=args.chunk_overlap,
294
+ nougat_crop_margin=args.nougat_crop_margin,
285
295
  vision_provider=args.vision_provider,
286
296
  gpt_vision_model=args.vision_model if args.vision_provider == "gpt" else "gpt-5.4",
287
297
  gemini_vision_model=(
@@ -79,6 +79,14 @@ class ParserConfig:
79
79
  nougat_model: str = "facebook/nougat-small"
80
80
  """HuggingFace model identifier for Nougat."""
81
81
 
82
+ nougat_crop_margin: bool = False
83
+ """
84
+ Passed through to Nougat's image processor as do_crop_margin. False
85
+ (default) matches this package's long-standing behavior -- autocropping
86
+ whitespace margins can silently crop into real content on unusual page
87
+ layouts. Set True to opt into Nougat's own autocrop behavior instead.
88
+ """
89
+
82
90
  chunk_size: int = 500
83
91
  """Target character count per text chunk."""
84
92
 
@@ -186,6 +194,7 @@ class ParserConfig:
186
194
  output_dir = os.getenv("VISUAL_PARSER_OUTPUT_DIR", ""),
187
195
  text_mode = os.getenv("VISUAL_PARSER_TEXT_MODE", "nougat"), # type: ignore[arg-type]
188
196
  nougat_model = os.getenv("VISUAL_PARSER_NOUGAT_MODEL", "facebook/nougat-small"),
197
+ nougat_crop_margin = os.getenv("VISUAL_PARSER_NOUGAT_CROP_MARGIN", "false").lower() == "true",
189
198
  chunk_size = int(os.getenv("VISUAL_PARSER_CHUNK_SIZE", "500")),
190
199
  chunk_overlap = int(os.getenv("VISUAL_PARSER_CHUNK_OVERLAP", "100")),
191
200
  vision_provider = os.getenv("VISUAL_PARSER_VISION_PROVIDER", "gpt"), # type: ignore[arg-type]
@@ -501,6 +501,7 @@ def run_pipeline(config: Optional[ParserConfig] = None) -> Dict:
501
501
  chunk_size = config.chunk_size,
502
502
  chunk_overlap = config.chunk_overlap,
503
503
  max_workers = config.max_workers,
504
+ nougat_crop_margin = config.nougat_crop_margin,
504
505
  )
505
506
  print(nougat_summary)
506
507
  except Exception as exc:
@@ -69,6 +69,7 @@ def nougat_extract_pdfs(
69
69
  chunk_size: int = 500,
70
70
  chunk_overlap: int = 100,
71
71
  max_workers: int = 4,
72
+ nougat_crop_margin: bool = False,
72
73
  ) -> Tuple[str, List[str], List[str], int]:
73
74
  """
74
75
  Extract text from each PDF in *only_process_these* using the Nougat model,
@@ -83,6 +84,9 @@ def nougat_extract_pdfs(
83
84
  chunk_size: Characters per chunk.
84
85
  chunk_overlap: Overlap between adjacent chunks.
85
86
  max_workers: Thread-pool size for parallel PDF processing.
87
+ nougat_crop_margin: Passed through to Nougat's image processor as
88
+ do_crop_margin (default False -- see
89
+ ParserConfig.nougat_crop_margin's docstring).
86
90
 
87
91
  Always resumes against the 04_processed_pdfs.txt registry -- callers
88
92
  that want a PDF reprocessed must first clear its existing chunks and
@@ -124,7 +128,7 @@ def nougat_extract_pdfs(
124
128
  pixel_values = processor(
125
129
  images=image,
126
130
  return_tensors="pt",
127
- do_crop_margin=False,
131
+ do_crop_margin=nougat_crop_margin,
128
132
  ).pixel_values.to(device)
129
133
  except TypeError:
130
134
  pixel_values = processor(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: visual-parser
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Standalone Visual-RAG PDF Parser - text extraction and Vision-LLM figure descriptions to JSONL
5
5
  Author: Zavier N. Ndum
6
6
  Author-email: zavier.ndum@tamu.edu
@@ -50,7 +50,7 @@ Dynamic: license-file
50
50
  ![LangChain](https://img.shields.io/badge/LangChain-0.1%2B-1C3C3C.svg)
51
51
  ![CUDA](https://img.shields.io/badge/CUDA-optional-76B900.svg)
52
52
 
53
- `visual-parser` converts PDFs into a multi-modal JSONL knowledge base (text chunks, figure descriptions, metadata). It was extracted from [RADIANT-LLM](https://github.com/SmartLabNuclear/RADIANT_LLM) as a standalone PDF-ingestion tool, independent of any chatbot.
53
+ `visual-parser` converts PDFs (and standalone images alongside them) into a multi-modal JSONL knowledge base (text chunks, figure descriptions, standalone image descriptions, metadata). It was extracted from [RADIANT-LLM](https://github.com/SmartLabNuclear/RADIANT_LLM) as a standalone PDF-ingestion tool, independent of any chatbot.
54
54
 
55
55
  1) Run `visual-parser` on curated PDFs to generate JSONL KB files.
56
56
  2) Point any downstream RAG system at the generated KB — RADIANT-LLM, AutoSAM, and AutoFLUKA all consume the identical JSONL/registry format, so the same KB works with any of them without re-parsing.
@@ -72,10 +72,11 @@ Dynamic: license-file
72
72
 
73
73
  By default, the pipeline writes:
74
74
  - `01_chunks_kb.jsonl`: chunked text extracted from PDFs (Nougat by default).
75
- - `02_visuals_kb.jsonl`: figure/page visual descriptions (Vision LLM).
75
+ - `02_visuals_kb.jsonl`: figure/page visual descriptions (Vision LLM), one row per figure found in a PDF.
76
76
  - `03_metadata_kb.jsonl`: document metadata rows (title/author/etc.).
77
+ - `image_descriptions.jsonl`: one holistic description per **standalone image** file found alongside your PDFs in `--input-dir` (not a PDF's own figures) — auto-detected by extension, no separate flag needed; disable with `--skip-images`.
77
78
 
78
- Alongside the KB, the pipeline also writes two bookkeeping files: `04_processed_pdfs.txt` (tracks which PDFs have already been processed, so re-runs skip them unless `--rebuild`) and `05_pipeline.log` (run log at the verbosity set by `--log-level`, default `ERROR`).
79
+ Alongside the KB, the pipeline also writes bookkeeping files: `04_processed_pdfs.txt` / `parsed_images.txt` (track which PDFs/images have already been processed, so re-runs skip them unless `--rebuild` or `--redo NAME`) and `05_pipeline.log` (run log at the verbosity set by `--log-level`, default `ERROR`).
79
80
 
80
81
  ## API Keys (.env)
81
82
 
@@ -262,6 +263,7 @@ Text extraction:
262
263
  - `--nougat-model facebook/nougat-small`
263
264
  - `--chunk-size 500`
264
265
  - `--chunk-overlap 100`
266
+ - `--nougat-crop-margin` (off by default — lets Nougat autocrop whitespace margins instead of this package's long-standing uncropped behavior; autocropping can silently crop into real content on unusual page layouts)
265
267
 
266
268
  Vision LLM:
267
269
  - `--vision-provider gpt|gemini|ollama` (default: `gpt`) — see [Local Ollama vision provider](#local-ollama-vision-provider) for the `ollama` option
@@ -273,8 +275,10 @@ Vision LLM:
273
275
 
274
276
  Performance / misc:
275
277
  - `--max-workers 4`
276
- - `--rebuild` (reprocess everything; ignore `04_processed_pdfs.txt`)
278
+ - `--rebuild` (reprocess everything; ignore `04_processed_pdfs.txt`/`parsed_images.txt`)
279
+ - `--redo NAME` (surgically clear one PDF/image's rows from every KB file + both registries, so it's reprocessed fresh on the next run — a targeted alternative to `--rebuild`)
277
280
  - `--skip-text` (skip text extraction and resume only the vision steps; use after an interrupted run)
281
+ - `--skip-images` (don't process standalone images in `--input-dir`, PDFs only)
278
282
  - `--list-models` — print the live, currently-available vision models for whichever provider(s) you have a key configured for, then exit (no PDF processing). Reflects Portkey's catalog too when that's active.
279
283
  - `--version` / `-V`
280
284
  - `--log-level DEBUG|INFO|WARNING|ERROR` (default: `ERROR`)
File without changes
File without changes