Skip to content

Implement provider-neutral POS distributions, bigrams, and sentence-position metrics #24

Closed

Description

@andy-zen-dev

Unit

SCRIP-MORPH-002

Why

M1 still lacks the POS metric family. SCRIP-MORPH-001 pinned the pylem/AOT runtime contract but deliberately did not choose hidden FantLab disambiguation rules or pretend that the public pylem N collision can distinguish noun from cardinal numerals.

Current FantLab /lp pages describe POS bigrams as ordered POS pairs reported per 1000 text words and sentence-position cells as the probability that a POS occupies a numbered word position in a randomly selected sentence. That wording is enough to freeze explicit Scriptorium candidate denominators, but not enough to claim parity.

Scope

  • Add a deterministic, provider-neutral scriptorium-pos-v1 metric core consuming one sequence of pylem-style runtime POS candidates per Scriptorium word token.
  • Resolve a token only when every supplied analysis is directly mapped by aot-pylem-0.0.18-to-fantlab-2022-v1 and all mapped analyses agree on one FantLab bucket.
  • Treat no-analysis tokens, runtime N, unresolved extra runtime categories, unknown codes, and cross-bucket homonyms as undefined rather than guessing a winner.
  • Emit defined/undefined counts and percentages plus all 17 displayed FantLab bucket counts and % of defined values.
  • Emit sentence-bounded ordered POS bigrams for directly resolved adjacent word tokens, normalized per 1000 total Scriptorium word tokens. An unresolved token breaks the candidate pair; sentence boundaries never create a pair.
  • Emit positions 1..20 as bucket probabilities using all candidate sentences as denominator, matching FantLab's public “randomly selected sentence” wording. A sentence shorter than the position or an unresolved token contributes zero to that bucket numerator.
  • Keep service-word count unresolved because the exact FantLab POS-to-service aggregation is still not established.
  • Add a versioned JSON schema, tests, public documentation, and durable state/changelog updates.

Non-goals

  • No native pylem build/runtime claim in this unit.
  • No noun/cardinal recovery heuristic for runtime N.
  • No first-analysis/weight-based homonym selection.
  • No claim that sentence-bounded adjacency or the exact denominator choices reproduce FantLab until source-matched benchmarks discriminate them.
  • No service-word folding guess.

Acceptance criteria

  • Empty input, direct mappings, ambiguous homonyms, unresolved runtime categories, sentence boundaries, bigram normalization, and 1..20 position denominators have deterministic tests.
  • The artifact exposes mapping/profile identity and is schema-valid under Draft 2020-12.
  • All FantLab-shaped values remain inferred; unresolved information is visible rather than coerced.
  • Existing deterministic metric behavior is unchanged.
  • State records the unit as review-ready rather than self-merging the authored change.

Evidence

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions