RED-8670: add OCR settings to dossier template

This commit is contained in:
Kilian Schuettler 2025-01-10 11:45:35 +01:00
parent 82552b1748
commit cfa8777dc1
9 changed files with 117 additions and 2 deletions

View File

@ -113,6 +113,43 @@
</div>
</div>
<div class="mt-24 hidden-elements">
<div class="heading">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.heading' | translate }}
</div>
<div class="iqser-input-group">
<mat-checkbox color="primary" formControlName="ocrAllPages">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.ocr-all-pages' | translate }}
</mat-checkbox>
<div class="info">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.ocr-all-pages-description' | translate }}
</div>
</div>
<div class="iqser-input-group">
<mat-checkbox color="primary" formControlName="rotationCorrectionByDefault">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.rotation-correction' | translate }}
</mat-checkbox>
<div class="info">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.rotation-correction-description' | translate }}
</div>
</div>
<div class="iqser-input-group">
<mat-checkbox color="primary" formControlName="fontStyleDetection">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.font-style-detection' | translate }}
</mat-checkbox>
<div class="info">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.font-style-detection-description' | translate }}
</div>
</div>
<div class="iqser-input-group">
<mat-checkbox color="primary" formControlName="idpByDefault">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.idp-by-default' | translate }}
</mat-checkbox>
<div class="info">
{{ 'add-edit-clone-dossier-template.form.ocr-settings.idp-description' | translate }}
</div>
</div>
</div>
<div class="mt-24 hidden-elements">
<div class="heading">{{ 'add-edit-clone-dossier-template.form.hidden-text.heading' | translate }}</div>
<div class="iqser-input-group">

View File

@ -148,6 +148,10 @@ export default class DossierTemplateInfoScreenComponent extends BaseFormComponen
],
applyDictionaryUpdatesToAllDossiersByDefault: [dossierTemplate?.applyDictionaryUpdatesToAllDossiersByDefault],
ocrByDefault: [dossierTemplate?.ocrByDefault],
idpByDefault: [dossierTemplate?.idpByDefault],
rotationCorrectionByDefault: [dossierTemplate?.rotationCorrectionByDefault],
fontStyleDetection: [dossierTemplate?.fontStyleDetection],
ocrAllPages: [dossierTemplate?.ocrAllPages],
removeWatermark: [dossierTemplate?.removeWatermark],
downloadFileTypes: [dossierTemplate?.downloadFileTypes || ['PREVIEW', 'REDACTED']],
keepHiddenText: [dossierTemplate?.keepHiddenText],

View File

@ -1,7 +1,7 @@
{
"ADMIN_CONTACT_NAME": null,
"ADMIN_CONTACT_URL": null,
"API_URL": "https://dan2.iqser.cloud",
"API_URL": "https://kilian0.iqser.cloud",
"APP_NAME": "Knecon Cloud",
"RULE_EDITOR_DEV_ONLY": false,
"AUTO_READ_TIME": 3,
@ -12,7 +12,7 @@
"MAX_RETRIES_ON_SERVER_ERROR": 3,
"OAUTH_CLIENT_ID": "redaction",
"OAUTH_IDP_HINT": null,
"OAUTH_URL": "https://dan2.iqser.cloud/auth",
"OAUTH_URL": "https://kilian0.iqser.cloud/auth",
"RECENT_PERIOD_IN_HOURS": 24,
"SELECTION_MODE": "structural",
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview",

View File

@ -88,6 +88,17 @@
"ocr-by-default": "OCR beim Upload von Dokumenten automatisch durchführen",
"remove-watermark": "Wasserzeichen vor OCR-Verarbeitung entfernen"
},
"ocr-settings": {
"heading": "OCR-Einstellungen",
"idp-by-default": "Intelligente Dokumentenverarbeitung (IDP) aktivieren",
"idp-description": "IDP wird anstelle von OCR durchgeführt. IDP beschreibt eine Reihe fortschrittlicher Layout-Parsing-Techniken, wie z. B. das Erkennen von Tabellen ohne Linien, KI-basierte Textklassifikation (Überschriften, Absätze usw.) und die Extraktion von Schlüssel-Wert-Paaren. Dies kann je nach Lizenz zusätzliche Kosten verursachen.",
"rotation-correction": "Rotationskorrektur aktivieren",
"rotation-correction-description": "Um die OCR-Ergebnisse zu verbessern, wird die Seitenrotation abgeschätzt. Wenn die Rotationskorrektur aktiviert ist, wird die PDF-Datei entsprechend dem erkannten Winkel gedreht. Dies ist besonders hilfreich für gescannte Dokumente.",
"font-style-detection": "Erkennung des Schriftstils aktivieren",
"font-style-detection-description": "Zusätzlich zur OCR wird der Schriftstil des erkannten Textes geschätzt. Dies führt zu einer verbesserten Textklassifikation, kann jedoch die Verarbeitungszeit während der OCR erhöhen.",
"ocr-all-pages": "OCR für alle Seiten aktivieren",
"ocr-all-pages-description": "Normalerweise wird OCR nur auf Seiten mit Bildern durchgeführt. Wenn diese Option aktiviert ist, wird OCR auf allen Seiten durchgeführt."
},
"valid-from": "Gültig ab",
"valid-to": "Gültig bis"
},

View File

@ -88,6 +88,17 @@
"ocr-by-default": "Automatically perform OCR on document upload",
"remove-watermark": "Remove watermarks before processing OCR"
},
"ocr-settings": {
"heading": "OCR settings",
"idp-by-default": "Enable intelligent document processing (IDP)",
"idp-description": "IDP will be performed instead of OCR. IDP describes a series of advanced layout parsing techniques, such as detecting tables without lines, AI-based text classification (headlines, paragraphs, etc.) and key-value pair extraction. This might incur additional costs, depending on your licence.",
"rotation-correction": "Enable rotation correction",
"rotation-correction-description": "To improve OCR results, the page rotation is estimated. If rotation correction is enabled, The PDF will be rotated to match the detected angle. This is especially helpful for scanned documents.",
"font-style-detection": "Enable font style detection",
"font-style-detection-description": "In addition to OCR, the font style of the detected text is estimated. This leads to an improved text classification but may lead to increased processing time during OCR.",
"ocr-all-pages": "Enable OCR on all pages",
"ocr-all-pages-description": "Normally OCR is only performed on pages with images. If this flag is set, OCR is performed on all pages instead."
},
"valid-from": "Valid from",
"valid-to": "Valid to"
},

View File

@ -88,6 +88,17 @@
"ocr-by-default": "",
"remove-watermark": ""
},
"ocr-settings": {
"heading": "OCR-Einstellungen",
"idp-by-default": "Intelligente Dokumentenverarbeitung (IDP) aktivieren",
"idp-description": "IDP wird anstelle von OCR durchgeführt. IDP beschreibt eine Reihe fortschrittlicher Layout-Parsing-Techniken, wie z. B. das Erkennen von Tabellen ohne Linien, KI-basierte Textklassifikation (Überschriften, Absätze usw.) und die Extraktion von Schlüssel-Wert-Paaren. Dies kann je nach Lizenz zusätzliche Kosten verursachen.",
"rotation-correction": "Rotationskorrektur aktivieren",
"rotation-correction-description": "Um die OCR-Ergebnisse zu verbessern, wird die Seitenrotation geschätzt. Wenn die Rotationskorrektur aktiviert ist, wird die PDF-Datei entsprechend dem erkannten Winkel gedreht. Dies ist besonders hilfreich für gescannte Dokumente.",
"font-style-detection": "Erkennung des Schriftstils aktivieren",
"font-style-detection-description": "Zusätzlich zur OCR wird der Schriftstil des erkannten Textes geschätzt. Dies führt zu einer verbesserten Textklassifikation, kann jedoch die Verarbeitungszeit während der OCR erhöhen.",
"ocr-all-pages": "OCR für alle Seiten aktivieren",
"ocr-all-pages-description": "Normalerweise wird OCR nur auf Seiten mit Bildern durchgeführt. Wenn diese Option aktiviert ist, wird OCR auf allen Seiten durchgeführt."
},
"valid-from": "Gültig ab",
"valid-to": "Gültig bis"
},

View File

@ -88,6 +88,17 @@
"ocr-by-default": "",
"remove-watermark": ""
},
"ocr-settings": {
"heading": "OCR settings",
"idp-by-default": "Enable intelligent document processing (IDP)",
"idp-description": "IDP will be performed instead of OCR. IDP describes a series of advanced layout parsing techniques, such as detecting tables without lines, AI-based text classification (headlines, paragraphs, etc.) and key-value pair extraction. This might incur additional costs, depending on your licence.",
"rotation-correction": "Enable rotation correction",
"rotation-correction-description": "To improve OCR results, the page rotation is estimated. If rotation correction is enabled, The PDF will be rotated to match the detected angle. This is especially helpful for scanned documents.",
"font-style-detection": "Enable font style detection",
"font-style-detection-description": "In addition to OCR, the font style of the detected text is estimated. This leads to an improved text classification but may lead to increased processing time during OCR.",
"ocr-all-pages": "Enable OCR on all pages",
"ocr-all-pages-description": "Normally OCR is only performed on pages with images. If this flag is set, OCR is performed on all pages instead."
},
"valid-from": "Valid from",
"valid-to": "Valid to"
},

View File

@ -22,6 +22,10 @@ export class DossierTemplate implements IDossierTemplate, IListable {
readonly keepOverlappingObjects: boolean;
readonly applyDictionaryUpdatesToAllDossiersByDefault: boolean;
readonly ocrByDefault: boolean;
readonly idpByDefault: boolean;
readonly rotationCorrectionByDefault: boolean;
readonly fontStyleDetection: boolean;
readonly ocrAllPages: boolean;
readonly removeWatermark: boolean;
constructor(dossierTemplate: IDossierTemplate) {
@ -43,6 +47,10 @@ export class DossierTemplate implements IDossierTemplate, IListable {
this.applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault;
this.ocrByDefault = dossierTemplate.ocrByDefault;
this.removeWatermark = dossierTemplate.removeWatermark;
this.idpByDefault = dossierTemplate.idpByDefault;
this.rotationCorrectionByDefault = dossierTemplate.rotationCorrectionByDefault;
this.fontStyleDetection = dossierTemplate.fontStyleDetection;
this.ocrAllPages = dossierTemplate.ocrAllPages;
}
get isActive(): boolean {

View File

@ -61,6 +61,28 @@ export interface IDossierTemplate {
*/
readonly keepOverlappingObjects: boolean;
readonly applyDictionaryUpdatesToAllDossiersByDefault: boolean;
/**
* Automatically performs ocr on upload of any file
*/
readonly ocrByDefault: boolean;
/**
* Whenever OCR would be performed, IDP is performed instead
*/
readonly idpByDefault: boolean;
/**
* Attempts rotation correction during OCR and updates each page of the document accordingly
*/
readonly rotationCorrectionByDefault: boolean;
/**
* Attempts font style detection on OCR results
*/
readonly fontStyleDetection: boolean;
/**
* Performs OCR on all pages instead of only pages with images
*/
readonly ocrAllPages: boolean;
/**
* Attempts to remove all watermarks from the document during OCR or the redaction step
*/
readonly removeWatermark: boolean;
}