FindTextualAnswer

FindTextualAnswer[text,"question"]

gives the substring of text that best appears to answer question.

FindTextualAnswer[text,"question",n]

gives a list of up to n answers that appear most probable.

FindTextualAnswer[text,"question",n,prop]

gives the specified property for each answer.

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
  • 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 all

Basic Examples  (2)

Answer a question from a sentence:

In[1]:=
Click for copyable input
Out[1]=

Answer a question from a paragraph:

In[1]:=
Click for copyable input
Out[1]=

Scope  (6)

Options  (1)

Applications  (1)

Possible Issues  (1)

See Also

WolframAlpha  TextCases  TextSearch  WikipediaSearch  WebSearch  EntityValue

Introduced in 2018
(11.3)