Redact: collapsible advanced settings, download TXT/DOCX/copy
- Wrap Mode/Region/Entities/Officials/Output/Exempt/Aliases in a <details> toggle so the form opens clean with only engine + input visible - After redaction: Copy, Download .txt, Download .docx buttons appear below the redacted output (all four languages translated) - New api/redact-download.php: returns plain text or a minimal valid DOCX built from scratch with ZipArchive (no external dependencies) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+56
-51
@@ -24,61 +24,66 @@ require_once __DIR__ . '/includes/layout.php';
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactEngineHint">Azure engines use your BNL Azure credits. GPU runs the local LiteLLM proxy. Regex-only is instant and free but finds no names or organisations.</p>
|
||||
|
||||
<div class="control-row" id="redactModeControl">
|
||||
<span class="control-label" data-i18n="redactMode">Mode</span>
|
||||
<label><input type="radio" name="redactionMode" value="standard" checked> <span data-i18n="redactModeStandard">Standard</span></label>
|
||||
<label><input type="radio" name="redactionMode" value="strict"> <span data-i18n="redactModeStrict">Strict</span></label>
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactModeHint">Standard: regex patterns + LLM scan for names/orgs/places. Strict: also replaces any capitalised two-word phrase as a potential name — more aggressive, may produce false positives.</p>
|
||||
<details class="advanced-panel" id="redactAdvanced">
|
||||
<summary class="advanced-toggle" data-i18n="redactAdvancedToggle">Advanced settings</summary>
|
||||
|
||||
<div class="control-row" id="redactRegionControl">
|
||||
<span class="control-label" data-i18n="redactRegion">Region</span>
|
||||
<label><input type="radio" name="redactionRegion" value="nordic" checked> <span data-i18n="redactRegionNordic">Nordic</span></label>
|
||||
<label><input type="radio" name="redactionRegion" value="european"> <span data-i18n="redactRegionEuropean">European</span></label>
|
||||
<label><input type="radio" name="redactionRegion" value="echr"> <span data-i18n="redactRegionEchr">ECHR</span></label>
|
||||
<label><input type="radio" name="redactionRegion" value="global"> <span data-i18n="redactRegionGlobal">Global</span></label>
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactRegionHint">Nordic: Norwegian fødselsnummer, phone, email, addresses. European: adds IBAN, SE personnummer, UK NI. ECHR: adds application numbers, DOB phrases. Global: adds US SSN, document numbers.</p>
|
||||
|
||||
<div class="control-row entity-toggles" id="redactEntityControl">
|
||||
<span class="control-label" data-i18n="redactEntities">Redact</span>
|
||||
<label><input type="checkbox" name="redactNames" id="redactNames" checked> <span data-i18n="redactEntityNames">Names</span></label>
|
||||
<label><input type="checkbox" name="redactOrgs" id="redactOrgs" checked> <span data-i18n="redactEntityOrgs">Organisations</span></label>
|
||||
<label><input type="checkbox" name="redactPlaces" id="redactPlaces" checked> <span data-i18n="redactEntityPlaces">Places</span></label>
|
||||
<label><input type="checkbox" name="redactDob" id="redactDob" checked> <span data-i18n="redactEntityDob">Dates of birth</span></label>
|
||||
</div>
|
||||
|
||||
<div class="control-row" id="redactOfficialsControl">
|
||||
<span class="control-label" data-i18n="redactOfficials">Officials</span>
|
||||
<label><input type="checkbox" name="keepOfficials" id="keepOfficialsCheck"> <span data-i18n="redactKeepOfficials">Keep official names (judges, experts)</span></label>
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactOfficialsHint">When checked, judges, expert witnesses and caseworkers keep their names in a labelled tag: [JUDGE: Andersen]. Uncheck to replace all names with generic role tags.</p>
|
||||
|
||||
<div class="control-row" id="redactOutputControl">
|
||||
<span class="control-label" data-i18n="redactOutput">Output</span>
|
||||
<label><input type="radio" name="outputFormat" value="contextual" checked> <span data-i18n="redactOutputContextual">Contextual tags</span> ★ <small class="control-hint">[FATHER], [JUDGE: Name]</small></label>
|
||||
<label><input type="radio" name="outputFormat" value="generic"> <span data-i18n="redactOutputGeneric">Generic tags</span> <small class="control-hint">[PERSON], [ORG]</small></label>
|
||||
<label><input type="radio" name="outputFormat" value="pseudonym"> <span data-i18n="redactOutputPseudo">Pseudonyms</span> <small class="control-hint">Ola Nordmann, +47 400 00 001</small></label>
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactOutputHint">Contextual: each person gets a role tag so their identity is traceable within the document. Generic: all names become [PERSON]. Pseudonyms: replaced with plausible fake Norwegian values.</p>
|
||||
|
||||
<div class="exempt-section" id="exemptSection">
|
||||
<div class="alias-header">
|
||||
<span class="control-label" data-i18n="redactExempt">Exempt names</span>
|
||||
<button type="button" id="addExemptRow" class="alias-add-btn">+ <span data-i18n="redactExemptAdd">Add</span></button>
|
||||
<div class="control-row" id="redactModeControl">
|
||||
<span class="control-label" data-i18n="redactMode">Mode</span>
|
||||
<label><input type="radio" name="redactionMode" value="standard" checked> <span data-i18n="redactModeStandard">Standard</span></label>
|
||||
<label><input type="radio" name="redactionMode" value="strict"> <span data-i18n="redactModeStrict">Strict</span></label>
|
||||
</div>
|
||||
<div id="exemptRows"></div>
|
||||
<p class="alias-hint" data-i18n="redactExemptHint">Names listed here will never be redacted, even if the AI would otherwise remove them — e.g. a judge or expert who must remain identifiable.</p>
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactModeHint">Standard: regex patterns + LLM scan for names/orgs/places. Strict: also replaces any capitalised two-word phrase as a potential name — more aggressive, may produce false positives.</p>
|
||||
|
||||
<div class="alias-section" id="aliasSection">
|
||||
<div class="alias-header">
|
||||
<span class="control-label" data-i18n="redactAliases">Name aliases</span>
|
||||
<button type="button" id="addAliasRow" class="alias-add-btn">+ <span data-i18n="redactAliasAdd">Add</span></button>
|
||||
<div class="control-row" id="redactRegionControl">
|
||||
<span class="control-label" data-i18n="redactRegion">Region</span>
|
||||
<label><input type="radio" name="redactionRegion" value="nordic" checked> <span data-i18n="redactRegionNordic">Nordic</span></label>
|
||||
<label><input type="radio" name="redactionRegion" value="european"> <span data-i18n="redactRegionEuropean">European</span></label>
|
||||
<label><input type="radio" name="redactionRegion" value="echr"> <span data-i18n="redactRegionEchr">ECHR</span></label>
|
||||
<label><input type="radio" name="redactionRegion" value="global"> <span data-i18n="redactRegionGlobal">Global</span></label>
|
||||
</div>
|
||||
<div id="aliasRows"></div>
|
||||
<p class="alias-hint" data-i18n="redactAliasHint">Replace a specific name with a custom bracketed label, e.g. “David Jr” → [Junior].</p>
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactRegionHint">Nordic: Norwegian fødselsnummer, phone, email, addresses. European: adds IBAN, SE personnummer, UK NI. ECHR: adds application numbers, DOB phrases. Global: adds US SSN, document numbers.</p>
|
||||
|
||||
<div class="control-row entity-toggles" id="redactEntityControl">
|
||||
<span class="control-label" data-i18n="redactEntities">Redact</span>
|
||||
<label><input type="checkbox" name="redactNames" id="redactNames" checked> <span data-i18n="redactEntityNames">Names</span></label>
|
||||
<label><input type="checkbox" name="redactOrgs" id="redactOrgs" checked> <span data-i18n="redactEntityOrgs">Organisations</span></label>
|
||||
<label><input type="checkbox" name="redactPlaces" id="redactPlaces" checked> <span data-i18n="redactEntityPlaces">Places</span></label>
|
||||
<label><input type="checkbox" name="redactDob" id="redactDob" checked> <span data-i18n="redactEntityDob">Dates of birth</span></label>
|
||||
</div>
|
||||
|
||||
<div class="control-row" id="redactOfficialsControl">
|
||||
<span class="control-label" data-i18n="redactOfficials">Officials</span>
|
||||
<label><input type="checkbox" name="keepOfficials" id="keepOfficialsCheck"> <span data-i18n="redactKeepOfficials">Keep official names (judges, experts)</span></label>
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactOfficialsHint">When checked, judges, expert witnesses and caseworkers keep their names in a labelled tag: [JUDGE: Andersen]. Uncheck to replace all names with generic role tags.</p>
|
||||
|
||||
<div class="control-row" id="redactOutputControl">
|
||||
<span class="control-label" data-i18n="redactOutput">Output</span>
|
||||
<label><input type="radio" name="outputFormat" value="contextual" checked> <span data-i18n="redactOutputContextual">Contextual tags</span> ★ <small class="control-hint">[FATHER], [JUDGE: Name]</small></label>
|
||||
<label><input type="radio" name="outputFormat" value="generic"> <span data-i18n="redactOutputGeneric">Generic tags</span> <small class="control-hint">[PERSON], [ORG]</small></label>
|
||||
<label><input type="radio" name="outputFormat" value="pseudonym"> <span data-i18n="redactOutputPseudo">Pseudonyms</span> <small class="control-hint">Ola Nordmann, +47 400 00 001</small></label>
|
||||
</div>
|
||||
<p class="upload-hint" data-i18n="redactOutputHint">Contextual: each person gets a role tag so their identity is traceable within the document. Generic: all names become [PERSON]. Pseudonyms: replaced with plausible fake Norwegian values.</p>
|
||||
|
||||
<div class="exempt-section" id="exemptSection">
|
||||
<div class="alias-header">
|
||||
<span class="control-label" data-i18n="redactExempt">Exempt names</span>
|
||||
<button type="button" id="addExemptRow" class="alias-add-btn">+ <span data-i18n="redactExemptAdd">Add</span></button>
|
||||
</div>
|
||||
<div id="exemptRows"></div>
|
||||
<p class="alias-hint" data-i18n="redactExemptHint">Names listed here will never be redacted, even if the AI would otherwise remove them — e.g. a judge or expert who must remain identifiable.</p>
|
||||
</div>
|
||||
|
||||
<div class="alias-section" id="aliasSection">
|
||||
<div class="alias-header">
|
||||
<span class="control-label" data-i18n="redactAliases">Name aliases</span>
|
||||
<button type="button" id="addAliasRow" class="alias-add-btn">+ <span data-i18n="redactAliasAdd">Add</span></button>
|
||||
</div>
|
||||
<div id="aliasRows"></div>
|
||||
<p class="alias-hint" data-i18n="redactAliasHint">Replace a specific name with a custom bracketed label, e.g. “David Jr” → [Junior].</p>
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
<div class="upload-zone" id="uploadZone" role="region" aria-label="File upload" data-i18n-aria="redactUploadAria">
|
||||
<input type="file" id="uploadInput" multiple accept=".pdf,.docx,.txt" aria-label="Choose files">
|
||||
|
||||
Reference in New Issue
Block a user