We’ve recently published yet another great example of how you can boost your WordPress site with Machine Learning-based features: a question answering system for WordPress build on top of the Haystack framework.
Haystack is an open-source framework for building search systems that work intelligently over large document collections. Once you load all your documents into Haystack, every time a user asks a question, Haystack follows a two-phase process:
- A Retriever selects a set of candidate documents that could potentially contain the answer to the question from all the available information. Among other options, we can rely on ElasticSearch to index the documents and return those that most likely contain the answer to the question
- A Reader applies state-of-the-art QA models to try to infer an answer from each candidate
In the post How to build a chatbot that reads all your data to find the right answer, we show how we can combine Haystack with a Xatkit WordPress chatbot. In particular, we show how to load your WP post data into ElasticSearch and then asks Haystack to infer an answer from that data every time the user question doesn’t match any of the bot pretrained questions.
This way, we can:
- Improve the usability of the bot as, even when we’re not sure, we can try to get an answer (and, in the worst-case scenario, point the user to the post/s where he is more likely to find the answer)
- Maximize the effort we put in writing those posts in the first place and reuse them as information source for the chatbot without having to rewrite them again in the form of FAQs. Of course, doing the work will produce better results, but now we have at least the option not to do so.
The post includes the information and examples to setup everything on your own using a pure combination of open-source libraries and tools but we’ll be happy if you need a more customized deployment.