Skip to content

A fast, helpful, and open-source document parser

feat: set fromOCR and confidence on OCR text items in parser

larsc6ea3dcf0513
diff --git a/src/core/parser.ts b/src/core/parser.ts
index 8b0cca6..b5f72cb 100644
--- a/src/core/parser.ts
+++ b/src/core/parser.ts
@@ -422,6 +422,8 @@ export class LiteParse {
h: (r.bbox[3] - r.bbox[1]) * scaleFactor,
fontName: "OCR",
fontSize: (r.bbox[3] - r.bbox[1]) * scaleFactor,
+ fromOCR: true,
+ confidence: Math.round(r.confidence * 1000) / 1000,
};
})
.filter((item) => item.str.length > 0); // Skip items that became empty after cleaning