Quickstart
Get started with Perseus quickly and efficiently
After completing the installation steps successfully, run your first Perseus example to see Graph building in action. ā
Basic Usage
This minimal example shows how to build a graph from a text file using the PerseusClient.
For more details on the build_graph method, refer to the Python API.
import perseus_client
knowledge_graphs = perseus_client.build_graph(
file_paths=["path/to/your/document.txt"],
)
for graph in knowledge_graphs:
print(f"š Graph built successfully with {len(graph.entities)} entities and {len(graph.relations)} relations!")What just happened?
- We imported the
perseus_clientlibrary, which provides the tools to interact with the Perseus API. - We called the
build_graphmethod, passing in the path to our document. - The document was sent to the Perseus API service, which processed it remotely to extract entities and relationships, and build the knowledge graph.
- Finally, we printed out a success message along with the number of entities and relations returned by the API.
Wanna go further?
Generate Your First Ontology
Learn how to build and manage your first ontology directly from the console.
Generate and Visualize Your First Graph
Learn how to generate your first knowledge graph and visualize the results directly in the console.
Merge Graphs from Different Files
Learn how to combine knowledge graphs generated from various sources into a unified structure.
Save to Neo4j Database
Discover how to persist your knowledge graphs into a Neo4j database for advanced querying and visualization.