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”,
- 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”
- 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
-
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”).
-
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 acrosstextSearch
fields.