When it comes to search engines, Google is the undisputed king, taking a whopping 86% of the market;
and that's not even counting a bunch of other search providers who simply buy the results from
Google, anyway. They're so far ahead of the rest that people don't even say they're going to search
for something anymore. They say they'll "Google it". Google got here by providing more relevant,
higher quality results than the competition. What's interesting is that while the exact details of
Google's algorithm are a closely guarded secret, a lot of the technologies they've used are not.
They're documented. There are papers written about them. They're open source. You can use them yourself.
You can build your own Google experience! Welcome back to The Pro Tech Show. To be clear: I'm not saying
you can create a multi-billion dollar company like Google by simply copying a few ideas. You might... but
what I'm really saying is organisations have a lot of data and finding relevant information within
that data can be a challenge. Most organisations have some kind of search feature to help with
this, and they usually suck; but they don't have to. Unfortunately it's not as simple as "Buy product X
and now you have Google." To get the most out of it you have to understand how search works and
how to make it work well. Otherwise you're just looking for words in a bunch of text like it's
the early 90s. We're going to talk about three technologies that when used together can make
a massive difference to your ability to find the right information. These technologies are knowledge
graphs, vector search, and natural language processing. I'd like to thank Pureinsights
for making this video possible; because not only did they sponsor it, they also provided a lot of the
technical insights into how all this works behind the scenes. These guys are basically search ninjas
who specialise in upgrading (or "Googlifying") the enterprise search experience, and these are the
technologies they deal with every day when they're optimising their customers' search tools. Let's kick
off with the knowledge graph. This graph thing is a phrase that seems to be popping up everywhere.
Everything's a graph, now. You can't use an API in Microsoft 365 anymore, you have to use a graph.
Same with Facebook. Obviously we're not talking pie charts so what do we mean by "graph" and how does it apply
to knowledge? Well, the short version is that a graph is a way of mapping out relationships. When
we use this for information we can model all sorts of interconnected relationships that make it a lot
more useful to answer messy real-world questions than just filing things by category can do. Let's
use an example. Suppose we ask Google for the age of the actor who plays Neo's girlfriend. Google
spits out the answer: no problem, Carrie-Anne Moss is 54 years old. But think about what we just
asked it. I didn't ask for the age of Carrie-Anne Moss. I asked for the age of the actor who plays
Neo's girlfriend. Neo is a fictional character in the movie The Matrix. Neo was played by the
actor Keanu Reeves. The character Neo is in a relationship with a character Trinity. Trinity
is played by the actor Carrie-Anne Moss. Carrie-Anne Moss was born in the 21st of August 1967, which
at the time of recording makes her 54. But I didn't tell Google that it was Carrie-Anna Moss'
age I was after. I didn't even tell Google about Trinity. Google has figured all of this out using
a knowledge graph. The graph stores information about entities like Carrie-Anne Moss, but it also
stores relationship information between different entities; which allows Google to understand and
answer complicated questions like this. Knowledge graphs aren't just limited to answering questions.
We can extend this graph and use it to make film recommendations. For example, if we think about the
genre of the film of The Matrix we could describe it as an action film, and also a science fiction. If
I was running a media streaming service and you enjoyed The Matrix I could traverse the knowledge
graph and look for other action or sci-fi films starring Keanu Reeves, and suggest them to you
as films you might be interested in. This is what the knowledge graph gives us. Information
is just a collection of data, facts. Knowledge is awareness, understanding. The knowledge graph
helps us model that understanding so instead of searching for words we can search for answers
to questions. That's the short version. I'll drop a link in the description to Pureinsight's blog
post about knowledge graphs if you want to dig a little deeper. You may notice that I used their
blog post as a bit of inspiration here. Of course not everything you search for is a question like
this so knowledge graphs are typically used in conjunction with more traditional search engine
capabilities. Essentially, you look to see "Is this a question I can use my knowledge graph to answer?" If
it is, great! If not, fall back to the next approach. That next approach might involve the use of vector
search. Vector search differs from a traditional approach to search in that it doesn't compare
literal text, but instead compares features of the text. Keyword search relies on indexing words in
the text, whereas vector search looks at the text and picks out the key features that has been
designed to look for and fills in a scorecard of sorts. This scorecard could be a list of words it's
looking for, and each time it finds one it adds to the score for that word. Each word it's looking
for is a feature and the resulting scorecard is the vector. That's a really simple example;
but rather than being a list of words it could be themes, and the resulting Vector could show
the probability of each theme appearing in the text. When you run a search, instead of looking for
results that contain the words you typed it scores your words to create a vector and it compares this
against the indexed vectors to find one that looks similar. Let's use some another film as an example.
Say you're searching for the third Godfather film and you type "Godfather 3". A basic keyword search
might struggle with that because there is no film with the text "Godfather" and the number three in it.
There is a film called "The Godfather Part III", which we recognise as Roman numerals for the number three;
but that's not what you typed. Or maybe you're searching for a place to park your car and it
comes back with a playground because you said "park" and that's a local "play park". Vector search
can help with this because it deals with features instead of literal words. The word "park" might be
the same, but the features (or themes) of car park, play park, and theme park are all quite different.
Another example could be idioms. Let's take a sentence like "killing two birds with one stone".
That's not a literal sentence, it's an idiom. When we talk about killing two birds with one stone we
mean we're achieving multiple things at the same time. It's a sentence that speaks of efficiency. If
you crawl that for keywords it's probably going to show up in searches about hunting, or animal
abuse. If we have a vector that understands the concept of efficiency, however; we can score that
sentence in its proper context. If I search for how to run an effective IT service desk with limited
resources, for example; I might be looking for vectors with high scores for "efficiency", "customer
service" and "technology". That would match text that mentions "customer satisfaction", "solving
tickets", and "killing two birds with one stone". The literal text is different but the features are
what matters. That's vector search. The interesting thing about vector search is that although there has
been a surge of solutions using it in recent years that present it as a modern technological wonder... it
was actually invented in the 1950s. To put that in context, my dad was invented in the 1950s! It's been
around for a fair old while, so why the sudden interest? Well, vector search is only as good
as its ability to understand the features of the information it's indexing. It works well provided
it understands the text but that's not always as easy as it sounds. Take our "two birds, one stone"
idiom. Vector search beats keyword search there because we have a vector that records a high match
for efficiency, but vector search alone can't do that. Without some extra secret sauce it would be
looking at the word "kill", and instead of the theme of efficiency scoring highly it would be themes
like murder, violence, or execution. Vector search as a concept has been around for a long time, but
what has changed more recently is the ability for computers to understand the way human beings
actually speak. This is all down to advancements in a subfield of artificial intelligence called
natural language processing. You use this all the time when you're searching for something on
Google, interacting with a chat bot... but one of the most obvious examples is the growth of smart voice
assistants like Siri, Amazon Echo, and Google Home. The only reason these things even work is because
of natural language processing. Voice control has existed for a long time; but it used to be really
cumbersome to say the least. You basically had to talk like a computer and then be prepared for it
to shut down your computer instead of opening Excel you asked it to. It was definitely niche...
and rubbish. Until Siri came along, anyway. I mean Siri was still pretty rubbish by modern standards
but it was a step forward and it popularised the idea enough that Amazon and Google decided it was
worth doing... but better. Natural language processing (I'm just going to call that NLP) isn't specifically
about voice. It applies to written text. It's simply about understanding human language. The reason it's
so important for voice assistants is because computers have trained us for years to type
things in command form to explicitly communicate our intent to them, but nobody actually talks like
this. Nobody speaks in Bash or Powershell. NLP is required for a computer to make any sort of sense
out of human speech, and Google's investment in NLP is one of the big reasons why their
voice assistant gained so much popularity despite being a bit late to the party. Apple had a head
start. Amazon had way more integrations than anyone else. What did Google have?
It was actually useful! You could ask it questions and it could answer them. Google had already been
using NLP to improve their ability to answer questions in search so pluging a voice assistant
into this search and using their existing natural language processing capabilities opened the door
to high quality natural conversational interaction with search. It's not perfect. It still gives the
odd stupid response; but compared to repeatedly shouting at your phone using structured commands
in your best contrived accent, only to frantically scream "Stop!" and be ignored as it calls the local
takeaway for the third time instead of your mum... It's fair to say things have improved. You
know what? This could be fun. Let me know in the comments: what is the silliest response you've
had from a voice assistant? Give me a laugh and like your favourite ones in the comments. Back
to search, though. NLP benefit search in multiple ways. One of them is natural interaction. If your
search platform understands human speech you can interact with it vocally. I know I spend far too
much time clicking through reports and documents to find answers. How much easier would it be to
plug a voice assistant into that data? Finding out how our monthly revenue is looking or if a given
project is on track could be as simple as asking Google for the weather forecast. It's not just
about voice interaction, though. Remember this whole NLP discussion started out as a tangent from vector
search and understanding idioms like "killing two birds with one stone". Our documents are full of
phrases like this because documents are written for people, not machines. Therefore, if you want to
get higher quality results when you search through them you need those vectors to be generated using
a realistic understanding of what the document is actually trying to say. Natural language processing
is the reason vector search is now so effective. It was the missing ingredient that took it from
being a nice idea to a really effective search tool. Pureinsights have a blog post on this as
well, so I'll link that also. There's links to further reading too if you really want to get
into things like cosine similarity. If you'd like to have a go with NLP yourself, there are plenty
of options out there. The big cloud providers have ready-made service offerings like Azure Cognitive
Services and Amazon Comprehend. Or you can go the open source route. In fact, Google have made a lot of
their own NLP technology open source. Until about a year ago Google's whole NLP operation for search
was using a machine learning technique known as BERT, which they open sourced back in 2018.
You can find it on GitHub along with the lighter version, ALBERT. Last year Google switched to a
new version called MUM; but both MUM and BERT are based on their transformer architecture. You can play
with this transformer stuff for free, and there's an open source platform called Hugging Face with
some free services you can use to get started. I have to be honest, though. When I heard you could
apply artificial intelligence using open source transformers... I was kind of hoping it was Optimus
Prime. As for Hugging Face... I'm just glad to hear it was named after an emoji, because I was starting
to get visions of Sigourney Weaver pointing a flamethrower at it. 80s movie references
aside, how does all of this work together? Well, working together is actually the key. There is no
one-size-fits-all answer. That's why it's useful to have experts like Pureinsights to look after your
enterprise search applications. Google aren't just using one or two techniques. They're using a whole
combination because different methods work best for different data and different types of queries.
I've been telling you how things like knowledge graphs and vector search are way better than a
boring old keyword search; but that's only partly true. Yes, they can provide much more intelligent
and relevant results. Yes, they can help you find the answer when you don't know exactly
what question you should be asking. But sometimes a back to basics keyword search is actually what
you need. A lot of you guys are IT Pros, right? Well, how many times have you Googled an error message?
How many times have you Googled an error message, today?
An error message is a pretty good example of when you want a keyword search. If I'm looking up an
error code I want results for exactly that code. I don't want results for a similar code. I don't want
a vector search that recognises I'm performing the search for malfunctioning software and decides to
show me results about other unrelated but also malfunctioning software. That would be about as
much use as those people who respond to questions on Amazon just to tell the person who asked the
question that they don't know the answer. Why do you do that!? This video has been a bit of a speed
run through search technologies and I'm aware I have skipped over a ton of detail; but rather
than a deep dive I wanted to give you a flavour of what sort of options are out there; and to let you
know this stuff isn't some kind of big secret. It's complicated, sure; but the technology is available
as are people who can help you with it. Speaking of which... if you have any questions or want to
dig into any of this in more detail then please leave a comment and I'll make sure the guys at
Pureinsights see it. I'm sure they won't mind fielding a few questions. If you're searching for your next
video, though; don't! Because if you're interested in learning about search you're probably interested
in Elasticsearch and OpenSearch and what the difference is. Luckily for you I made a
video about just that and you can watch it by clicking here. Check the video description for
links, check the like button to make sure you've clicked it, and I'll see you at the next one.