code and the oracular

About Questionnaires and classifying/implementing them

leave a comment »

Part 1 – a brief Taxonomy

As far as I know this is fairly new

Type i questionnaires are just a linear sequence of simple, usually yes/no or 1-10 etc. questions placed, say, onto a single web form. They may result in a string of digits representing the answer set and are easy to implement.

Type ii questionnaires are more subtle because the sequence of the questions is a tree where different branches of question sequences from the whole tree are selected based on previous answers. This allows for what are called contingency questions. Think “do you believe in a god?” if “yes” the succeeding answers ask for more theological details, if “no” the succeeding questions ask the nature of the persons non-theistic beliefs, eg about the nature of the universe they believe in. Once a branch has been chosen the sequence stays type i for a while, until it hits another branch point.

Type iii would be the best currently possible with ai techniques and might have a set of heuristics for generating semantically more “obvious” questions from the previous answers. Think: “do you like the Beatles?” … “yes” “do you like the Rolling Stones too then?” (place entity from answer in a taxonomic tree and then repeat previous question structure subsituting a cousin entity from the tree). Some parts might be type ii in between the smart bits. A chatbot with this built in would be nice.

Type iv is full ai on a questionnaire. There is a huge improvement in the granularity and richness permitted for both the answers and the questions. The amount of information harvested is big enough for in-context questions to be generated on the fly as an inference engine computes where to go next based on previous answers, and other bits of context like date and location etc. Some parts may be type iii but the overall performance is an intelligent level Think :”do you like the Beatles”… “when were you born?”… “did you ever go to one of their gigs, you were the right sort of age?”… “did you know that you live quite near Abbey Road?” “do you find they defined most subsequent rock or do you think the development of the genre owes debt to all bands more equally ?” Rudy Rucker’s Lifebox would need this. a chatbot that had this as a feature might pass Turing.

using Python + CGI for a type i with at least some interesting behaviour

I get three yes/no answers about a potential legal case and save the three as a bit-string in a text file. Then I build a paragraph of text by taking sentences that correspond to each of the three bits, in order. There are several choices for each sentence which random.choice() picks. I interpolate three randomised padding sentences, nicely full of universal generality, and present the result. It could be even simpler if I put all questions on one page but I ended up wanting it to feel like a clear sequence for the user with one at a time. Yes, it only later occurred that I could still have a sequence on one page by using an Iframe noscroll and putting a next button linked to an anchor beneath all but the last question. Never mind.

By my calculation this system yields one of 2 *5 *2 * 5 *2 *5 * 5 * 5 *5 =125,000 possible outputs. Oh the beauty of good humble old combinatorics ! This is really a very simple toy but maybe people will want to build on it. It runs → here . I’ll share code on receiving interested comments.

Next I will take every possible pair of answers (3 choose 2 = 3) and add a sentence to cover each case, so that synergistic and holistic variations in the input data can reflect finer targeting of the output to context. If the data was pluggable I might think of trying a proper version of this with subjects like nutrition, health, software development etc.

do the math to see how much variation you could get with 20 questions !

Making a type ii

I am currently working on this (…) wondering about the best way to create the tree of questions and answers. I want to make the question and answer data a module that you can pull out and plug in. Then users can customise subject and responses without needing to change the code.

The Hard Bits

I issue a call for challenges for examples of a type iii. Type iv dreaming is encouraged too.


Written by Luke Dunn

June 26, 2012 at 3:27 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: