Ideas to check if a given sentence A is the response to a query B
So, I gathered that your question is about how to evaluate whether a sentence A is a response to a given question Q or not.

Drawing from knowledge of question-answer systems, you can evaluate whether a sentence responds to question Q by comparing the underlying lambda calculus (essentially translates language meaning into a logical, more computation-looking form - https://www.cl.cam.ac.uk/teaching/1314/NLP/slides6.pdf) which make both the question Q and a response A.

To get the lambda calculus for a question Q or response A, we can use an encoder-decoder model to generate these. 
In an encoder-decoder network architecture, we simply encode input (e.g. question Q using an RNN/LSTM) information into a "hidden representation", which we then subsequently decode into our desired output (e.g. Lambda Calculus, using an RNN/LSTM). This process is actually called semantic parsing and here are a couple of papers which do this and label the architectures they used to generate these, including:


https://www.aclweb.org/anthology/P16-1004/
https://www.aclweb.org/anthology/P18-1068/


Maybe this can be an implicit way of comparing the questions with the responses, by then looking at similarities in their lambda calculus.