src.dackar.RCA.ner.hybrid_ner.models¶
Classes¶
Represents a single reliability text document (condition report, work order, etc.). |
|
Provenance record for how a candidate span was generated. |
|
A proposed label for a candidate span before final resolution. |
|
A proposed entity mention span before final decision. |
|
A finalized span after conflict resolution / compatibility enforcement. |
|
Records how one or more CandidateSpan(s) are resolved into final output spans. |
|
Optional suggested relation between resolved spans. This is not required for v0.1, |
|
Final result for a document. |
Module Contents¶
- class src.dackar.RCA.ner.hybrid_ner.models.Document[source]¶
Represents a single reliability text document (condition report, work order, etc.).
Offsets are always defined on text (the original authoritative string). Normalization can be added later using normalized_text + offset_map.
- class src.dackar.RCA.ner.hybrid_ner.models.SourceHit[source]¶
Provenance record for how a candidate span was generated.
Examples
source_type=”regex”, source_id=”REGEX_FAIL_START”
source_type=”gazetteer_exact”, source_id=”deg_mech_list”
source_type=”noun_chunk”, source_id=”spacy_np”
- class src.dackar.RCA.ner.hybrid_ner.models.LabelHypothesis[source]¶
A proposed label for a candidate span before final resolution.
group is typically filled by schema lookup (label->group). score can be used as a prior confidence or later overwritten by an ML classifier.
- class src.dackar.RCA.ner.hybrid_ner.models.CandidateSpan[source]¶
A proposed entity mention span before final decision.
- Fields:
start/end: character offsets into Document.text
text: cached substring for convenience
sources: provenance (where did this candidate come from)
proposed_labels: potentially multiple, potentially conflicting
- proposed_labels: List[LabelHypothesis] = [][source]¶
- class src.dackar.RCA.ner.hybrid_ner.models.ResolvedSpan[source]¶
A finalized span after conflict resolution / compatibility enforcement.
labels may contain multiple labels only if allowed by schema/rules (e.g., G5+G6).
- class src.dackar.RCA.ner.hybrid_ner.models.Decision[source]¶
Records how one or more CandidateSpan(s) are resolved into final output spans.
- action:
“accept”: accept as-is (possibly with refined label list)
“reject”: discard
“split”: output_spans contains >1 span
“nest”: output contains nested spans
“defer”: unresolved; keep for ML or human review
- output_spans: List[ResolvedSpan][source]¶
- class src.dackar.RCA.ner.hybrid_ner.models.RelationProposal[source]¶
Optional suggested relation between resolved spans. This is not required for v0.1, but the compatibility schema can recommend link types like:
“causes”, “affects”, “made_of”, “has_outcome”
- class src.dackar.RCA.ner.hybrid_ner.models.PipelineResult[source]¶
- Final result for a document.
decisions: full traceability of how spans were resolved
entities: flattened accepted spans (for typical downstream use)
relations: optional relation proposals
diagnostics: counters/timings/debug info
- entities: List[ResolvedSpan][source]¶
- relations: List[RelationProposal][source]¶