FindTextualAnswer[text,"question"]
question の答として最も適切であると思われる text の部分文字列を与える.
FindTextualAnswer[text,"question",n]
最も適切であると思われる答を n 個までリストで与える.
FindTextualAnswer[text,"question",n,prop]
それぞれの答に対して指定された特性を与える.
FindTextualAnswer
FindTextualAnswer[text,"question"]
question の答として最も適切であると思われる text の部分文字列を与える.
FindTextualAnswer[text,"question",n]
最も適切であると思われる答を n 個までリストで与える.
FindTextualAnswer[text,"question",n,prop]
それぞれの答に対して指定された特性を与える.
詳細とオプション
- FindTextualAnswer[text,…]の text は,文字列,テキストファイル,ContentObject式,またはこれらのテキストオブジェクトのリストでよい.
- FindTextualAnswer[text,{"question1","question2",…},…]は,それぞれの questioniに対して答を返す.
- 特性 prop は以下のいずれかである.
-
"String" 答の候補に相当する部分文字列 "Probability" 答が正しい推定確率 "Position" text 中の答の開始位置と終了位置 "Sentence" 答の候補を含む文 "Line" 答の候補を含む行 "Paragraph" 答の候補を含むパラグラフ "HighlightedSentence" 答の候補がハイライトされた文 "HighlightedLine" 答の候補がハイライトされた行 "HighlightedParagraph" 答の候補がハイライトされたパラグラフ {prop1,prop2,…} 特性指定のリスト - 次のオプションを与えることができる.
-
TargetDevice "CPU" 計算を行うターゲットデバイス PerformanceGoal Automatic パフォーマンスのどの面について最適化するか - PerformanceGoalの可能な設定には"Speed"と"Quality"がある.
- FindTextualAnswerは,統計的手法を使って答を求めようとする.テキストと質問の詳細がそのパフォーマンスに影響することがある.
- FindTextualAnswerはリソースをダウンロードすることがある.ダウンロードされたリソースは,$LocalBaseのローカルなオブジェクトストアに保存され,LocalObjects[]でリストしたりResourceRemoveで削除したりできる.
例題
すべて開く すべて閉じる例 (2)
FindTextualAnswer["Paris is the capital and most populous city of France, with a 2015 population of 2,229,621.", "How many people live in Paris?"]FindTextualAnswer["The dodo (Raphus cucullatus) is an extinct flightless bird that was endemic to the island of Mauritius, east of Madagascar in the Indian Ocean. The dodo's closest genetic relative was the also extinct Rodrigues solitaire, the two forming the subfamily Raphinae of the family of pigeons and doves. The closest living relative of the dodo is the Nicobar pigeon. A white dodo was once thought to have existed on the nearby island of Réunion, but this is now thought to have been confusion based on the Réunion ibis and paintings of white dodos.
Subfossil remains show the dodo was about 1 metre (3 ft 3 in) tall and may have weighed 10.6–17.5 kg (23–39 lb) in the wild. The dodo's appearance in life is evidenced only by drawings, paintings, and written accounts from the 17th century.", "How big was the dodo?"]スコープ (6)
FindTextualAnswer["Paris is the capital and most populous city of France, with a 2015 population of 2,229,621.", "How many people live in Paris?", 2]//TableFormFindTextualAnswer["Paris is the capital and most populous city of France, with a 2015 population of 2,229,621.", "How many people live in Paris?", 2, {"Probability", "String"}]//TableFormFindTextualAnswer["Paris is the capital and most populous city of France, with a 2015 population of 2,229,621.", {"How many people live in Paris?", "In which country is Paris?"}]FindTextualAnswer["John Smith is co-founder (with cognitive psychologist Abigail Housen) of Visual Understanding in Education, a nonprofit educational research organization that develops and studies programs that train teachers to use art to teach thinking. He is the author of several children's books about art and is co-author with Abigail Housen of an art-based elementary curriculum, Visual Thinking Strategies",
"What did John write?", 1, "Sentence"]text = "Paris is the capital and most populous city of France, with a 2015 population of 2,229,621.";FindTextualAnswer[text, {"How many people live in Paris?", "In which country is Paris?"}, 1, {"String", "Position"}]StringTake[text, {82, 90}]StringTake[text, {48, 53}]context = "The population of Paris in its administrative city limits was 2,241,346 in January 2014. Paris is the capital and most populous city of France, with a 2015 population of 2,229,621. By the 17th century, Paris had become one of Europe's major centres of finance, commerce, fashion, science, and the arts, a position that it retains still today";
questions = {"What is Paris?", "When did Paris have a population of 2.24 million?", "Why is Paris famous in Europe?"};Thread[questions -> FindTextualAnswer[context, questions, 1, "HighlightedSentence"]]//TableForm質問に対する答をContentObject式から探す:
contentObject = First@TextSearch["ExampleData/Text", "Alice", "ContentObject"]FindTextualAnswer[contentObject, "What did Alice take in her hands?", 2, {"Probability", "HighlightedSentence"}]//TableFormオプション (2)
PerformanceGoal (1)
PerformanceGoal"Quality"を使ってより正確な答を得る:
text = "The dodo (Raphus cucullatus) is an extinct flightless bird that was endemic to the island of Mauritius, east of Madagascar in the Indian Ocean. The dodo's closest genetic relative was the also extinct Rodrigues solitaire, the two forming the subfamily Raphinae of the family of pigeons and doves. The closest living relative of the dodo is the Nicobar pigeon. A white dodo was once thought to have existed on the nearby island of Réunion, but this is now thought to have been confusion based on the Réunion ibis and paintings of white dodos.
Subfossil remains show the dodo was about 1 metre (3 ft 3 in) tall and may have weighed 10.6–17.5 kg (23–39 lb) in the wild. The dodo's appearance in life is evidenced only by drawings, paintings, and written accounts from the 17th century.";FindTextualAnswer[text, "Where did the dodo live?", 1, "HighlightedSentence", PerformanceGoal -> "Quality"]FindTextualAnswer[text, "Where did the dodo live?", 1, "HighlightedSentence", PerformanceGoal -> "Speed"]TargetDevice (1)
可能であれば,デフォルトシステムのGPUを使って質問に答える:
question = "Who was the architect of the Sagrada Familia?";articles = WikipediaData /@ WikipediaSearch["Content" -> question];AbsoluteTiming[FindTextualAnswer[articles, question, TargetDevice -> "GPU"]]AbsoluteTiming[FindTextualAnswer[articles, question]]使用可能な互換性のあるGPUがない場合は,メッセージが出される:
FindTextualAnswer["You need a GPU device with recent drivers.", "What is needed?", TargetDevice -> {"GPU", 999}]アプリケーション (1)
ウィキペディアで一般的な質問の答を検索する (1)
question = "Who was the architect of the Sagrada Familia?";articles = WikipediaData /@ WikipediaSearch["Content" -> question];FindTextualAnswer[articles, question, 5, {"Probability", "HighlightedSentence"}]同じ名前が出てきた場合には,それぞれの確率とともにまとめることができる:
namesAndProbabilities = FindTextualAnswer[articles, question, 10, {"String", "Probability"}];groupedInstances = GroupBy[namesAndProbabilities, First -> Last]TakeLargestBy[groupedInstances, Total, 1]考えられる問題 (1)
FindTextualAnswerは,ある程度意味概念を理解するが,論理的に数を推測することはできない:
FindTextualAnswer["I have either 1, 2, 3, 4, or 5 eggs. I had 5 eggs, but lost 3 and then bought 2 new ones.", "How many eggs do I have?"]テキスト
Wolfram Research (2018), FindTextualAnswer, Wolfram言語関数, https://reference.wolfram.com/language/ref/FindTextualAnswer.html (2020年に更新).
CMS
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
BibTeX
@misc{reference.wolfram_2026_findtextualanswer, author="Wolfram Research", title="{FindTextualAnswer}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/FindTextualAnswer.html}", note=[Accessed: 30-October-2026]}
BibLaTeX
@online{reference.wolfram_2026_findtextualanswer, organization={Wolfram Research}, title={FindTextualAnswer}, year={2020}, url={https://reference.wolfram.com/language/ref/FindTextualAnswer.html}, note=[Accessed: 30-October-2026]}