Hi everyone,
I am looking for the best approach in Salesforce to detect a chain of characters or multiple keywords with fuzzy logic. Specifically, I want to identify text patterns that have the same meaning but may not be exact matches. For example, if the text says, "Visit to the next garage is requested", I would also want to detect similar phrases like "A visit to the nearest garage is required" or "Next garage visit needed".
What are the best available options in Salesforce for this? Some considerations:
- Apex Code: Are there any built-in Apex functionalities or libraries for fuzzy matching?
- Einstein AI/NLP: Would Einstein AI or another NLP service be a better approach for this type of semantic analysis?
- SOQL/SOSL: Can SOQL or SOSL be leveraged for fuzzy searches?
- Third-Party Integrations: Are there any AppExchange solutions or external APIs that integrate well with Salesforce for this type of text processing?
I'd appreciate any insights or recommendations from the community on the best approach for this use case.
Thanks in advance!
Hi @Jean Baptiste,
Here are my thoughts:
1. Apex — no built-in fuzzy/semantic matching. You can have some options for typo-tolerance, but that wont serve the purpose for your example usecases. Apex can be skipped for this.
2. SOQL/SOSL
— SOSL gives you basic fuzzy text search (stemming, wildcards) but won't catch reordered/paraphrased meaning like your examples. Fine for simple "contains this keyword roughly" checks, not for what you're describing.
3. Einstein/NLP — this is the right layer. If data is already in Data360, then creating semantic layers could help. If data is in CRM, i suggest you to try prompt templates that could classify/compare intent semantically. I personally like Prompt Templates as they are easy to debug and work with. Much less overhead than building your own embedding/cosine-similarity layer.
4. AppExchange — a few text-analytics/NLP AppExchange packages exist but most just wrap external NLP APIs, and supposedly would incure additional costs as well.
Hope this helps.
