FindTextualAnswer
✖
FindTextualAnswer
gives the substring of text that best appears to answer question.
Details and Options

- In FindTextualAnswer[text,…], text can be a string, a file with plain text, a ContentObject expression or a list of these text objects.
- FindTextualAnswer[text,{"question1","question2",…},…] gives answers for each of the questioni.
- The property prop can be one of the following:
-
"String" substring corresponding to candidate answer "Probability" - estimated probability that the answer is correct
"Position" - start and end positions in text of the answer
"Sentence" sentence containing the candidate answer "Line" line containing the candidate answer "Paragraph" paragraph containing the candidate answer "HighlightedSentence" sentence with candidate answer highlighted "HighlightedLine" line with candidate answer highlighted "HighlightedParagraph" paragraph with candidate answer highlighted {prop1,prop2,…} a list of property specifications - The following option can be given:
-
TargetDevice "CPU" target device on which to perform the computation PerformanceGoal Automatic which aspects of performance to optimize - Possible settings for PerformanceGoal include "Speed" and "Quality".
- FindTextualAnswer uses statistical methods to try to find answers. Details of the text and question can affect its performance.
- FindTextualAnswer may download resources that will be stored in your local object store at $LocalBase, and that can be listed using LocalObjects[] and removed using ResourceRemove.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (6)Survey of the scope of standard use cases
Find multiple possible answers from a text:

https://wolfram.com/xid/0ixdbxqnqybe4iq-zz1dqx

Find multiple possible answers along with their probability:

https://wolfram.com/xid/0ixdbxqnqybe4iq-2qsdi0


https://wolfram.com/xid/0ixdbxqnqybe4iq-xjkctd

Find the sentence containing the answer:

https://wolfram.com/xid/0ixdbxqnqybe4iq-9k3gsh

Get the position of the answer in the question:

https://wolfram.com/xid/0ixdbxqnqybe4iq-drzh02

https://wolfram.com/xid/0ixdbxqnqybe4iq-gzr7qo


https://wolfram.com/xid/0ixdbxqnqybe4iq-7828ke


https://wolfram.com/xid/0ixdbxqnqybe4iq-e8j6nq

Answer several questions and display the answers in context:

https://wolfram.com/xid/0ixdbxqnqybe4iq-xxeh3k

https://wolfram.com/xid/0ixdbxqnqybe4iq-7gcz44

Look for the answer to a question from a ContentObject expression:

https://wolfram.com/xid/0ixdbxqnqybe4iq-zr4y2t


https://wolfram.com/xid/0ixdbxqnqybe4iq-bg4wnd

Options (2)Common values & functionality for each option
PerformanceGoal (1)
Use PerformanceGoal"Quality" to get a more accurate answer:

https://wolfram.com/xid/0ixdbxqnqybe4iq-831cqg

https://wolfram.com/xid/0ixdbxqnqybe4iq-3pe9xe


https://wolfram.com/xid/0ixdbxqnqybe4iq-wfsbjj

TargetDevice (1)
Answer questions using the default system GPU, if available:

https://wolfram.com/xid/0ixdbxqnqybe4iq-qtd1yg

https://wolfram.com/xid/0ixdbxqnqybe4iq-sx59cg

https://wolfram.com/xid/0ixdbxqnqybe4iq-ce6gjo

The computation is typically faster than with CPU:

https://wolfram.com/xid/0ixdbxqnqybe4iq-fbm9ux

If a compatible GPU is not available, a message is issued:

https://wolfram.com/xid/0ixdbxqnqybe4iq-54b7r2


Applications (1)Sample problems that can be solved with this function
Search an Answer to a General Question in Wikipedia (1)
Display in context the possible answers from a Wikipedia search:

https://wolfram.com/xid/0ixdbxqnqybe4iq-bu7ezu

https://wolfram.com/xid/0ixdbxqnqybe4iq-6ug5kf

https://wolfram.com/xid/0ixdbxqnqybe4iq-6738y2

The instances of the same names can be grouped along with their probabilities:

https://wolfram.com/xid/0ixdbxqnqybe4iq-hsspl3

https://wolfram.com/xid/0ixdbxqnqybe4iq-98sxd

Then the one with the largest total sum of probability is probably the good answer:

https://wolfram.com/xid/0ixdbxqnqybe4iq-bjt5nc

Possible Issues (1)Common pitfalls and unexpected behavior
FindTextualAnswer is able to understand semantic concepts to some extent but is not able to use logic to guess a number:

https://wolfram.com/xid/0ixdbxqnqybe4iq-6e54lj

Wolfram Research (2018), FindTextualAnswer, Wolfram Language function, https://reference.wolfram.com/language/ref/FindTextualAnswer.html (updated 2020).
Text
Wolfram Research (2018), FindTextualAnswer, Wolfram Language function, https://reference.wolfram.com/language/ref/FindTextualAnswer.html (updated 2020).
Wolfram Research (2018), FindTextualAnswer, Wolfram Language function, https://reference.wolfram.com/language/ref/FindTextualAnswer.html (updated 2020).
CMS
Wolfram Language. 2018. "FindTextualAnswer." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/FindTextualAnswer.html.
Wolfram Language. 2018. "FindTextualAnswer." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/FindTextualAnswer.html.
APA
Wolfram Language. (2018). FindTextualAnswer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindTextualAnswer.html
Wolfram Language. (2018). FindTextualAnswer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindTextualAnswer.html
BibTeX
@misc{reference.wolfram_2025_findtextualanswer, author="Wolfram Research", title="{FindTextualAnswer}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/FindTextualAnswer.html}", note=[Accessed: 24-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_findtextualanswer, organization={Wolfram Research}, title={FindTextualAnswer}, year={2020}, url={https://reference.wolfram.com/language/ref/FindTextualAnswer.html}, note=[Accessed: 24-March-2025
]}