Complete standalone final deliverable and unaligned Q2 results
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
"""Compatibility imports for callers of the former Relative-only module.
|
||||
|
||||
All projection is now performed by :mod:`adapter`; this file has no separate
|
||||
alignment calculation.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import numpy as np
|
||||
|
||||
from adapter import adapt_official_split
|
||||
|
||||
|
||||
def project_modality(values: np.ndarray, modality: str, *, reported_length: int | None = None,
|
||||
attention_mask: np.ndarray | None = None):
|
||||
"""Legacy single-modality call, delegated to the unified projection kernel."""
|
||||
from adapter.core import _relative_modality
|
||||
from adapter.coordinates import relative_targets
|
||||
from adapter.projection import project_intervals
|
||||
|
||||
record = {modality: values}
|
||||
if modality == "text":
|
||||
record["attention_mask"] = attention_mask
|
||||
else:
|
||||
record[f"{modality}_length"] = reported_length
|
||||
item = _relative_modality(record, modality)
|
||||
view = project_intervals(item.values, item.intervals, relative_targets(50),
|
||||
item.observed, item.quality)
|
||||
view.source_span = len(item.values)
|
||||
view.reported_length = item.reported_length
|
||||
view.length_conflict = item.length_conflict
|
||||
view.tail_ambiguous = item.tail_ambiguous
|
||||
return view
|
||||
|
||||
|
||||
adapt_split = adapt_official_split
|
||||
Reference in New Issue
Block a user