Search code examples
pythontensorflowdeep-learningrecurrent-neural-networktext-classification

Tensorflow: What's the best practice to get a section of a manual from a question?


I would like to use Tensorflow to create a smart faq. I've seen how to manage a chatbot, but my need is to let the user searching for help and the result must be the most probable chapter or section of a manual.

For example the user can ask:

"What are the O.S. supported?"

The reply must be a list of all the possible sections of the manual in which could be the correct answer. My text record set for the training procedure is only the manual itself. I've followed the text classification example, but i don't think is what i need because in that case it would only understand if a given text belongs to a category or another one.

What's the best practice to accomplish this task (i use Python)?

Thank you in advance


Solution

  • An idea could be building embeddings of your text using Bert or other pretrained models (take a look to transformers) and later compare (for instance using cosine distance) such embeddings with your query (the question) and get the most similar ones interpreting as the section or chapter containing them.