There are many tutorials and code patterns around building a domain-specific knowledge base from a set of documents. However, stand-alone knowledge graphs are not useful if you can’t extract insights about the domain data.
We are long past the age when search keywords were just strings. Words have much richer meanings attached to them than just being a curated set of English alphabets. As an example, you might have many documents with the history of a cancer patient and you need a specific answer to questions such as when the cancer was diagnosed or what were the early symptoms of cancer. The Querying a knowledge base for documents code pattern discusses the strategy of querying the knowledge graph with questions and finding the right answer to those questions. Therefore, it is finding the intent of the question to get the right answer. The code pattern uses Watson Studio, Watson NLU, and Node-RED to provide a solution for a user who wants answers to questions related to a document.
The Entities and Relations are extracted using the Watson NLU API along with augmented rules provided by the user. A graph, also known as a knowledge graph, represents the important Entities as nodes and the relationship between these nodes as Relation edges. When someone poses a question, the question is first represented in the form of POS tags. Using chunking, we extract the nouns as Entities and the verbs as Relations. Using fuzzy logic techniques, the Entities and Relations obtained from the question are searched for in the knowledge graph table.
For more information, look at the Query knowledge base with domain-specific documents code pattern. For the entire code, check out the GitHub repo.