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

Suitable for categorising intents and slots? #102

Closed
silverark opened this issue Jul 24, 2021 · 2 comments
Closed

Suitable for categorising intents and slots? #102

silverark opened this issue Jul 24, 2021 · 2 comments

Comments

@silverark
Copy link

silverark commented Jul 24, 2021

Firstly, thins looks awesome! Thanks for your hard work on it.

We current have a very simple bot written in Go that our team can send messages to which we are looking to upgrade. It currently works out the "Intent" of the user based on some regex and bag of words but it's not very good!

We were looking at Rasa who let you define your Intents with examples which you can then use to train your model, but I'd rather not have a python service running in docker if I don't have to!

This is an example of the training data you could use in Rasa:

nlu:
- intent: ask_name
  examples: |
    - What is your name?
    - May I know your name?
    - What do people call you?
    - Do you have a name for yourself?

- intent: ask_weather
  examples: |
    - What's the weather like today?
    - Does it look sunny outside today?
    - Oh, do you mind checking the weather for me please?
    - I like sunny days in Berlin.

Could I implement something similar using spago with a text similarity transformer? I'm thinking I would take the users input such as tell me the weather and hopefully it will return the top 3 sentences matched from the examples I've given in the training data with a percentage match next to each one? I could the look up the intent that the sentence was a part of?

I have a couple of questions if that's OK:

  1. Is there a simper or better way that you can think of than using text similarity for this use-case?
  2. What would be really nice, is to return the intent, and also have some slots defined in the input. For the weather I could have a Location slot. Again, would the easiest thing be to run an Entity detection on the sentence once I have a Weather intent and see if I can find a location... if not I can then ask for it?

I'm happy to do some reading if you throw me some of the Buzz words I need to go read up about!

Thanks again!

Edit: Looks like Rasa has a dual purpose classifier that does the intent and Entities at the same time:
https://blog.rasa.com/introducing-dual-intent-and-entity-transformer-diet-state-of-the-art-performance-on-a-lightweight-architecture/
https://github.com/WeiNyn/DIETClassifier-pytorch

@matteo-grella
Copy link
Member

matteo-grella commented Jul 26, 2021

Hey!

Check here to see if you can find some hints. For textual similarity, I used LaBSE, but I suspect monolingual models would be more suitable for your needs.

Did you know about this paper? BERT for Joint Intent Classification and Slot Filling
It might be what you're looking for -if so, it would be worth checking out how to do the training and how to replicate the task in spaGO.

@silverark
Copy link
Author

Thanks for the feedback. I will do a bit of reading and then maybe give it a crack!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants