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_client library, which provides the tools to interact with the Perseus API.
  • We called the build_graph method, 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?