AI-assisted narrative processing with human-screening — pipeline + web UI for audio/text narratives.
pip install narRaters==0.3.18 Copy PIP instructions
GitHub: github.com/xianNeuro/narRaters · PyPI: v0.3.18
🏠 Project home · 📦 v0.3.18 · 📖 Tutorial (PDF) · 🎬 Install Guide (Video) · 🎥 Required-Input Guide (Video)
narRaters (narrative + raters) is an open-source software on GitHub (xianNeuro/narRaters) that helps process complex narratives (e.g., audio book, text-based stories, interviews, conversations, etc.) for memory, language processing, causal reasoning, and LLM research.
Imagine you ran a memory study: participants listened to a story, then recalled what they remembered (spoken or typed). Before you can analyze memory, you need structured data — what happened in the story, what each person recalled, and how those pieces connect.
narRaters helps you get there. It runs common narrative-processing steps (transcribe audio, split a story into events, clean up recall text, parse recalls into clauses, match recalls back to story events, rate causal links between events) and gives you a web interface to review and fix outputs before exporting.
Works for audio or text, stories or other long narratives (including movie annotations), and human-only or human-vs-LLM workflows.
Or via terminal (Python 3.10+; no ZIP download). Run from the folder that contains your data/ and output/ directories (or set NARRATERS_PROJECT_ROOT to that path):
python --version # must show 3.10 or newer python3 -m pip install narraters --upgrade # wait for “Successfully installed” cd /path/to/your/project # folder with data/ and output/ narraters serve # browser opens to the pipeline builder Then continue with steps 2–3 above — pick your pipeline, run steps on the dashboard, review, and export.
First time? Start with the Install Guide PDF (step-by-step setup with screenshots, including how to get past macOS/Windows security prompts), then the illustrated Tutorial PDF. Or see Installation and Troubleshooting below.
① Build a pipeline → ② Dashboard → ③ Rate causal links
On GitHub, README, Contributing (research background, prompt templates, acknowledgements, author), and License are the tabs in the bar above. Use this table of contents or the Outline menu (list icon, top-right) to jump between README sections.
Needs Python 3.10+. Windows: check “Add python.exe to PATH” in the Python installer. If anything fails, see Troubleshooting.
macOS Gatekeeper or quarantine issues? See Troubleshooting.
python3 --version # must be 3.10 or newer mkdir -p ~/narRaters-demo && cd ~/narRaters-demo python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate python3 -m pip install --upgrade pip python3 -m pip install narraters --upgrade narraters serve Alternate install (command line) git clone + install.sh (project folder with bundled examples) # macOS / Linux cd ~ && git clone https://github.com/xianNeuro/narRaters.git && cd narRaters && bash install.sh :: Windows cd %USERPROFILE% && git clone https://github.com/xianNeuro/narRaters.git && cd narRaters && narRaters_installer.bat This is what narRater.app does under the hood, just without the click. git: command not found? On macOS: xcode-select --install. On Windows: install Git for Windows.
Inside the project folder, with the venv activated:
python3 -m pip install -e ".[audio]" # Whisper transcription python3 -m pip install -e ".[api]" # Anthropic / OpenAI python3 -m pip install -e ".[nlp]" # spaCy segmentation python3 -m pip install -e ".[grammar]" # grammar checker python3 -m pip install -e ".[local-llm]" # local Gemma python3 -m pip install -e ".[match]" # rmatch python3 -m pip install -e ".[all]" # api + match PyPI users: python3 -m pip install "narraters[audio]", etc.
Heavy methods (audio, local-llm, match) pull multi-GB packages — the app shows a RAM/disk preflight before downloading. Ollama (local Gemma): install Ollama, then ollama pull gemma4:e4b. API keys: copy .env.example to .env and edit (see SETUP_API.md).
install.sh already does an editable install. To work on the codebase:
git clone https://github.com/xianNeuro/narRaters.git cd narRaters python3 -m venv .venv && source .venv/bin/activate && python3 -m pip install -e . Build the standalone macOS app for icon testing: bash packaging/macos/build_app_bundle.sh. Build the slim repo-root launcher: bash packaging/macos/build_repo_app.sh.
The app runs at http://127.0.0.1:5000. First visit opens pipeline configuration; if you already saved a pipeline, you land on the dashboard.
Flow: setup → dashboard (bulk runs) → open a row to inspect, hand-correct, or compare versions.
On every page, the top-right corner has zoom in / out buttons (page zoom, like Ctrl/Cmd + / −, remembered per page), a settings gear (e.g. theme), and a ? tutorial button that starts a short interactive walkthrough of the current page. (Note: these page-zoom buttons are separate from the per-cell inspect icon on the dashboard grid.) The illustrated Tutorial PDF covers each screen in detail.
narraters serve --port 8080 --no-browser Before a step would load Whisper, Gemma via Ollama, rMatch, or other heavy local models, the UI runs a RAM / disk preflight and may suggest a lighter method (rules, test, clause) if the run looks unsafe for your machine.
After installation, place files so the paths match what you configured on the pipeline page (defaults below are relative to the project root). You can remap any step’s input/output folders there without moving data.
Want screenshots? The Data Preparation Guide PDF shows, for each input type, exactly which folder and filename to use and what the app displays once it detects the file.
Outputs are written under output/ — one subdirectory per step (output/recall_corrected/, output/recall_parsed/, output/recall_rated/, …). A smaller alternate layout lives in demo/data/ (lighthouse story, three recall .txt files).
The repository ships realistic sample inputs and outputs under data/ and output/ so you can see accepted naming and file types before adding your own study. Your private files in those folders stay untracked (see .gitignore); only the examples below are committed.
Stories: pieman_edited (story audio + transcript + events) and the_siren (transcript, events, two recall subjects).
Quick try: after install, point a pipeline at the default folders above and run sentenceCorrect → textParsing → textMatching on the_siren_sub-01 / the_siren_sub-02, or open the bundled output/ files in Excel to inspect column layouts. Story pieman_edited is useful for audioTranscribe (large .wav) and causalRating on pieman_edited_events.xlsx.
File versioning is a core feature. Automated runs write {subj_id}_{method}.ext (or {story}_… for story-level steps); your hand-edited versions are saved as {subj_id}_{ratername}-edit.ext and never overwrite the originals. The web UI lets you switch between versions via a dropdown, and the -edit files are what you export for analysis.
Six optional steps — use any subset, in any order. Each step can run automatically (rules, local models, or cloud APIs) and then be reviewed in the browser.
In typical recall work, audioTranscribe / eventSegment target the story, sentenceCorrect–textMatching each subject recall, and causalRating the story event list — but text-only projects skip Step 1, and you can equally run just eventSegment + causalRating or sentenceCorrect → textParsing → textMatching. Every step is available from the GUI or narraters CLI, has a lightweight default method, and supports hand-editing afterward.
For each step, the GUI runs the same backends as the CLI. Available methods, flags, and examples are under Command-line pipeline below.
Each of the six steps is a separate narraters subcommand with its own --method (and related options). Use the CLI for scripts, clusters, or reproducible runs—with or without the web UI, and with any subset of steps your study uses. General shape:
narraters [--method METHOD] [--model MODEL] [-i INPUT] [-o OUTPUT] [--prompt-version VERSION] ... Discover what's available at any time:
narraters --help # list all subcommands narraters --help # step-specific options narraters segment --list-prompts # list available prompt versions for a step narraters segment --list-models # list supported model identifiers The method choices below are exactly those accepted by the CLI (src/narraters/cli.py).
narraters transcribe --model large-v3 --timestamps # recall audio (default) narraters transcribe --kind story --model small # story audio instead narraters transcribe -i path/to/audio -o path/to/out # custom directories narraters transcribe --filter sub-01 # one item only Option Choices Notes --model tiny, base, small, medium, large-v2, large-v3 Whisper model name --timestamps flag Also write Excel files with word-level timestamps --kind recall (default), story Picks the conventional directories: recall = data/4_recall_audio/ → output/recall_audio-transcribed/; story = data/1_story_audio/ → output/story_audio-transcribed/ -i, --input path Input audio directory (overrides the --kind default) -o, --output path Output directory (overrides the --kind default) --filter substring Only transcribe files whose name matches this item id Requires pip install "narraters[audio]" (or pip install -e ".[audio]" from a clone). Text-only projects can skip Step 1 entirely.
narraters segment --method clause narraters segment --method api --model --prompt-version event_segment narraters segment --method fine --input data/2_story_transcript/my_story.txt Run narraters segment --list-models for the exact --model strings (Anthropic, OpenAI, and Ollama-backed presets).
narraters correct --method rules narraters correct --method gemma-ollama --ollama-model gemma4:e4b Option Choices Notes --method rules, gemma-ollama rules runs entirely locally with no model; gemma-ollama needs a local Ollama server --ollama-model e.g. gemma4:e4b Local Ollama model tag (with gemma-ollama) --prompt-file path Override the instructions file (default: scripts/prompt/spell_gram.txt) -i, --input path Single recall text file -o, --output path Output directory Minimal corrections only — Step 3 fixes spelling/grammar errors and never rewrites or paraphrases.
narraters parse --method rules narraters parse --method ollama --model gemma4:e4b --prompt-version recall_parse_clause narraters parse --filter-pattern sub-02 # process one subject only Option Choices Notes --method rules, ollama rules is the default (regex, no model); ollama uses local Gemma --model e.g. gemma4:e4b Ollama model tag (with --method ollama) --prompt-version see scripts/prompt/recall_parse_*.txt Prompt template name -i, --input path Input directory (default: output/recall_corrected/) -o, --output path Output directory (default: output/recall_parsed/) --filter-pattern substring Optional filter to process a single subject Step 5 — match (recall segments ↔ story events) narraters match --test-mode # simulated keyword matching, no model/API narraters match --method api --story-events data/3_story_events narraters match --method gemma-ollama narraters match --method rmatch # embedding matcher (requires [match]) Option Choices Notes --method test, api, gemma-ollama, rmatch test is keyword-based, free, and always available; rmatch needs pip install "narraters[match]" --story-events path Directory of {story}_events.xlsx (default: data/3_story_events) -i, --input path Recall-parsed input directory (default: output/recall_parsed/) -o, --output path Output directory (default: output/recall_rated/) --test-mode flag Equivalent to --method test — simulated matching, no API calls Step 6 — rate (causal relationships between event pairs) narraters rate --method linguistic narraters rate --method api --model --prompt-version causal_rating narraters rate --method manual # write an empty matrix for hand rating Use narraters rate --help and the Step 6 model dropdown in the web UI for supported --model values when using --method api.
from narraters import __version__, project_root print(__version__, project_root()) Direct per-step imports are planned for a future release; for now, programmatic use should call the CLI via subprocess or import the modules under scripts/.
After unzipping, everything lives under a single narRaters/ project root. Paths, contents, and naming conventions:
narRaters/ ├── README.md # This file — user guide & pipeline docs ├── CONTRIBUTING.md # Research background, prompt templates, acknowledgements, author ├── LICENSE ├── tutorials/ # User-facing PDF guides │ ├── narRater_Install_Guide.pdf # Step-by-step install (flowchart + screenshots) │ └── narRater_Tutorial.pdf # Illustrated web UI tour ├── narRater.app # macOS double-click launcher ├── narRaters_installer.bat # Windows launcher ├── install.sh # macOS / Linux installer ├── pyproject.toml # Package metadata & pip extras ├── SETUP_API.md, .env.example # API key setup │ ├── data/ # Inputs (see Where to put your data) │ ├── 1_story_audio/ # Optional Step 1 — story audio │ │ └── {story}.wav | .mp3 | .m4a │ ├── 2_story_transcript/ # Story text │ │ └── {story}.txt # plain UTF-8, one story per file │ ├── 3_story_events/ # Pre-segmented or segmented story events │ │ └── {story}_events.xlsx # columns: event, story_texts │ ├── 4_recall_audio/ # Optional Step 1 — recall audio │ │ └── {subj_id}.wav | .mp3 | .m4a | .mp4 │ └── 5_recall_texts/ # Recall text │ └── {subj_id}.txt # e.g. the_siren_sub-01.txt │ ├── output/ # Pipeline outputs (one subfolder per step) │ ├── story_audio-transcribed/ # Step 1 (story) — {story}.txt │ ├── recall_audio-transcribed/# Step 1 (recall) — {subj_id}.txt │ ├── recall_corrected/ # Step 3 — {subj_id}.txt │ ├── recall_parsed/ # Step 4 — {subj_id}_parsed.xlsx │ ├── recall_rated/ # Step 5 — {subj_id}_{method}.xlsx │ └── causal_rated/ # Step 6 — {story}_causal-{method}.xlsx │ ├── scripts/ # Pipeline backends (CLI & web UI call these) │ ├── 1_audio-transcribe.py # audioTranscribe │ ├── 2_story-event-segment.py # eventSegment │ ├── 3_spell-grammar-correct.py # sentenceCorrect │ ├── 4_parse-texts.py # textParsing │ ├── 5_recall-rater.py # textMatching │ ├── 6_causal-rater.py # causalRating │ └── prompt/ # LLM prompt templates (.txt) │ ├── event_segment.txt │ ├── spell_gram.txt │ ├── recall_parse_clause.txt │ ├── recall_rating.txt │ └── causal_rating.txt │ ├── server/ # Flask web UI │ ├── web-interface.py # Routes & subprocess orchestration │ └── START_HERE.command # macOS launcher script │ ├── templates/ # Web UI HTML (pipeline, dashboard, subject/story) ├── static/ # CSS, JS, app icon │ ├── src/narraters/ # pip package │ ├── cli.py # narraters command entry point │ ├── paths.py # Project-root resolution │ └── runtime_install.py # Bundled-example copy on first serve │ ├── helpers/ # Shared utilities & smoke tests │ ├── software_paths.py # Canonical path resolution │ ├── step_files.py # Flexible step input/output file recognition │ ├── resource_preflight.py # RAM / disk checks for heavy methods │ └── test_*.py # Pipeline validation scripts │ ├── docs/ # GitHub Pages site & README assets │ ├── index.html # Project landing page │ └── screenshots/ # README GIFs (+ recall-matching.png for site og:image) │ ├── demo/ # Smaller lighthouse example │ ├── data/ # the_lighthouse transcript + recall texts │ └── output/ # Sample outputs for the demo story │ ├── developer/ # Contributor handbook & tooling │ ├── README.md # Per-step I/O contracts & design principles │ └── SETUP_API.md # API key setup (developer copy) │ └── packaging/macos/ # App bundle / DMG build scripts └── build_app_bundle.sh Bundled examples: pieman_edited, the_siren — see Example input/output data.
Versioning: automated files use {id}_{method}.ext; hand-edited exports use {id}_{ratername}-edit.ext (never overwritten).
If you use narRaters in research, please cite the archived release.
Li, X. (2026). narRaters: Naturalistic narratives processing platform (Version 0.3.18) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.20486080
Replace the version number with the release you used (see Zenodo for the latest).
Narrative recall data were processed with narRaters (Li, 2026).
We used narRaters (Li, 2026), an open-source pipeline for transcribing, segmenting, parsing, matching, and rating narrative recall data, with human review at each step.
narRaters (Version 0.3.18) is available at https://doi.org/10.5281/zenodo.20486080.
Story events, parsed recall clauses, recall-to-event matches, and causal ratings were produced with narRaters (Li, 2026; https://doi.org/10.5281/zenodo.20486080).
See LICENSE — narRaters Research and Non-Commercial License. Free for research, education, and other non-commercial use; commercial or for-profit use requires prior written permission. Contact xianl.cogneuro@gmail.com for commercial licensing.
NarRaters Research and Non-Commercial License
causal-rating cognitive-neuroscience cognitive-science event-segmentation free-recall human-rater memory narRaters narrative nlp recall transcription
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.




