1 Reply Latest reply on Apr 8, 2014 3:42 PM by Trevorׅ

    Complex conditional text: compare values, spit out sentences

    Dsastray

      I have a project where I am tasked with presenting many data sections, and need to have a comparative sentence or two before each section featuring the highlights of the data. "In this section, X is the highest value!" I'll be using linked text fields in InDesign but this is a completely different beast from what ID's conditional text feature is designed to address.

       

      So say I have fields N1, N2, N3, N4 and my desired output text (italics being comparative language determined by N3 & N4).

       

      "marijuana","sixth grade" 14%, 6% : "Student use of marijuana in the sixth grade (14%) was higher than the sixth grade rate for the state (6%).

      "alcohol","overall" 30%, 32% : "Student use of alcohol overall (14%) was about the same as the overall rate for the state (32%).

       

      As there would most likely be scripting involved, I asked here. I am also looking for some keywords to help me find out more about this type of thing. (I could kludge something together with an If/Then/Else approach but I'm hoping for a more rigorous/robust method.)

       

      (I'm also wondering whether it even makes sense to accomplish any of this in Indesign.)

       

      I've seen a million reports generated by psychiatric evaluation reporting modules that are designed to spit out automated patient reports in this sort of natural language, but so far the keywords for understanding more about the subject elude me. Googling "conditional text", "natural language generation," "data-to-text" all get me tons of less-than-relevant results. ("conditional sentences" = judicial drug law reform!) Can anyone provide me an insight to what these types of algorithms are even called?