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.1.5.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

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

narrativegraphs-0.1.5-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for narrativegraphs-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3b3c00daef009d30e15cac2f2d706b43eb652ebd652048c821f4c233561ac052
MD5 334e3e25736346d182462f71f625e2a8
BLAKE2b-256 d141765bb5e047f46f8f705d215379e9e55819ea7419d9d2a9bc9800ba8f62d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativegraphs-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d830df9c850239a3b8a97fb7222f3221ba8039f0ed0144269791f505ada17ab0
MD5 b33e6e2558365258c39c860d365cdc8b
BLAKE2b-256 487fe8aae4b884e6f9b30613f7f58f04db017479c37b0c7feeafaa84bb5a5e79

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