I am currently working on an Android a.i. app. I am aware of the algorithm how to make random sentences in A.I.
Is there any way or algorithm to make those sentences sarcastic?
Artificial Intelligence Stack Exchange is a question and answer site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment. It only takes a minute to sign up.Sign up to join this community
A simple form of sarcasm involves a direct reversal of the literal meaning of the statement, eg "Great weather we're having" (during a thunderstorm), "just what I needed" (when something goes wrong).
The problem with doing this in random sentences is that you may have no context to establish the reversal of the literal meaning.
You could possibly construct them by using a template along the lines of "Just what I needed - (random bad thing happened) today"
Or, when an outcome of a process is calculated, if it is not the desired outcome, instead of returning "mission unsuccessful" or "mission not yet complete", the AI could say "you're having a great day, aren't you? - mission unsuccessful" or "great work, genius - mission not yet complete".
Most random sentences will not be suitable for sarcasm, so it could only be applied in specific circumstances.
It is not clear from your question what the context is for these random sentences, and therefore it is not clear whether that context would be suitable for sarcasm at all.
You could also build a database of sarcastic sentences, especially from, for example historic plays. And then train your software to recognize patterns of those sentences.
E.g. grammatical constructions/order, length (or circomstances building up to the sarcasm).
And use that database as starting point, with feedback to learn, or you could use the above method to improve your effective output.
Another approach would be to use a similar but reverse approach; study those databases and build an equivalent output based on the coherence, and then extrapolate the output-generation procedure. (In combination with other methods)