Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compositional_skills: Add skill for better irony detection #195

Closed
wants to merge 2 commits into from

Conversation

schuellerf
Copy link

@schuellerf schuellerf commented Mar 8, 2024

Describe the contribution to the taxonomy

The model is not really good at detecting ironic sentences

Input given at the prompt

I love cookies! I will definitely not eat any!

Response that was received

It's great to have self-control when it comes to treats like cookies! However, it's okay to enjoy them in moderation as part of a balanced diet. If you find it challenging to resist cookies, consider setting limits or finding
healthier alternatives to satisfy your sweet tooth.

Response that is now received instead

That's funny irony! It's nice to chit chat, but I should be working. Would you like me to help you with something?
For example, calculating the area of a room, converting units, or explaining a concept? Let me know how I can assist you today! Irony is quite clever, isn't it? It would be nice to have some cookies now, but maybe we can postpone that until later. What would you like me to help you with? Calculating the area of a room, converting units, or explaining a concept? Let me know how I can assist you today! I am here to help!

Contribution checklist

  • [✔] tested contribution with lab generate
  • [✔] lab generate does not produce any warnings or errors
  • [✔] all commits are signed off (DCO)
  • [✔] the qna.yaml file was linted

@schuellerf
Copy link
Author

I added one non-ironic example to reduce bias, as the generated training-set would otherwise always contain "oh that's ironic" although it wasn't

@schuellerf
Copy link
Author

Training and responses are fine now - thanks to CLI PR 374 it worked on my ThinkPad! KUDOS to @alimaredia

@obuzek
Copy link
Contributor

obuzek commented Mar 11, 2024

You're actually on to something very interesting here, but I think this skill needs some improvement. Irony, sarcasm and deception are all things that potentially LLMs could recognize and respond to correctly - but it's actually way less interesting to simply name the irony, and more interesting if the model behaves correctly in context.

Rather than trying to make up examples here, I'd encourage looking for great examples online, and thinking about how they might be used. What's the purpose of an LLM learning to detect irony? Presumably so that it can treat the ironic sentence as what is meant rather than what's said, right?

Some things I'd suggest:

  • Look up some examples rather than making them up - making things up in this category will be difficult, and there should be some good ones online. Consider writing manuals. (Cite your sources, though.)
  • Add examples of different kinds of irony. Dramatic irony? Situational? Verbal?
  • Consider expanding to include other types of deceptive language like sarcasm, which serves a similar semantic function.
  • Imagine your questions and answers are in the context of a chatbot, where, say, you'd want to correctly respond to a frustrated customer even though they're using linguistically complex wording.

Also make sure the test you use to confirm isn't literally in your training data =)

@obuzek obuzek added skill (Auto labeled) skill category: linguistics triage-requested-changes skill has been reviewed; changes requested from contributor labels Mar 11, 2024
@schuellerf
Copy link
Author

Some things I'd suggest:

* Look up some examples rather than making them up - making things up in this category will be difficult, and there should be some good ones online. Consider writing manuals. (Cite your sources, though.)

I really didn't find good examples as most of the explain "a situation" and then posing the statement what you usually don't do in a chat

* Add examples of different kinds of irony. Dramatic irony? Situational? Verbal?

I would focus on verbal irony (which my examples are I guess) because others again require a context explanation with a final saying.

* Consider expanding to include other types of deceptive language like sarcasm, which serves a similar semantic function.

As far as I understood those skills they rather should be separated but if my approach is fine I can also create a second PR with sarcasm.

* Imagine your questions and answers are in the context of a chatbot, where, say, you'd want to correctly respond to a frustrated customer even though they're using linguistically complex wording.

That's exactly my point. In this chat the customer won't explain that he is a frustrated customer and then writing the ironic sentence. (which was the normal case for the examples I found online)

Also make sure the test you use to confirm isn't literally in your training data =)
I did that actually...

Signed-off-by: Florian Schüller <florian.schueller@redhat.com>
@github-actions github-actions bot added the triage-needed (Auto labeled) skill is ready to be triaged label Mar 24, 2024
Signed-off-by: Florian Schüller <florian.schueller@redhat.com>
@ckadner ckadner added triage-follow-up and removed triage-needed (Auto labeled) skill is ready to be triaged triage-requested-changes skill has been reviewed; changes requested from contributor labels Mar 27, 2024
@russellb
Copy link
Member

Thank you very much for the contribution. This PR got flagged as having potentially political information, which is being explicitly prohibited. I'm going to close this for now, but feel free to reopen or submit a new PR if you want to rework it without any political references (running for president, for example).

@russellb russellb closed this Apr 18, 2024
@russellb russellb deleted the skill_irony branch April 18, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skill (Auto labeled)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants