Search by Algolia
What is B2B ecommerce? Everything you need to know
e-commerce

What is B2B ecommerce? Everything you need to know

When you think of “customer experience,” what comes to mind? People, right? Specifically, consumers. Retail customers. That’s easy; the ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is ecommerce merchandising? Key components and best practices
e-commerce

What is ecommerce merchandising? Key components and best practices

A potential customer is about to land on the home page of your ecommerce platform, curious to see what cool ...

Catherine Dee

Search and Discovery writer

AI-powered search: From keywords to conversations
ai

AI-powered search: From keywords to conversations

By now, everyone’s had the opportunity to experiment with AI tools like ChatGPT or Midjourney and ponder their inner ...

Chris Stevenson

Director, Product Marketing

Vector vs Keyword Search: Why You Should Care
ai

Vector vs Keyword Search: Why You Should Care

Search has been around for a while, to the point that it is now considered a standard requirement in many ...

Nicolas Fiorini

Senior Machine Learning Engineer

What is AI-powered site search?
ai

What is AI-powered site search?

With the advent of artificial intelligence (AI) technologies enabling services such as Alexa, Google search, and self-driving cars, the ...

John Stewart

VP Corporate Marketing

What is a B2B marketplace?
e-commerce

What is a B2B marketplace?

It’s no secret that B2B (business-to-business) transactions have largely migrated online. According to Gartner, by 2025, 80 ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

3 strategies for B2B ecommerce growth: key takeaways from B2B Online - Chicago
e-commerce

3 strategies for B2B ecommerce growth: key takeaways from B2B Online - Chicago

Twice a year, B2B Online brings together industry leaders to discuss the trends affecting the B2B ecommerce industry. At the ...

Elena Moravec

Director of Product Marketing & Strategy

Deconstructing smart digital merchandising
e-commerce

Deconstructing smart digital merchandising

This is Part 2 of a series that dives into the transformational journey made by digital merchandising to drive positive ...

Benoit Reulier
Reshma Iyer

Benoit Reulier &

Reshma Iyer

The death of traditional shopping: How AI-powered conversational commerce changes everything
ai

The death of traditional shopping: How AI-powered conversational commerce changes everything

Get ready for the ride: online shopping is about to be completely upended by AI. Over the past few years ...

Aayush Iyer

Director, User Experience & UI Platform

What is B2C ecommerce? Models, examples, and definitions
e-commerce

What is B2C ecommerce? Models, examples, and definitions

Remember life before online shopping? When you had to actually leave the house for a brick-and-mortar store to ...

Catherine Dee

Search and Discovery writer

What are marketplace platforms and software? Why are they important?
e-commerce

What are marketplace platforms and software? Why are they important?

If you imagine pushing a virtual shopping cart down the aisles of an online store, or browsing items in an ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is an online marketplace?
e-commerce

What is an online marketplace?

Remember the world before the convenience of online commerce? Before the pandemic, before the proliferation of ecommerce sites, when the ...

Catherine Dee

Search and Discovery writer

10 ways AI is transforming ecommerce
e-commerce

10 ways AI is transforming ecommerce

Artificial intelligence (AI) is no longer just the stuff of scary futuristic movies; it’s recently burst into the headlines ...

Catherine Dee

Search and Discovery writer

AI as a Service (AIaaS) in the era of "buy not build"
ai

AI as a Service (AIaaS) in the era of "buy not build"

Imagine you are the CTO of a company that has just undergone a massive decade long digital transformation. You’ve ...

Sean Mullaney

CTO @Algolia

By the numbers: the ROI of keyword and AI site search for digital commerce
product

By the numbers: the ROI of keyword and AI site search for digital commerce

Did you know that the tiny search bar at the top of many ecommerce sites can offer an outsized return ...

Jon Silvers

Director, Digital Marketing

Using pre-trained AI algorithms to solve the cold start problem
ai

Using pre-trained AI algorithms to solve the cold start problem

Artificial intelligence (AI) has quickly moved from hot topic to everyday life. Now, ecommerce businesses are beginning to clearly see ...

Etienne Martin

VP of Product

Introducing Algolia NeuralSearch
product

Introducing Algolia NeuralSearch

We couldn’t be more excited to announce the availability of our breakthrough product, Algolia NeuralSearch. The world has stepped ...

Bernadette Nixon

Chief Executive Officer and Board Member at Algolia

AI is eating ecommerce
ai

AI is eating ecommerce

The ecommerce industry has experienced steady and reliable growth over the last 20 years (albeit interrupted briefly by a global ...

Sean Mullaney

CTO @Algolia

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

As an ecommerce professional, you know the importance of providing a five-star search experience on your site or in your app. In the fast-paced world of digital marketing, the user experience, starting when someone lands on your website and ending with them leaving as a satisfied customer, is nothing short of everything.

But do you know anything about semantic textual similarity (or just semantic similarity for short) and how it helps create that first-rate information-retrieval experience for your shoppers?

It comes down to this: when someone comes searching for a product or content, they fully expect to be given relevant, personalized, fabulous search results.

Which is where semantic textual similarity (STS) comes in. It compares the similarity of two pieces of text by analyzing their underlying meaning and context. With this similarity search dataset revealing an “understanding” of the context and depth, a search engine can excel at pegging someone’s intent. And then, like a thoughtful butler, it can suggest search results that are the most likely to resonate.

What is semantic textual similarity (STS)?

So what, exactly, is this complicated-sounding similarity-task technology?

Semantic textual similarity is a key metric used to assess likeness in meaning between terms or documents. Beyond simply looking at words, it incorporates numerical descriptions that measure the strength of semantic relationships

In other words, semantic similarity is the ability of a computer system to understand the meaning of a piece of text and compare it to another. For instance, this could apply to sentence similarity. Two sentences that convey the same meaning could be phrased slightly (or significantly) differently, and the STS technology would be able to identify the similarity in their meanings.

This process is rooted in the linguistics and computer science discipline natural language processing (NLP), utilizing approaches such as word embedding. Semantic analysis is a sub-field of computational linguistics, which looks at the meanings of words and how they relate. Artificial-intelligence-aided semantic analysis technology examines vocabulary, grammar, structure, and context. 

In the same way as Siamese twins are pretty different from fraternal ones, semantic similarity is different from semantic relatedness. As Wikipedia notes, semantic relatedness “includes any relation between two terms, while semantic similarity only includes ‘is a’ relations… ‘car’ is similar to ‘bus’, but is also related to ‘road’ and ‘driving’…semantic similarity, semantic distance, and semantic relatedness all mean, ‘How much does term A have to do with term B?’ The answer to this question is usually a number between -1 and 1, or between 0 and 1, where 1 signifies extremely high similarity.”

Where is semantic textual similarity currently being utilized? Natural language understanding (NLU), sentiment analysis, and machine translation (automatically converting content to another language) are a few domains.

Determining semantic similarity

At Algolia, we use neural network–based technology to facilitate comprehension of search intent. We utilize vector search and machine learning to determine semantic similarity as part of providing the best search results. With vectors, computers make sense of terms by clustering them in n-dimensional space. They can each be located with coordinates (x, y, z), and their similarity can then be assessed using distance and angles (our post on cosine similarity has details). 

Machine-learning models determine that words near each other in vector space could be synonyms. When two pieces of content are embedded in a vector representation, deep learning helps determine the similarity. We also use a tie-breaking algorithm that uses various criteria to compare matching items.

Here are the basic steps in our process:

  1. Query understanding. NLP techniques are used to prepare and structure the search query so the search engine can analyze it. 
  2. Retrieval. In the AI search process, neural hashing is next. The search engine retrieves the most relevant results and ranks them from most to least relevant. We measure retrieval quality using precision and recall. Precision is the percentage of retrieved documents that are relevant. Recall is the percentage of all relevant documents retrieved. Both metrics help determine whether the search results are any good. 
  3. Semantic similarity measurement: Based on the extracted embeddings, the semantic similarity score, representing how closely the two pieces of text are related, is calculated.
  4. Re-ranking: Based on clicks and conversions — plus rules and personalization as they relate to the particular shopper — a dynamic re-ranking process pushes the best results to the top of the list.

Adventures in text similarity (and differences) 

Whether people are terrible at asking for what they want or know exactly how to phrase a query to zero in on their desired item, STS has their back. Here are examples of content that might be processed in STS tasks:

“Best fitness tracker for weight loss” vs. “fitness tracker for losing weight”

Consider the English phrases “best fitness tracker for weight loss” and “fitness tracker for losing weight.” At first glance, they may appear to have virtually identical meanings. However, with the help of semantic textual similarity, a search engine can delve deeper and identify slight variations in the intent. Whether the searcher is interested in the most highly rated trackers people use when they want to lose weight or simply wants to know if wearing a fitness tracker is helpful when trying to lose weight, STS is the key to displaying the most relevant results, which ultimately leads to a more satisfied user.

“Makeshift studio” vs. “homemade studio”

If content talks about a “makeshift studio” as opposed to a “homemade studio,” a savvy search engine can determine through fine-tuning whether the phrases are referring to the same concept. In this case, “makeshift” could mean something more temporary, like a setup in a living room that must be torn down in order to have people over for dinner, whereas “homemade” could mean a space that’s a bit hokey — but still permanent — in a corner of the basement.

“New York Knicks” vs. “Madison Square Garden”

Sometimes a search engine must rack its digital brain to determine whether two completely different phrases refer to the same entity. If someone is searching for information about New York Knicks games, for instance, they might only type the venue name in their query. But STS can make associations from benchmark phrases like “Home of the New York Knicks” and gather that the searcher might want to know about upcoming games.

From examples like these, it’s easy to see why semantic textual similarity is a critical component of modern search-engine skill sets.

Why is STS a no-brainer for search?

As someone steeped in all things online, you probably hear the phrase “game changing” on a regular basis, and you’re aware that some of that is simply overblown marketing speak.

In this case, however, genuine game changing is occurring, as STS fundamentally improves search-engine and recommendation system accuracy and relevance. That’s key because there’s nothing more necessary than knowing your users’ needs and ensuring that you’re getting them the right search results. Semantic textual similarity functionality supplies search relevance and satisfaction with every user interaction.

For the record, STS goes way beyond traditional keyword matching. It empowers a search engine to understand the different ways people might express the same idea, which means linguistic ambiguity and variation aren’t a possible roadblock. That hasn’t been the case with earlier-generation, traditional keyword search techniques.

This language-understanding skill is particularly important in ecommerce, where shoppers’ intent and context vary, and where online retailers must basically read shoppers’ minds in order to stay the least bit competitive. STS can also improve related recommendations by suggesting items that are semantically similar to what the person has been showing interest in.

State-of-the-art STS

Are you tasked with managing a search engine or ecommerce recommendation system?

If so, check out our NeuralSearch, which utilizes vector search in concert with neural hashes to deliver fast, accurate search results. It’s allowed us to combine the speed of traditional keyword search with the accuracy of neural search in a single API. Our technology is rave worthy at assessing user intent, context, and conceptual meaning to connect a query with the best content.

Then, let’s talk about your options for providing the best imaginable customer experience, with all the benefits that that can bring for your business.

About the author
Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Recommended Articles

Powered byAlgolia Algolia Recommend

Semantic Search: How It Works & Who It’s For
product

Dustin Coates

Product and GTM Manager

Cosine similarity: what is it and how does it enable effective (and profitable) recommendations?
ai

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Semantic search: the next big thing in search engine technology
product

Vincent Caruana

Sr. SEO Web Digital Marketing Manager