Replies: 1 comment
|
What you’re asking for (converting specific PDF sheets into Excel/JSON using nv-ingest) is definitely something nv-ingest can be used for, but the request as written has a couple of practical constraints. 1. Important limitationnv-ingest is not a “run a PDF and directly return an Excel file” tool out of the box. Instead, it:
So the workflow is: 2. About “sheet 21 and sheet 22”This is the first ambiguity: In most PDFs:
So nv-ingest will interpret them as:
3. Correct way to do this with nv-ingestTo achieve what you want, the pipeline should look like: Step 1: Extract tables onlyIngestor(...).files("X7RDielectric.pdf")
.extract(
extract_text=False,
extract_tables=True,
extract_images=False,
)Step 2: Get structured JSON outputnv-ingest typically outputs something like: {
"tables": [
{
"page": 21,
"cells": [...],
"rows": [...]
},
{
"page": 22,
"cells": [...]
}
]
}Step 3: Convert to Excel (external step)nv-ingest does NOT directly generate Excel. You would do: import pandas as pd
df1 = pd.DataFrame(table_21)
df2 = pd.DataFrame(table_22)
with pd.ExcelWriter("output.xlsx") as writer:
df1.to_excel(writer, sheet_name="page21")
df2.to_excel(writer, sheet_name="page22")4. Why the original request is trickyThe user asked:
Issues: ❗ nv-ingest does not:
❗ You still need:
5. Recommended nv-ingest configurationBest practice for this use case: ingestor = (
Ingestor(...)
.files("X7RDielectric.pdf")
.extract(
extract_text=False,
extract_tables=True,
extract_images=False,
text_depth="page"
)
)Then filter results: results = ingestor.ingest()
tables = [r for r in results if r["page"] in [21, 22]]6. If tables are not detected correctlyThis is common in PDFs like dielectric/material spec sheets. Then you need: Option Aextract_method="nemoretriever_parse"Option BUse OCR fallback pipeline (if scanned or semi-scanned tables) 7. Bottom line
If you wantI can show a fully working end-to-end script that:
If this answer helped or pointed you in the right direction, I'd appreciate it if you could mark it as the accepted answer so it's easier for others with the same issue to find. Also, if you found my contribution useful, I'd appreciate it if you could check out my GitHub profile, follow me, and star any repositories you find interesting. GitHub: https://github.com/Advait251206 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I would like to evaluate nv-ingest. I have not setup using it yet. Can someone kindly convert the data in sheet 21 and sheet 22 of the attached pdf into excel file or json file using nvidia nv-ingest and provide?
X7RDielectric.pdf
All reactions