Command-line tool · TypeScript

at-field

Point it at a transcript and name a theme. It measures how much of that theme's vocabulary the text uses.

$ at-field speech.txt --theme "religion"
Terminal replay of at-field on the Gettysburg Address for the theme religion: first with a wordlist, 5 of 12 words found (42%), then with the model's field, 1 of 25 words found (4%).
Replay of two real runs on the Gettysburg Address. The model's wait and the report path are trimmed.

What it is for

You suspect a theme runs through a text without being its subject: economy in a nature documentary, religion in a battlefield speech. You name the theme, and at-field returns one score with the matches behind it. The quieter the theme, the more the number helps.

The tool is deliberately narrow. It measures one theme in one transcript.

How it works

  1. The tool loads the transcript (.srt, .vtt or plain text). The language comes from the text itself, or from --language.
  2. A local model, served by Ollama, expands the theme into single words in that language. Afterwards, code removes phrases, the theme's own words, and inflected variants of a word already listed.
  3. Each word is matched against the transcript by word boundary, ignoring case.
  4. The report gives the lexical saturation (distinct words found divided by words in the field), the matches per 1,000 words, and where the score falls between two boundaries you can set (10% and 70% by default). Input with timing also gets timestamped occurrences.

An example run

Lincoln's Gettysburg Address (public domain) dedicates a battlefield cemetery. Suppose you suspect that religion runs through it. The first run uses the default model, which builds the vocabulary for you.

$ at-field examples/gettysburg.txt --theme "religion"
Saturation [█░░░░░░░░░░░░░░░░░░░] 4% (1/25 terms, below the low boundary (10%))

god ██████████████████████████████ 1

Field proposed by the model: 25 words, matches highlighted

god bible church sacred faith belief pagan pilgrimage holy monk priest preacher temple mosque shrine catholic prophet zakat benediction worship saint sacrament hymn miracle sin

The model proposed 25 words and the speech uses one of them, "god". A score of 4% says religion is present and takes up little of the text.

If you already know which words you are looking for, hand them over as a wordlist with --lexic. The tool uses them as written.

$ at-field examples/gettysburg.txt --theme "religion" --lexic examples/religion-words.txt
Saturation [████████░░░░░░░░░░░░] 42% (5/12 terms, between the boundaries (10%–70%))

devotion   ██████████████████████████████ 2
dedicate   ██████████████████████████████ 2
god        ███████████████ 1
consecrate ███████████████ 1
hallow     ███████████████ 1

Wordlist supplied by the user: 12 words, matches highlighted

god consecrate hallow devotion dedicate holy sacred prayer faith divine blessed worship

Five of the twelve words appear, 42%, with "devotion" and "dedicate" twice each. The same speech, asked a sharper question, gives a fuller answer.

Using it well

Good fits

Getting a reliable reading

Where another tool fits better

Install

Install Ollama and pull the default model, then install at-field with npm.

$ ollama pull qwen2.5:3b
$ npm install -g at-field

The default model is about 1.9 GB and downloads once. If it is missing, at-field shows its size and offers to pull it. A run with no terminal (a script or CI job) starts no download and prints the ollama pull command instead.

To try it without installing, run npx at-field transcript.srt --theme "economy". npx fetches the package on first use, so the first start takes longer. Set up Ollama and the model beforehand, because npx fetches only at-field.

Under the hood

Language
TypeScript on Node 22+, ESM
Dependencies
commander, franc-min, iso-639-3 (all pure JavaScript)
Model
Any Ollama model; default qwen2.5:3b
Quality
Unit tests on Node's built-in runner, CI on Node 22 and 24
License
MIT

Performance

Theme expansion is the slow step, and its speed depends on the hardware running Ollama. Ollama uses a supported GPU automatically, and a GPU is recommended if you run at-field often. On a CPU-only machine, the default 3B model took about 2 to 5 minutes per run in testing. A smaller model (--model qwen2.5:0.5b) runs faster and gives weaker fields outside English. A wordlist (--lexic) skips expansion and answers in seconds.