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.2.0.tar.gz (2.1 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.2.0-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for narrativegraphs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 50c16ed282001c353f8cedd87bbf19593648921bfc6b695aea67fa33aeda7284
MD5 e6700fcdcd1706f86226c71ed3113397
BLAKE2b-256 603d693a0b0fde641964d144a3337a8d97c5d71419571ba65f60ffc399b2c300

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativegraphs-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0274900e7c090dbaf1e87b274c3f05f64b7881e74e83a91f286b4d792d4941a2
MD5 fa046a6a7748f44b5c6733acda1fa6d5
BLAKE2b-256 e6528518833e15533bf1f9f0a906ef62fa2d148ff0d32c7c207c003684b702df

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