Skip to main content

Automated Intelligence Tests

This is a library to conduct automated tests for cognitive abilities. All tests should include instruction, parsing and scoring: instruct() builds the stimuli, parse() will do some simple parsing to fit the format of the scoring evaluate() function.

Test Name instruct evaluate
cat Convergent Association Task yes Semantic proximity score (Wang et al., WIP)
dat Divergent Association Task yes Semantic distance score (Olson et al., 2021)
aut Alternative Uses Task yes SemDis originality (Beaty & Johnson, 2021)
aut_1w Alternative Uses Task (One-Word Cued) yes SemDis on the usage noun (Beaty & Johnson)
cwt Creative Writing Task yes BERT DSI (Johnson et al., 2023)
wat Word Association Task (Continued) yes Typicality vs SWOW-EN norms (De Deyne et al., 2019)

Install

pip install git+https://github.com/dtzx00/Automated-Intelligence-Tests.git

Once published to PyPI: pip install automated-intelligence-tests.

Dependencies (glove-word-embeddings, numpy) are declared in pyproject.toml and installed automatically — no separate requirements step. Python 3.9+.

For local development:

git clone https://github.com/dtzx00/Automated-Intelligence-Tests.git
cd Automated-Intelligence-Tests
pip install -e .

Quickstart

import automated_intelligence_tests as ait
ait.list_available_tests()
stim = ait.instruct("aut", cue="brick")
parsed = ait.parse("aut", raw, stim=stim)
result = ait.evaluate("aut", parsed)

instruct() returns a dict with test, instructions, response_format, and the test's own stimuli. evaluate() returns a dict with score (None if nothing scorable), n_valid, and per-test detail.

API

ait.list_available_tests()                   # short_name and long_name for every test
ait.instruct(test, **kwargs)                 # test in {"cat", "dat", "aut", "aut_1w", "cwt", "wat"}
ait.call_test_instruction("DAT", **kwargs)   # same as instruct(), case-insensitive name
ait.parse(test, raw, stim=None)              # some basic automated parsing
ait.evaluate(test, responses, **kwargs)      # evaluate the scores using parsed response        

Sub-packages can be used directly: from automated_intelligence_tests.cat import instruct, parse, evaluate.

Test instruct arguments parse arguments evaluate arguments
cat cue=None, single_item=False, n_words=10, seed=None not implemented responses, model_key="glove-840b-300d"
dat cue=None, n_words=10, seed=None raw, cue=None, n_words=10, stim=None responses, model_key=..., minimum=7
aut cue=None, n_words=None, seed=None raw, cue=None, n_words=None, stim=None responses, model_keys=None
aut_1w cue=None, seed=None raw, cue=None, stim=None (JSON only) responses, cue=None, stim=None, model_keys=None, noun_only=True
cwt cue=None, n_words=3, seed=None raw, cue=None, n_words=None, stim=None responses, model_key="bert-large"
wat cue=None, seed=None raw, cue=None, stim=None (JSON only) responses, cue=None, stim=None, norms=None, model_key="glove-840b-300d", norms_response="R123", concreteness=None, common_threshold=0.05

CAT samples word pairs from a fixed list of 8,069 English word pairs at cosine distance 0.85–0.95. n_words controls how many pairs are returned at once. Providing cue=[(w1, w2), ...] uses those explicit pairs (and a single pair automatically embeds it in the instruction text).

DAT asks for n_words words that are as different from each other as possible. Optional cue seeds the first word; the participant then supplies the remaining words.

AUT samples (or accepts) a common object via cue. n_words is accepted for API consistency but currently unused.

AUT_1W is a standardised, cued AUT. One object, by default drawn uniformly from brick, paperclip, soap, wheel (any other can be passed as cue); up to ten optional lines a–j, each written as I will use the <object> as <usage> for <explanation>, returned as a JSON list of {"usage", "explanation"} pairs. instructions is the full rendered page, given unchanged to humans and LLMs. See aut_1w/readme.md.

CWT samples (or accepts via cue) 1–3 cue words controlled by n_words and asks for a short creative story that incorporates every cue word.

WAT is the Small World of Words continued word-association task. One cue, by default drawn uniformly from the 12,216 SWOW-EN2018 cues so every trial has a human reference distribution; up to three responses (the first words that come to mind), returned as {"unknown": bool, "responses": [r1, r2, r3]}. parse() applies the SWOW preprocessing. See wat/readme.md.

Scoring

  • CAT — mean cosine similarity between the participant's word and each of the two cue words, averaged over items. Higher = stronger convergent association. Invalid or unembeddable words are marked valid: False and excluded rather than penalised.
  • DAT — Olson's procedure exactly: mean pairwise cosine distance of the first 7 unique valid words, ×100. Returns score: None if fewer than 7 valid words are given.
  • AUT — Beaty & Johnson SemDis: clean each use (how="heavy" stopwords, drop cue + plural), multiply leftover word vectors, take 1 − cosine to the cue in five spaces (cbow-subs-300d, cbow-ukwac-subs-300d, cbow-baroni-400d, tasa-lsa-300d, glove-6b-300d). score is the mean of those spaces, then the mean across uses. Higher = more original. First call downloads the five spaces into ~/.cache/glove-word-embeddings.
  • AUT_1W — the first ten non-blank uses are scored by the AUT scorer above and its result returned unchanged. By default (noun_only=True) each use is the usage noun alone; noun_only=False scores usage + explanation joined. Replies that aren't a well-formed list of pairs, or that contain a usage that isn't one word after trimming stopwords, score None.
  • CWT — Johnson et al. BERT DSI: split the story into sentences, keep BERT-large layers 6 and 7 for every real token, put those vectors in one list, take the mean pairwise 1 − cosine. Higher = more divergent integration. First call downloads BERT into ~/.cache/glove-word-embeddings/huggingface.
  • WAT — mirrors the SWOW game's player feedback: typicality (mean p(response | cue) in the SWOW-EN norms; score), relevance (share of responses some human also gave), common_ground (first response is the modal human first response), fluency (responses per cue), imagery (mean concreteness), plus cue→response GloVe distance. evaluate.summarize() aggregates a session. The SWOW norms (CC BY-NC-ND) and concreteness norms are not bundled: download them and pass the paths as norms= and concreteness=.

All will use glove-word-embeddings, default model glove-840b-300d for CAT and DAT. The first evaluate() call downloads the embedding file and caches it under ~/.cache/glove-word-embeddings; later calls are offline. Other keys (glove-6b-300d, wiki-news-300d-1m, the flair-olson-* set, …) can be passed via model_key.

Layout

automated_intelligence_tests/
    __init__.py          dispatcher: list_available_tests() / instruct() / parse() / evaluate()
    cat/  dat/           per test: instruct.py, parse.py, evaluate.py, metadata.json,
    aut/  aut_1w/  cwt/  wat/      readme.md, example.ipynb
    cat/data/cat_word_pairs_en.txt CAT word-pair list
    wat/data/swow_en_cues.txt      WAT cue list (SWOW-EN2018 cues)

Each test folder carries a metadata.json holding its short name, long name and description. That file is what list_available_tests() reads, so dropping in a new test folder with one makes it discoverable automatically. Each also has its own readme.md and a runnable example.ipynb.

License

MIT

Metadata

Release files for automated-intelligence-tests 0.1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for automated-intelligence-tests 0.1.15
File Size Uploaded
automated_intelligence_tests-0.1.15.tar.gz 161.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for automated-intelligence-tests 0.1.15
File Interpreter ABI Platform
automated_intelligence_tests-0.1.15-py3-none-any.whl Python 3 none any Details

Total release size: 325.1 kB

Release files / automated_intelligence_tests-0.1.15.tar.gz

Download URL automated_intelligence_tests-0.1.15.tar.gz
Size 161.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ae89bac1ba3b38e8a6c32233ae1b4ef5231ef04b7950f0c55b6188b49505edbc
BLAKE2b-256 checksum
How to use checksums
56d8d42cf7e0d236c99a5cc396f2923ed1f58a31bc8b441f76fd9d8d2b07ba78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.16

Release files / automated_intelligence_tests-0.1.15-py3-none-any.whl

Download URL automated_intelligence_tests-0.1.15-py3-none-any.whl
Size 164.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b25b4cec62ad27bb614d1ff429ef2e544f383aaa28c31ba27be7d063de3364e9
BLAKE2b-256 checksum
How to use checksums
3dc618566f9601321ba26606a637bbfb7c83fd497437a6a9c21209e260e78366
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.1.15 This release

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page