Create and inspect
The basic workflow of creating and inspecting a narrative graph is:
- Import
narrativegraphs. - Prepare your documents as a list of strings.
- Initialize a model and fit it on your docs.
- Serve the visualizer, follow the link, and inspect your docs visually.
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:
