views:

271

answers:

7

The following is a survey given to course attendees to assess an instructor at the end of the course.

Communication Skills
1. The instructor communicated course material clearly and accurately.
Yes No
2. The instructor explained course objectives and learning outcomes.
Yes No
3. In the event of not understanding course materials the instructor was available outside of class.
Yes No
4. Was instructor feedback and grading process clear and helpful?
Yes No
5. Do you feel that your oral and written skills have improved while in this course?
Yes No

We would like to summarize each attendees selection based on the choices chosen by him.

If the provided answers were [No, No, Yes, Yes, Yes]. Then we would summarize this as "The instructor was not able to summarize course objectives and learning outcomes clearly, but was available and usually helpful outside of class. The instructor feedback and grading process was clear and helpful and I feel that my oral and written skills have improved because of this course.

Based on the selections chosen by the attendee the summary would be quite different. This leads to many answers based on the choices selected and the number of such questions in the survey. The questions are usually provided by the training organization. How do you come up with a generic solution so that this can be effectively translated into a human readable form. I am looking for tools or libraries (java based), suggestions which will help me create such human readable output. I would like to hide the complexity from the end users as much as possible.

A: 

The simplest solution to this problem would be a large if else block, however that may not be what your looking for.

If you want multiple unique answers without n! if else statements, try making each answer generate one or two sentances. If you have a positive and a negative check the previous answer to and if it contrasts suffix the sentance with 'However' or something along those lines.

I hope this was helpful.

Grue
The list of survey questions will be provided by different people and hence the content of it is unknown at runtime. I am looking to see if we can apply a generic algorithm for generating this output
Joshua
Ohh, so the user creates a survey? thats more complex than i had thought. A general solution may be impossible, however you could ask the user to input what they want to ask, and have the program generate the question and the answer. that may be diffucult, but its the only solution i can see
Grue
I suppose you wanted to write 2^n, right?
ziggystar
+5  A: 

You could prepare a positive version and negative response sentence for each question. You could then connect these sentences using connecting words of supporting or contradicting nature (however, furthermore, in addition, despite this...) so that the response will be along the lines of

"the instructor communicated the course material clearly and accurately. Furthermore, the instructor explained course objectives and learning outcomes. However, In the event of not understanding course materials the instructor was not available outside of class."

and so on. All you have to do is check if the response to question n is the same as to question n-1 to decide which connecting word to use. HTH

Yuval
+1 That's actually a good idea. But you have to compare the positiveness of the meanings of that answers, not only whether they're the same. (Am I great? YES Do I suck? YES)
ziggystar
I will probably build on what @Yuval and @Ryan had to say. Thanks everyone.
Joshua
+1  A: 

Unfortunately, I don't think there is a generic solution to this problem. Not only is it hard/impossible to figure out which questions are related and how in order to group them and add words like "but," "and" and "however" where appropriate, but the wording that you are trying to generate isn't an obvious transformation. Take question 4: If the responder answered no, the resulting assertion would be "Either instructor feedback was not clear or not helpful or instructor grading process was not clear or not helpful," assuming the original question was perfectly parsed. I doubt that's what you're looking for. I would also point out that your summary, assuming it contains some form of each response, won't really be any faster for the reviewer to read. You may be underestimating both the natural ambiguity of the English language and the specificity of your desired result.

Eric Mickelsen
+1  A: 

Have you looked at any natural language processing projects, such as http://opennlp.sourceforge.net/?

Jim Kiley
not yet, will take a look at this project
Joshua
did look at this project, but it seems to support a very older version of the JDK and doesn't seem to have any new development. I wouldn't probably use this tool
Joshua
A: 

Try looking at the implementation of Matlab's "why" function as an example.

Danny Varod
I wasn't able to find more information on the why function, except for few examples on the web.
Joshua
Look at the why.m file
Danny Varod
A: 

Of course, you probably have your own reasons for wanting a feature like this, but from the design point of view I would vote strongly against this if this was my code. Writing 32 (in the worst case) different paragraphs for your example will definitely provide human-readable sentences for your end user and make them feel like someone is communicating to them. Trying to generate something automatically will rob you of much time and still will look too bland, especially if you end user should happen to see the survey results more than once.

Corvin
I agree with your comment here, I was just interested in obtaining the degree of automation which is possible with any tool. The generated output can be provided as an option for someone to make any corrections if necessary.
Joshua
+1  A: 

I would recommend something similar to what Yuval has proposed, with a couple of slight modifications to make the language more natural.

Preparation

You will need to create a positive version and a negative version for each statement. You will also need to sort the statements by their subject; in your example, the first four question can generate a statement about the instructor, whereas the last question should generate a statement about myself. This is important, as non-runon sentences tend to have a singular subject.

Subject: The instructor

Positive: "communicated course material clearly and accurately", "explained course objectives and learning outcomes", "was available outside of class to explain course materials", "provided feedback and grades that were both clear and helpful"

Negative: "did not communicate material clearly or accurately", "did not explain course objectives or learning outcomes", "was not available outside of class to explain course materials", "did not provide feedback and grades that were clear or helpful"

Subject: I/me

Positive: "feel that my oral and written skills have improved while in this course"

Negative: "do not feel that my oral and written skills have improved while in this course"

Combining Statements

Agreeing statements

When statements 1-4 are all in agreement (either all positive or all negative), you only need to combine them in a very simple manner: "The instructor {statement1}, {statement2}, {statement3} and {statement4}."

If statement 5 agrees with statements 1-4, finish it off with: "Overall, I {statement5}"

If statement 5 disagrees, finish it off with: "However, I still {statement5}"

Disagreeing statements

The tricky stuff happens when some of the statments are positive and some are negative. The end result will need to look like: "The instructor {statement1} and {statement2}, but {statement3} and {statement4}. Overall, I {statement5}."

We essentially have 2 groups of statements; in my example, statements 1 and 2 are in the first group, statements 3 and 4 are in the second. To make this work, the groups should contain agreeing statements; each group should be all positive or all negative. Reorder the statements to put each groups in agreement. We will then combine the group statements like so: "The instructor {group_statement}, but {other_group_statement}"

If there is only 1 statement in a group, use the individual statement as the group statement. When there are multiple statements in a group, link all statements except the final statement with a comma. Link the final statement in the group with an "and"

The use of the English 'but' tends to put more emphasis on what comes after it than before it: if we finish with the positive group, the whole statement sounds positive, and if we finish with the negative group, the whole statement sounds much more negative. It will be up to you to decide how you want to emphasize the statements, but I would recommend ordering it so that it agrees with statement 5 and finishing off with "Overall, I {statement5}". If you decide to order it in a way that disagrees with statement 5, you should end with "However, I still {statement5}".

That should get you started, and you can make a few modifications as necessary.

Ryan
Thanks Ryan, this is helpful
Joshua