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 — extract entities, relationships, 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 – no extra dependencies
  • See the original contexts that entities and relations appear in
  • Customizable pipeline components for different use cases
  • Filter and query the graph by statistics, category, or timestamps
  • Export graph and data to NetworkX and Pandas for custom analyses

Documentation

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

License

MIT

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for narrativegraphs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 96d2b0bbe1b4c3e2d872e8482aa672f4105b3b1eb16c486f34aa5f9b98c158d1
MD5 e7683c791ff798e1fb7ce8e5d47e5c6e
BLAKE2b-256 bb4497e5301113b516ea78157605e64531a4886e5a951e78f3ff25512994cf0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativegraphs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bee17197822054cf03349d54d77129b3710bf5dcb838ec03d11a15fef2f9d472
MD5 a805150913d56170d20a814c301c32cf
BLAKE2b-256 8f9bda5b091534bd53cabc912b67bfecaf1c9f4f2f7103d48374d12c50505c22

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