Menu

Your Vocabulary Coverage Report Needs a Denominator
📰

Your Vocabulary Coverage Report Needs a Denominator

DEV Community: nlp·LingvoBerry·2 days ago
#CMJj6OST
#devtonlp#devto#dev#known#hits
Reading 0:00
15s threshold

Two vocabulary reports can disagree without either one containing an arithmetic error. They may be counting different things.

Consider this deliberately small passage:

Maya walked to the station. Maya was walking and the children were reading.

Keep the reader's declared vocabulary fixed. Counting printed forms gives 38.46% . Applying a small, explicit normalization table gives 84.62% . Counting distinct normalized items instead of occurrences gives 88.89% .

Those numbers come from the same thirteen tokens. The difference is the contract around the metric.

A complete example you can run

This example uses Python's standard library. The passage and the known-word set are hand-written fixtures. The alias table is an annotation for this passage, rather than a general-purpose lemmatizer.

""" A deliberately small, original English fixture; no production data or NLP model. """ from collections import Counter import json import re

TEXT = ' Maya walked to the station.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.