Introduction
Knowledge Graphs can help to abstract the information available from unstructured text. By extracting relationships from a knowledge base, you can condense the original data to its most salient information to facilitate precise search results.Anatomy of a Triplet
Relationships in Knowledge Graphs are encoded through (subject, predicate, object) triplets. By indexing these triplets, along with additional ontological information, you can make robust inferences from limited data.
Extracting Triplets
Navigate to the Triplets tool to get started. Pick a name for your triplet extraction job and upload your data formatted as a text file. Click the “Create” button to process. You’ll then be redirected to the Datasets view where you can see the progress of your triplets job. Once completed, click the name of your triplets job. You should see a preview of your triplets in a table with four columns like:Subject | Predicate | Object | Source |
---|---|---|---|
Beatles | performed | ’Hello, Goodbye’ | In a vibrant performance, the Beatles enchanted the audience with their lively rendition of “Hello, Goodbye.” |
Build a Knowledge Graph
You can use your triplets in a variety of ways, including building a knowledge graph to query. In this example, we’ll use the llamaindexKnowledgeGraphIndex
class to help us do just that. First, make sure you have the following dependencies installed: