Giter Site home page Giter Site logo

Comments (11)

oleg-fiksel avatar oleg-fiksel commented on June 16, 2024 2

Maybe we can use the role to create a unique variable name.
Example:

  • {name: "city", role: "departure"}
  • the output will be {"city_departure":{"value":"Berlin", "confidence": 0.9977127313613892}}

This will not a a breaking change but will not be obvious for a user, so we have to document it with big ‼️ 🙂

from opsdroid.

oleg-fiksel avatar oleg-fiksel commented on June 16, 2024

I checked the rasanlu matcher and found the issue.

That's what happening:

  • The entity extraction in rasanlu matcher is happening here
  • which calls the entity update function
  • which overwrites the key city in message.entities

This is common to Opsdroid in general, thatmessage.entities is a dictionary. A dictionary cannot contain duplicate entries.

Any ideas how to fix this without breaking every skill depending on it?

from opsdroid.

oleg-fiksel avatar oleg-fiksel commented on June 16, 2024

Here's the test for it: oleg-fiksel@962ecfa

from opsdroid.

oleg-fiksel avatar oleg-fiksel commented on June 16, 2024

This will also apply, when using "groups" in Rasa.

from opsdroid.

gsanasW avatar gsanasW commented on June 16, 2024

I checked the rasanlu matcher and found the issue.

That's what happening:

  • The entity extraction in rasanlu matcher is happening here
  • which calls the entity update function
  • which overwrites the key city in message.entities

This is common to Opsdroid in general, thatmessage.entities is a dictionary. A dictionary cannot contain duplicate entries.

Any ideas how to fix this without breaking every skill depending on it?

Well is it possible, that if we found multiple same entities we can return list of values & confidence?

from opsdroid.

oleg-fiksel avatar oleg-fiksel commented on June 16, 2024

I checked the rasanlu matcher and found the issue.
That's what happening:

  • The entity extraction in rasanlu matcher is happening here
  • which calls the entity update function
  • which overwrites the key city in message.entities

This is common to Opsdroid in general, thatmessage.entities is a dictionary. A dictionary cannot contain duplicate entries.
Any ideas how to fix this without breaking every skill depending on it?

Well is it possible, that if we found multiple same entities we can return list of values & confidence?

Can you provide an example how will the result look like?

from opsdroid.

gsanasW avatar gsanasW commented on June 16, 2024

I checked the rasanlu matcher and found the issue.
That's what happening:

  • The entity extraction in rasanlu matcher is happening here
  • which calls the entity update function
  • which overwrites the key city in message.entities

This is common to Opsdroid in general, thatmessage.entities is a dictionary. A dictionary cannot contain duplicate entries.
Any ideas how to fix this without breaking every skill depending on it?

Well is it possible, that if we found multiple same entities we can return list of values & confidence?

Can you provide an example how will the result look like?

yes, This is how it will look like.
{'city': {'value': ['Berlin', 'San Fransisco'], 'confidence': [0.9633104801177979, 0.7566294074058533]}}

from opsdroid.

oleg-fiksel avatar oleg-fiksel commented on June 16, 2024

I checked the rasanlu matcher and found the issue.
That's what happening:

  • The entity extraction in rasanlu matcher is happening here
  • which calls the entity update function
  • which overwrites the key city in message.entities

This is common to Opsdroid in general, thatmessage.entities is a dictionary. A dictionary cannot contain duplicate entries.
Any ideas how to fix this without breaking every skill depending on it?

Well is it possible, that if we found multiple same entities we can return list of values & confidence?

Can you provide an example how will the result look like?

yes, This is how it will look like. {'city': {'value': ['Berlin', 'San Fransisco'], 'confidence': [0.9633104801177979, 0.7566294074058533]}}

Ok, I understand. This is possible but it will be a change, which will most probably break every skill depending that value is not an array. 😕

from opsdroid.

oleg-fiksel avatar oleg-fiksel commented on June 16, 2024

I tried to reproduce your issue but after some time figured out that I need to adjust intents.yml.

version: "3.1"

intents:
  - greetings
  - bye
  - help
  - travel

entities:
  - city:
    roles:
    - departure
    - destination

nlu:
  - intent: greetings
    examples: |
      - Hey
      - Hi
      - hey there
      - hello
  - intent: bye
    examples: |
      - googbye
      - bye
      - ciao
      - see you
  - intent: travel
    examples: |
      - I want to fly from [Berlin]{"entity": "city","role":"departure"} to [San Francisco]{"entity": "city","role":"destination"}
      - I want to go from [Berlin]{"entity": "city","role":"departure"} to [San Francisco]{"entity": "city","role":"destination"}
      - I want to travel from [Berlin]{"entity": "city","role":"departure"} to [San Francisco]{"entity": "city","role":"destination"}

In your intents.yml nlu: was missing and additional examples of intens.

https://docs.opsdroid.dev/en/stable/skills/matchers/rasanlu.html#example1

Note - Rasa NLU requires an intent to have at least three training examples in the list. There must also be a minimum of two intents in your file for Rasa to train.

😉

from opsdroid.

oleg-fiksel avatar oleg-fiksel commented on June 16, 2024

What Rasa version are you using and how do you run it?

from opsdroid.

gsanasW avatar gsanasW commented on June 16, 2024

What Rasa version are you using and how do you run it?
Rasa Version : 3.3.1 Minimum Compatible Version: 3.0.0 Rasa SDK Version : 3.3.0 Python Version : 3.9.15

well, I'm training rasa model separately with rasa. and then using this model in opsdroid.

In rasa,
we can simply use rasa train command to train the model.

from opsdroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.