Skip to main content

A package for creating and analyzing narrative graphs from text corpora

Project description

narrativegraphs

Turn a collection of texts into an interactive narrative graph of entities and their relations and explore the structure of your corpus visually.

Installation

pip install narrativegraphs

Quick Start

from narrativegraphs import NarrativeGraph

docs: list[str] = [...]  # your list of documents
model = NarrativeGraph().fit(docs)
model.serve_visualizer()

Open the link in your terminal to explore the graph in your browser:

visualizer-screenshot.png

Features

  • Plug'n'play solution – get started with a few lines of code
  • Interactive browser-based visualizer – shipped with an interactive React app which can be hosted directly from Python, no extra dependencies
  • See the original contexts that extracted entities and relations appear in
  • Filter and query the graph by statistics, category, or timestamps
  • Export graph and data to NetworkX and Pandas for your own custom analyses
  • Modular structure – customize or switch out pipeline components to accommodate your use case.

Documentation

Full documentation and tutorials: kasperfyhn.github.io/narrativegraphs

Citation

If you use this package in academic work, please cite:

@software{narrativegraphs,
  author = {Fyhn, Kasper},
  title = {narrativegraphs: A Python package for narrative graph analysis},
  year = {2026},
  url = {https://github.com/kasperfyhn/narrativegraphs}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

narrativegraphs-0.3.3.tar.gz (821.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

narrativegraphs-0.3.3-py3-none-any.whl (449.2 kB view details)

Uploaded Python 3

File details

Details for the file narrativegraphs-0.3.3.tar.gz.

File metadata

  • Download URL: narrativegraphs-0.3.3.tar.gz
  • Upload date:
  • Size: 821.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for narrativegraphs-0.3.3.tar.gz
Algorithm Hash digest
SHA256 c3e6e103b7e65d80c79d588d5e168ba5995c2f8050e18a165bcdafed0fbf0388
MD5 35d1a285ce533abaf57c6a203efefddc
BLAKE2b-256 43075f338edc778fb9d6a4846ec383097822a89bc2795b3ef33c980a28bcc942

See more details on using hashes here.

File details

Details for the file narrativegraphs-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for narrativegraphs-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e39b1ae61d0bdf94153b7e119ee9c77da7ac1fae4c474c7344bdf774064dd5d8
MD5 4395dcbf742131f2b61580002ea3c272
BLAKE2b-256 2f3bc2dd181a65903ac87bf8ece82f38af5d96be5a4e6d979f1dc3bf39fad1ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page