0
$\begingroup$

I have this function which works fine:

answer[question_, numberofanswers_] := 
 WriteString[CreateFile[StringJoin[question, ".csv"]], 
  ExportString[
   Prepend[FindTextualAnswer[
      WikipediaData /@ WikipediaSearch["Content" -> question], 
      question, 
      numberofanswers, {"Probability", "String", 
       "HighlightedSentence", "Sentence", "Paragraph", "Line", 
       "HighlightedLine", "HighlightedParagraph" }], {"Probability", "Answer", 
      "Highlighted Sentence", "Sentence", "Paragraph", "Line", 
      "Highlighted Line", "Highlighted Paragraph" } ] /. 
    r_Row :> ToString[r], "CSV"]]

answer["What equation occurs frequently across all natural phenomena ?", 100]

But when I add 'Performance Goal' to "FindTextualAnswer" as an option like so:

answer[question_, numberofanswers_] := 
 WriteString[CreateFile[StringJoin[question, ".csv"]], 
  ExportString[
   Prepend[FindTextualAnswer[
      WikipediaData /@ WikipediaSearch["Content" -> question], 
      question, 
      numberofanswers, {"Probability", "String", 
       "HighlightedSentence", "Sentence", "Paragraph", "Line", 
       "HighlightedLine", "HighlightedParagraph" }, 
      PerformanceGoal -> "Quality"], {"Probability", "Answer", 
      "Highlighted Sentence", "Sentence", "Paragraph", "Line", 
      "Highlighted Line", "Highlighted Paragraph" } ] /. 
    r_Row :> ToString[r], "CSV"]]

(Which seems to be an option) The words "PerformanceGoal" and "Quality" are highlighted in red, and the exported CSV, instead of exporting multiple rows as it previously did, it now exports everything in one row like so:

Exported CSV file

I'd like to return it to its previous format which looked like this:

enter image description here

enter image description here

While preserving PerformanceGoal -> "Quality"

(I don't know why it's got these weird jumps between the numbers)

I'm using Mathematica version 12.0

When I look at my documentation I don't find the PerformanceGoal option, does this mean I can't access it on my version?

$\endgroup$
1
  • $\begingroup$ The PerformanceGoal option was added in 12.1. $\endgroup$ – Rohit Namjoshi Jun 22 '20 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.