Skip to content

Add linguistic competence metrics for spoken-output analysis - #49

Merged
willwade merged 2 commits into
mainfrom
feat/linguistic-competence-metrics
Aug 13, 2026
Merged

Add linguistic competence metrics for spoken-output analysis#49
willwade merged 2 commits into
mainfrom
feat/linguistic-competence-metrics

Conversation

@willwade

Copy link
Copy Markdown
Collaborator

What

Adds a pure, platform-agnostic module that measures linguistic competence from AAC spoken output (phrase history), across the four dimensions (Light, 1989). This complements the existing pageset-structure metrics with analysis of what users actually say.

Grounded in:

  • AssistiveWare, Measuring AAC user linguistic competence: A novel approach (Niemeijer, Sheldon & Hillary Zisk, 2025)
  • Frisch, Wade et al., It's Complicated (arXiv:2606.24854)

Measures (per the AssistiveWare findings)

Dimension Measure
Semantic (headline) MATTR-30 lexical diversity (Covington & McFall, 2010)
Syntactic MA-UPC-TWR-30 preposition + conjunction diversity
Morphological MA-UMORPH-TLWR-30 heuristic proxy
Phonological spelling validity (optional, needs a dictionary)
Activity utterances / words / unique words / active days / words-per-utterance

All diversity measures use 30-word moving-average windows, making them sample-length independent and usable for the tiny, highly-variable samples typical of AAC. MLU is intentionally not a headline (it conflates linguistic/operational/strategic/social competence); it is reported only as a distribution.

Design

  • No I/O, no platform dependencies — runs anywhere (browser included).
  • Privacy-preserving by construction — \�nalyzeTimeline\ emits only aggregate statistics: no raw utterance text, no word lists, no fringe-vocabulary frequencies. Utterances are binned by calendar month so no pattern can be tied to a specific day/time.
  • \�nalyzeTimeline(utterances, options)\ returns a full report: per-month timeline + a weighted trend on the headline lexical-diversity measure.

Privacy rationale

This implements the AssistiveWare guidance directly: compute on-device, aggregate over 7+ days (we use a month), and never report fringe-word frequency. It is the analysis engine behind a deployable Grid 3 competence exporter, but it is useful to any project that needs privacy-safe linguistic analysis of AAC output.

Tests

New \ est/competence.test.ts\ — 24 unit tests covering tokenisation, MATTR (incl. sample-length insensitivity), syntactic/morphological diversity, spelling, activity stats, and the timeline engine (privacy assertions confirm no raw text leaks). All passing; typecheck clean.

Privacy-preserving, pure functions that analyse AAC *spoken output* (phrase
history) across the four dimensions of linguistic competence (Light, 1989),
grounded in AssistiveWare's 'Measuring AAC user linguistic competence' and
Frisch/Wade et al. 'It's Complicated' (arXiv:2606.24854):

- Semantic: MATTR-30 lexical diversity (headline, sample-length independent)
- Syntactic: MA-UPC-TWR-30 preposition + conjunction diversity
- Morphological: MA-UMORPH-TLWR-30 heuristic proxy
- Phonological: spelling validity (optional, needs a dictionary)
- Activity: utterances/words/unique words/active days/words-per-utterance

All measures use 30-word moving-average windows (Covington & McFall, 2010),
binned by calendar month with a weighted trend. No I/O, no platform deps -
runs anywhere (browser included) and emits only aggregate statistics (no raw
text, no word lists). Unit tested.
… no hardcoded lists

Addresses review feedback:
- No hardcoded word lists. Removed the inlined EN/NL preposition+conjunction
  sets and the morphology guard list. The core is now data-free; language
  resources (closed-class words, an inflection classifier) are injected via
  LanguageResources. Adding a language = provide resources, no core change.
- Any language, no silent degradation. When a resource is missing, the affected
  measure is reported unavailable with a reason, and the report gains a support
  block + warnings list, so language gaps are explicit.
- Source-agnostic. analyzeTimeline already took generic utterances; now
  historyEntriesToCompetenceUtterances adapts ANY HistoryEntry (Grid 3, Snap,
  OBF/OBFL, ...) into that stream. Added an OBF/OBFL test proving any
  speech-history source plugs in.
- Removed non-null assertions; lint-clean.

Semantic (MATTR-30) stays available for every language out of the box.
@willwade
willwade merged commit e335d94 into main Aug 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant