src.dackar.RCA.ner.hybrid_ner.classifier¶
Classes¶
Minimal supervised example for the span classifier. |
|
Lightweight ML span classifier placeholder using scikit-learn. |
Module Contents¶
- class src.dackar.RCA.ner.hybrid_ner.classifier.TrainingExample[source]¶
Minimal supervised example for the span classifier.
doc_text: full document text
start/end: span offsets in doc_text
label: gold label (must exist in schema.label_to_group)
- class src.dackar.RCA.ner.hybrid_ner.classifier.SpanClassifier(context_window_chars=50, top_k=3, min_prob=0.25)[source]¶
Lightweight ML span classifier placeholder using scikit-learn.
- Purpose:
Propose label hypotheses for candidates that are currently unlabeled (“defer”).
- Usage:
clf = SpanClassifier()
clf.fit(examples, schema)
pipeline = HybridNERPipeline(…, classifier=clf)
If scikit-learn is not available, this becomes a no-op (safe).
- Parameters:
context_window_chars (int)
top_k (int)
min_prob (float)
- fit(examples, schema)[source]¶
- Parameters:
examples (Sequence[TrainingExample])
- Return type:
None
- predict(doc, candidates, schema)[source]¶
- Parameters:
candidates (List[src.dackar.RCA.ner.hybrid_ner.models.CandidateSpan])
- Return type: