The power of Knowledge Graphs in Search

How to build a kickass search using Knowledge Graphs

Nitin Labhishetty
CodeNation Engineering
3 min readAug 8, 2018

--

Search is underrated. On average, 20% of a knowledge worker’s day is spent looking for the information they need to get their work done. That’s an entire day spent in searching from every week!

At CodeNation, we’ve taken a shot at improving search for our team and products.

One big challenge in search is understanding what the user “wants”, not just what the user “asked for”

Knowledge Graphs helped us greatly in understanding the user intent in a search query.

The problem of ambiguity

Modern languages are very advanced, yet still have a great potential in causing confusion:

“That’s not what I meant!”

This makes it super hard to search for what the user “wanted” and not what the user “asked for”. Ambiguity in search mainly stems from one word having multiple meanings. One example is python: Is the user looking for “snake” or “programming language” or “monty python”?

22 meanings of the word “Python” recognized by DuckDuckGo

This problem often occurs with abbreviations as well. NLP — “Natural Language Processing” or “National Liberal Party” or “Nucleoplasmin” ?

The problem of expression

Sometimes, the search phrase is not expressive enough to capture all results. A plain text search for btc will not return a lot of relevant results, which have content on “Bitcoin”. Try comparing the search results for btc and bitcoin on different search engines.

Often, it is useful to have more phrases e.g. semantic machines conversation ai is much more expressive than just semantic machines.

Understanding the query using Knowledge Graphs

Knowledge Graphs are awesome! Think of it like a human’s common sense and world knowledge captured in graph form. Knowledge Graph can serve as the brains behind comprehension systems. Knowledge Graph was made popular by Google, and is used in it’s search and the knowledge cards.

Google’s Knowledge Graph src.

A typical knowledge graph contains title, descriptive details and connections of various entities. Here are some examples from the Wikidata knowledge base:

{
“label”: “Scotland”,
“aliases”: [
“Alba”,
“Scotland, United Kingdom”,
“SCT”,
“Caledonia”,
“Scot”,
“Scots”,
“Scottish”
],
“id”: “Q22”,
“descriptions”: [
“country in North-West Europe, part of the United Kingdom”
],
“slug”: “scotland”
}
{
"label": "universe",
"aliases": [
"space",
"Cosmos",
"outer space",
"universe (class)",
"universe, a"
],
"id": "Q1",
"descriptions": [
"totality of planets, stars, galaxies, intergalactic space, or all matter or all energy"
],
"slug": "universe"
}

Using a Knowledge Base like this, you can solve several problems of search:

  1. Alias resolution — “Scot”, “Caledonia” point to Scotland.
  2. Word sense disambiguation — In a search for python flask, use the connections of the graph. The graph nodes of “python programming language” and “flask web framework” will be strongly connected.
  3. Abbreviation expansionNLP can be found in the aliases of Natural Language Processing node.
  4. Query expressivity — The knowledge graph gives description, aliases and closely connected concepts to a given word. For a search like Steve Jobs you can add terms like CEO and Apple to increase recall.

These enhancements can be done at query enrichment phase or baked into your index (Elasticsearch and Solr allow you to configure dictionaries). Besides enhancing the search, you can find answers to user queries from the Knowledge Graph itself. This is a non-traditional search, where it also functions as a Q&A system, and is an interesting direction to explore.

The advantage of Knowledge Graph is that it goes beyond the English language dictionary in understanding context & vocabulary. If you build an ontology of all the knowledge in your organization, then you can get domain specific enhancements.

Knowledge Graphs have a lot of potential in designing intelligent systems. We continue to be excited in exploring this idea for new product innovations.

Want to join us in developing interesting product innovations? look out for our hiring events.

--

--

Nitin Labhishetty
CodeNation Engineering

Googler, Ex-CodeNation. I love developing great products, exploring new tech, blues guitar and adventure sports.