What are Synonyms

Background - What are synonyms

“Synonyms are two or more words which have the same meaning.”

High level, Answers can recognize when a query includes a synonym (or synonyms), and will use the synonyms in determining which results to return.

You can add “synonyms” to your Answers experience (today, via the config). As an example, say a client had an entity for “Healthcare professional”, but they know people will search for “Doctor”. They can add a synonym from “Doctor” to “Healthcare professional”. If a user searched “doctor”, Answers will return “healthcare professional”, assuming the correct inferred filters are in place.

How do Synonyms work today

One-way synonym

Throughout this explanation, we’ll use the following example.

Example
Original Search Term: “Career information”
Synonyms: “career” → “Job”,

  1. For a single query, we take each word, and every combination of sequential words, and check if a synonym exists for that phrase. Using the synonyms that are defined in the backend configuration, the algorithm produces “expanded” versions of the query - i.e. replacing the parts of the query with matching synonyms.

Example
Expanded Search Terms:
“Career information”
“Job information”

  1. Find Potential Matches using natural language processing: Answers then conducts a search using the expanded versions of the search term. In looking for matches, it searches across textSearch and NLP searchable fields (textSearch was added as of late 2019).

Example
Answers searches all verticals for both “career information” and “job information”, and pick the best matches

  1. Return the Best Results: The Answers Algorithm determines the best results and returns them. This might be a match for the original search term (“career information”), or for any of the expanded search terms (“job information”).

  2. Conduct Full Text Search: Return other entities using full text search from the original search term (just as if the synonyms weren’t there)

Example
Answers searches all verticals for textSearch matches on “job information”.

Two-Way synonym

These work as one-way synonyms, the expansion simply happens in both directions.

Limitations

  • Chaining: If you have a synonym from A → B and a synonym from B → C, searching A will not also yield C

Updates

  • Place Names: If you have a synonym that maps a phrase to a place name, it will now expand to that place name
  • textSearch used in synonyms: We previously only searched across NLP searchable fields for any expanded search terms. We now also search across textSearch fields.
1 Like

Hey @roser! This is great information. Any chance you can expan upon exactly how two-way synonyms work?

Nevermind - I looked into this and confirmed that synonym sets just create one-way synonyms for all permutations of the set. Feel free to expand if you like but it sounds like everything you wrote above applies!