Complex conditional text: compare values, spit out sentences
April 4, 2014 1:12 PM Subscribe
I have a project where I am tasked with presenting many data points, 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!"
posted by BleachBypass to Computers & Internet (4 answers total) 1 user marked this as a favorite
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 significantly 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%).
I'll be outputting in InDesign but I get the sense that this is a completely different beast from ID's conditional text feature is designed to address.
I understand there would most likely be scripting involved, and so I think 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'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?