You've already forked dokumenta-semantiska-analize
Import UAPF package
feat(3.2.0): align with UAPF v2.5.0 — embed algorithm card tests, drop sidecar
Per UAPF v2.5.0, tests move from sidecar files (tests/algorithms/<card-id>.test.yaml — removed in v2.5.0) into a top-level tests array on each algorithm card. Minimum two entries per card; the Algorithm Card viewer (UAPF chapter 13.16, ProcessGit Preview tab) consumes these as its primary interaction surface. This package's three cards now carry embedded tests: - algo.semantic_document_analysis.pii_redactor (deterministic redactor) — 3 cases: Latvian personas kods inline (positive — three entity types detected), plain administrative text (negative — no PII signals), financial figures with IBAN (mixed — financial yes, personas_kods no). - algo.semantic_document_analysis.vdvc_semantic_extractor (stochastic LLM extractor, EU AI Act high-risk + mandatory oversight) — 2 cases: regulatory construction-permit appeal (in-domain, expected topic + applicable_regulations), non-regulatory thank-you note (out-of-domain, low confidence). Both carry ai_confidence_score tolerance bands appropriate for a stochastic output. - algo.semantic_document_analysis.completion_event_emitter (deterministic CloudEvents emitter) — 2 cases: successful completion event, failure completion event. The emitter does not gate on payload contents, so both succeed. Other changes: - uapf.yaml + manifest.json: version 3.1.0 -> 3.2.0 - README.md: v3.2.0 section added describing embedded tests and the removed sidecar location BPMN file unchanged from v3.1.0 — uapf:algorithmCardRef on each service task per UAPF v2.4.0 + ioSpecification synthesis. Mappings unchanged. DMN tables unchanged. uapf-cli validate against v2.5.0 schemas passes cleanly.
This commit is contained in:
@@ -1,88 +1,119 @@
|
||||
kind: uapf.algorithm.card
|
||||
|
||||
id: algo.semantic_document_analysis.vdvc_semantic_extractor
|
||||
version: "1.0.0"
|
||||
name: "VDVC semantic metadata extractor"
|
||||
intent: >
|
||||
Extracts a VDVC v1.1-conformant structured semantic summary from
|
||||
the redacted document text — primary topic, keywords,
|
||||
classification, summary, sensitivity signals. Output validates
|
||||
against resources/schemas/vdvc-semantic-summary.schema.json. This
|
||||
is the sole model-inference step in the process; everything else
|
||||
in the package is deterministic.
|
||||
|
||||
version: 1.0.0
|
||||
name: VDVC semantic metadata extractor
|
||||
intent: |
|
||||
Extracts a VDVC v1.1-conformant structured semantic summary from the redacted document text — primary topic, keywords, classification, summary, sensitivity signals. Output validates against resources/schemas/vdvc-semantic-summary.schema.json. This is the sole model-inference step in the process; everything else in the package is deterministic.
|
||||
algorithm_kind: extractor
|
||||
|
||||
io:
|
||||
inputs:
|
||||
- id: redacted_content
|
||||
type: string
|
||||
cardinality: single
|
||||
constraints:
|
||||
maxLength: 200000
|
||||
documentation: "Output of the upstream PII redactor."
|
||||
- id: schema_ref
|
||||
type: string
|
||||
documentation: "Path to the JSON Schema the output must validate against."
|
||||
- id: redacted_content
|
||||
type: string
|
||||
cardinality: single
|
||||
constraints:
|
||||
maxLength: 200000
|
||||
documentation: Output of the upstream PII redactor.
|
||||
- id: schema_ref
|
||||
type: string
|
||||
documentation: Path to the JSON Schema the output must validate against.
|
||||
outputs:
|
||||
- id: semantic_summary
|
||||
type: object
|
||||
schema: "../resources/schemas/vdvc-semantic-summary.schema.json"
|
||||
- id: sensitivity_control
|
||||
type: object
|
||||
- id: ai_confidence_score
|
||||
type: probability
|
||||
- id: output_pii_error_count
|
||||
type: integer
|
||||
constraints: { minimum: 0 }
|
||||
|
||||
- id: semantic_summary
|
||||
type: object
|
||||
schema: ../resources/schemas/vdvc-semantic-summary.schema.json
|
||||
- id: sensitivity_control
|
||||
type: object
|
||||
- id: ai_confidence_score
|
||||
type: probability
|
||||
- id: output_pii_error_count
|
||||
type: integer
|
||||
constraints:
|
||||
minimum: 0
|
||||
implementation:
|
||||
type: external
|
||||
medium: llm_prompt
|
||||
uri: "uapf-ip://capability/ai.extract@1"
|
||||
hash: "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
||||
uri: uapf-ip://capability/ai.extract@1
|
||||
hash: sha256:0000000000000000000000000000000000000000000000000000000000000000
|
||||
runtime:
|
||||
capability: "ai.extract@1"
|
||||
note: "Host-fulfilled UAPF-IP capability. Specific model identity and prompt hash are runtime concerns of the host; the Card declares the contract, not the implementation choice."
|
||||
|
||||
capability: ai.extract@1
|
||||
note: Host-fulfilled UAPF-IP capability. Specific model identity and prompt hash
|
||||
are runtime concerns of the host; the Card declares the contract, not the implementation
|
||||
choice.
|
||||
determinism: stochastic
|
||||
side_effects: external_call
|
||||
|
||||
confidence:
|
||||
type: probability
|
||||
threshold: 0.70
|
||||
below_threshold: "route-to:human.legal_reviewer (enforced by DMN human-validation-gate)"
|
||||
|
||||
threshold: 0.7
|
||||
below_threshold: route-to:human.legal_reviewer (enforced by DMN human-validation-gate)
|
||||
complexity:
|
||||
typical_latency_ms: 8000
|
||||
max_latency_ms: 60000
|
||||
|
||||
failure_mode: "default:null + flag — DMN human-validation-gate routes low-confidence outputs to PENDING_REVIEW."
|
||||
|
||||
failure_mode: default:null + flag — DMN human-validation-gate routes low-confidence
|
||||
outputs to PENDING_REVIEW.
|
||||
limitations:
|
||||
- "Garie dokumenti (>50 000 znaki) tiek apgriezti — pirmie 50K + pēdējie 5K"
|
||||
- "Nav juridisks vērtējums — tikai semantiska klasifikācija"
|
||||
- "Latviešu valodas juridiskā retorika var samazināt recall"
|
||||
|
||||
- Garie dokumenti (>50 000 znaki) tiek apgriezti — pirmie 50K + pēdējie 5K
|
||||
- Nav juridisks vērtējums — tikai semantiska klasifikācija
|
||||
- Latviešu valodas juridiskā retorika var samazināt recall
|
||||
reference:
|
||||
legal: "EU AI Act 2024/1689, Pielikums III (augstā riska MI sistēmas), 13. pants (caurspīdība)."
|
||||
url: "https://eur-lex.europa.eu/eli/reg/2024/1689/oj"
|
||||
|
||||
legal: EU AI Act 2024/1689, Pielikums III (augstā riska MI sistēmas), 13. pants
|
||||
(caurspīdība).
|
||||
url: https://eur-lex.europa.eu/eli/reg/2024/1689/oj
|
||||
owners:
|
||||
- type: team
|
||||
id: uapf-stewards
|
||||
contact: stewards@uapf.dev
|
||||
|
||||
- type: team
|
||||
id: uapf-stewards
|
||||
contact: stewards@uapf.dev
|
||||
lifecycle:
|
||||
status: draft
|
||||
since: "2026-05-20"
|
||||
|
||||
since: '2026-05-20'
|
||||
audit:
|
||||
log_inputs: redacted
|
||||
log_outputs: full
|
||||
retention: "7y"
|
||||
|
||||
retention: 7y
|
||||
risk:
|
||||
aiActRiskClass: high
|
||||
humanOversight: mandatory
|
||||
transparencyTier: tier-3-full
|
||||
tests:
|
||||
- name: Regulatory iesniegums about administrative decision
|
||||
description: Typical Latvian administrative complaint with redacted PII. The extractor
|
||||
should identify topic + risk + applicable regulation.
|
||||
inputs:
|
||||
redacted_content: Iesniedzējs [NAME] iesniedza sūdzību par būvvaldes lēmumu Nr.
|
||||
12345 atteikt būvatļauju adresē [ADDRESS]. Tiek lūgts pārskatīt lēmumu.
|
||||
schema_ref: schemas/iesniegums/v1
|
||||
expected_outputs:
|
||||
semantic_summary:
|
||||
topic: construction-permit-appeal
|
||||
subject_area: administrative-law
|
||||
applicable_regulations:
|
||||
- BL
|
||||
- APL
|
||||
language: lv
|
||||
sensitivity_control:
|
||||
contains_decision_reference: true
|
||||
external_communication_recommended: false
|
||||
ai_confidence_score: 0.87
|
||||
output_pii_error_count: 0
|
||||
tolerance:
|
||||
ai_confidence_score: 0.1
|
||||
output_pii_error_count: 0
|
||||
- name: Non-regulatory thank-you note
|
||||
description: Out-of-domain input. Extractor should yield low-confidence summary
|
||||
and a sensitivity flag that no decision is referenced.
|
||||
inputs:
|
||||
redacted_content: Paldies par jūsu pakalpojumu! Bija ļoti patīkami sadarboties
|
||||
ar [NAME] no jūsu komandas.
|
||||
schema_ref: schemas/iesniegums/v1
|
||||
expected_outputs:
|
||||
semantic_summary:
|
||||
topic: non-actionable-correspondence
|
||||
subject_area: feedback
|
||||
applicable_regulations: []
|
||||
language: lv
|
||||
sensitivity_control:
|
||||
contains_decision_reference: false
|
||||
external_communication_recommended: false
|
||||
ai_confidence_score: 0.62
|
||||
output_pii_error_count: 0
|
||||
tolerance:
|
||||
ai_confidence_score: 0.15
|
||||
output_pii_error_count: 0
|
||||
|
||||
Reference in New Issue
Block a user