|
26 | 26 | "format": "password", |
27 | 27 | "description": "API key obtained from the Unstract developer portal (https://unstract-api-resource.developer.azure-api.net)" |
28 | 28 | }, |
29 | | - "processing_mode": { |
| 29 | + "mode": { |
30 | 30 | "type": "string", |
31 | | - "title": "Processing Mode", |
| 31 | + "title": "Mode", |
32 | 32 | "enum": [ |
33 | | - "text", |
34 | | - "ocr" |
| 33 | + "native_text", |
| 34 | + "low_cost", |
| 35 | + "high_quality", |
| 36 | + "form" |
35 | 37 | ], |
36 | | - "default": "text", |
37 | | - "description": "Text mode tries to extract text from PDF and falls to OCR if the PDF is a scanned image PDF. This should be your default selection. Use OCR mode if you want to force OCR to extract text. This could be useful if you are dealing with malformed PDFs." |
38 | | - }, |
39 | | - "force_text_processing": { |
40 | | - "type": "boolean", |
41 | | - "title": "Force Text Processing", |
42 | | - "default": false, |
43 | | - "description": "If checked, ensures that only text processing runs and there is no OCR involved. This differs from the default behaviour where we fall back to OCR processing in case of failures with text processing." |
| 38 | + "default": "form", |
| 39 | + "description": "Native text : Extracts text from PDF without OCR. This is very fast and cost effective. Use this mode if you are sure all your PDFs are native text pdfs (not scanned documents). Note that some scanned PDFs are \"searchable\" PDFs. Use the OCR modes for these PDFs as the quality of text in these documents are often poor. \n Low cost : Extracts text from scanned and native PDFs, images and office documents. This OCR mode cannot handle handwriting and low quality scanned pdfs and images. \n High quality : Extracts text from scanned and native PDFs, images and office documents. This OCR mode can handle handwriting and low quality scanned pdfs and images. \n Form: Extracts text from scanned and native PDFs, images and office documents. This OCR mode can handle handwriting and low quality scanned pdfs and images. Can also extract information about checkboxes and radio button" |
44 | 40 | }, |
45 | 41 | "output_mode": { |
46 | 42 | "type": "string", |
|
53 | 49 | "default": "line-printer", |
54 | 50 | "description": "The output format. Valid options are line-printer, dump-text and text. The line-printer mode tries to maintain the layout of the original text and works very well as inputs to LLMs. dump-text just dumps each page as paragraphs. text extracts text into groups as it sees in the original page. text and dump-text are treated as same in ocr processing mode." |
55 | 51 | }, |
56 | | - "median_filter_size": { |
57 | | - "type": "integer", |
58 | | - "title": "Median Filter Size", |
59 | | - "default": 0, |
60 | | - "description": "The size of the median filter to use for pre-processing the image during OCR based extraction. Useful to eliminate scanning artifacts and low quality JPEG artifacts. Default is 0 if the value is not explicitly set. Available only in the Enterprise version." |
61 | | - }, |
62 | | - "gaussian_blur_radius": { |
63 | | - "type": "number", |
64 | | - "title": "Gaussian Blur Radius", |
65 | | - "default": 0.0, |
66 | | - "description": "The radius of the gaussian blur to use for pre-processing the image during OCR based extraction. Useful to eliminate noise from the image. Default is 0.0 if the value is not explicitly set. Available only in the Enterprise version." |
67 | | - }, |
| 52 | + |
68 | 53 | "line_splitter_tolerance": { |
69 | 54 | "type": "number", |
70 | 55 | "title": "Line Splitter Tolerance", |
|
92 | 77 | } |
93 | 78 | }, |
94 | 79 | "if": { |
95 | | - "properties": { |
96 | | - "force_text_processing": { |
97 | | - "const": "false" |
| 80 | + "anyOf": [ |
| 81 | + { |
| 82 | + "properties": { |
| 83 | + "mode": { |
| 84 | + "const": "low_cost" |
| 85 | + } |
| 86 | + } |
| 87 | + }, |
| 88 | + { |
| 89 | + "properties": { |
| 90 | + "mode": { |
| 91 | + "const": "high_quality" |
| 92 | + } |
| 93 | + } |
| 94 | + }, |
| 95 | + { |
| 96 | + "properties": { |
| 97 | + "mode": { |
| 98 | + "const": "form" |
| 99 | + } |
| 100 | + } |
98 | 101 | } |
99 | | - } |
| 102 | + ] |
100 | 103 | }, |
101 | 104 | "then": { |
102 | 105 | "properties": { |
103 | | - "required": [ |
104 | | - "median_filter_size", |
105 | | - "gaussian_blur_radius" |
106 | | - ] |
107 | | - } |
| 106 | + "median_filter_size": { |
| 107 | + "type": "integer", |
| 108 | + "title": "Median Filter Size", |
| 109 | + "default": 0, |
| 110 | + "description": "The size of the median filter to use for pre-processing the image during OCR based extraction. Useful to eliminate scanning artifacts and low quality JPEG artifacts. Default is 0 if the value is not explicitly set. Available only in the Enterprise version." |
| 111 | + }, |
| 112 | + "gaussian_blur_radius": { |
| 113 | + "type": "number", |
| 114 | + "title": "Gaussian Blur Radius", |
| 115 | + "default": 0.0, |
| 116 | + "description": "The radius of the gaussian blur to use for pre-processing the image during OCR based extraction. Useful to eliminate noise from the image. Default is 0.0 if the value is not explicitly set. Available only in the Enterprise version." |
| 117 | + } |
| 118 | + }, |
| 119 | + "required": [ |
| 120 | + "median_filter_size", |
| 121 | + "gaussian_blur_radius" |
| 122 | + ] |
108 | 123 | } |
109 | 124 | } |
0 commit comments