I'm currently building a fun script, that basically matches given phrases and gives a predefined response based on the match-points. You can ask it to retrieve some information based on live feeds, run tasks, tell anecdotes or just chat with her.I already have built-in detection for badwords, caps lock or both. The program has a girl name and I tried to make as close to being a girly-girl as possible, on the logic terms (for example: everybody knows that most girly-girls take 700ms to respond to a question, joking of course). So here is a little example:Client: WHAT IS YOUR PROBLEM?  Kiku: DONT USE THAT TONE WITH ME!  Client: #### you  Kiku: why are you being so mean to me :/However, I really would like to add sarcasm-feature to it. So if you write something in sarcasm, then she will detect it and respond accordingly. Now this is a tricky part, How do you teach a script, what sarcasm is?To me more specific. What are the most common sarcastic words used today? Or how to get that statistic? How can I make the script understand the context of the given phrase?UPDATEAs this question is getting alot of hype, I think things should be cleared out a bit more. It is very clear, that making a script fully detect sarcasm is basically impossible. At least in reasonable matter. However, I do believe that some amount of possible sarcasm could be detected.I currently have made it so far, that my script can detect a very limited sarcasm. I predefined some common sarcastic-words (however, alone they are useless.) For example: like, whatever, yeah, right and great. And then it first matches, the simple things, like uppercase and quoted: THANKS you are so smart or oh you are so SMART.Since the scripts main function is to do tasks or retrieve information, and afterwords it will ask if that was what you meant. Then I thought, adding thanks as a special variable. So yeah thanks or whatever thanks will trigger the possible sarcasm, and the script will ask you: Do I detect sarcasm? Your best bet would be to say sorry then, otherwise it will add a warning-point and if the limit is reached -- it will start ignoring you.As these very very simple algorithms seem to actually work, then this idea has a future, of course after alot of tuning and tweaking. However, is somebody alot smarter would make a open-source software with the same idea in mind. Then this feature could be hooked to alot of functions on the web. Customer care would probably benefit the most, however, this kind of software could also be used detecting flaggable-content.
How to teach a script to detect sarcasm?
algorithms;natural language processing
If you had a full natural language processing system and a database of facts ala the IBM Watson system, you might be able flag some statements as possible sarcasm. For example, I hear your mother has cancer and you just got fired! Yeah, isn't life wonderful! could be flagged because it could recognize that getting cancer and loosing a job are not generally described as positive experiences.I assume you don't have the resources to put together a Watson grade system. You could put together a database of commonly used sarcastic phrases, and then use some sort of text matching algorithm between the target statement and the sarcasm database. I have to guess that it won't be very effective because all the phrases that are used sarcastically are used sincerely more frequently. For example That's a nice X. is usually used sincerely, but is sometimes used sarcastically.  Sarcasm is very closely related to deception. It's not uncommon for a person using sarcasm to deny it when challenged on it, and their choice of words makes denial possible. I suspect this means that a good sarcasm detector is probably about as hard a problem as a conversational program that passes the Turing test.