Duplicate intent responses with 2.5

I finally got the time to try upgrading from 2.4 to 2.5 and have found an difference that is breaking a lot of what I have in place for intent handling because it is getting multiple intent messages for the same session.

I am using slot files for handling list of things but I want the intent to return the value with a specific entity name. Instead I get two intent responses, one with the name I want and one with the slot list name. In 2.4 I used to only get the single response for the entity “info”.
An example below the common/whatsubject file has a list of things my nodered system knows about and can answer and for the what intent I want it to merely respond with intent as what and a slot for what info is asked for.

[What]
question = (what | whats | what is | whats the | what is the)

($common/whatsubject {info}) is it [in ($common/room) {room}] [please]
[please] tell me [] [is] [the] ($common/whatsubject {info}) [in ($common/room) {room}] [is]
[the] ($common/whatsubject {info}) [in ($common/room) {room}] [please]
($common/whatsubject {info}) [please]
($common/whatsubject {info}) in ($common/room) {room} [please]
how ((hot | cold | warm | cool) {info:temperature}) is it [in ($common/room) {room}] [please]
how ((humid) {info:humidity}) is it [in ($common/room) {room}] [please]

This returns two intent messages in MQTT one with entity value common/whatsubject and one with entity info. Everything else is pretty much the same, including session ids etc.
An example below if I ask “What is the date”

hermes/intent/What {“input”: “what is the date”, “intent”: {“intentName”: “What”, “confidenceScore”: 1.0}, “siteId”: “Room7”, “id”: “2f92a4c0-76c3-474c-83c3-6e0353c07020”, “slots”: [{“entity”: “common/whatsubject”, “value”: {“kind”: “Unknown”, “value”: “date”}, “slotName”: “info”, “rawValue”: “date”, “confidence”: 1.0, “range”: {“start”: 12, “end”: 16, “rawStart”: 12, “rawEnd”: 16}}], “sessionId”: “2f92a4c0-76c3-474c-83c3-6e0353c07020”, “customData”: null, “asrTokens”: [[{“value”: “what”, “confidence”: 1.0, “rangeStart”: 0, “rangeEnd”: 4, “time”: null}, {“value”: “is”, “confidence”: 1.0, “rangeStart”: 5, “rangeEnd”: 7, “time”: null}, {“value”: “the”, “confidence”: 1.0, “rangeStart”: 8, “rangeEnd”: 11, “time”: null}, {“value”: “date”, “confidence”: 1.0, “rangeStart”: 12, “rangeEnd”: 16, “time”: null}]], “asrConfidence”: null, “rawInput”: “what is the date”, “wakewordId”: null, “lang”: null}

hermes/intent/What {“input”: “what is the date”, “intent”: {“intentName”: “What”, “confidenceScore”: 1.0}, “siteId”: “Room7”, “id”: “2f92a4c0-76c3-474c-83c3-6e0353c07020”, “slots”: [{“entity”: “info”, “value”: {“kind”: “Unknown”, “value”: “date”}, “slotName”: “info”, “rawValue”: “date”, “confidence”: 1, “range”: {“start”: 12, “end”: 16, “rawStart”: 12, “rawEnd”: 16}}], “sessionId”: “2f92a4c0-76c3-474c-83c3-6e0353c07020”, “customData”: null, “asrTokens”: [[{“value”: “what”, “confidence”: 1.0, “rangeStart”: 0, “rangeEnd”: 4, “time”: null}, {“value”: “is”, “confidence”: 1.0, “rangeStart”: 5, “rangeEnd”: 7, “time”: null}, {“value”: “the”, “confidence”: 1.0, “rangeStart”: 8, “rangeEnd”: 11, “time”: null}, {“value”: “date”, “confidence”: 1.0, “rangeStart”: 12, “rangeEnd”: 16, “time”: null}]], “asrConfidence”: null, “rawInput”: “what is the date”, “wakewordId”: null, “lang”: null}

Does anyone have any ideas, or has something changed in the definition of the sentences structure?

i just took a look at the mqtt messages my rhasspy system generates.
I only get messages similar to the first message you posted on the mqtt topic hermes/intent/nameoftheintent .

This is what i get on the topic hermes/nlu/intentParsed
{
  "input": "schalte lampe aus",
  "intent": {
    "intentName": "ChangeLightState",
    "confidenceScore": 1
  },
  "siteId": "default",
  "id": "990dcfea-99a8-40f4-a7b1-a11aa0e92fbd",
  "slots": [
    {
      "entity": "lampe",
      "value": {
        "kind": "Unknown",
        "value": "lampe"
      },
      "slotName": "name",
      "rawValue": "mein licht",
      "confidence": 1,
      "range": {
        "start": 8,
        "end": 13,
        "rawStart": 8,
        "rawEnd": 18
      }
    },
    {
      "entity": "state",
      "value": {
        "kind": "Unknown",
        "value": "aus"
      },
      "slotName": "state",
      "rawValue": "aus",
      "confidence": 1,
      "range": {
        "start": 14,
        "end": 17,
        "rawStart": 19,
        "rawEnd": 22
      }
    }
  ],
  "sessionId": "990dcfea-99a8-40f4-a7b1-a11aa0e92fbd"
}

lampe is the name of the slot list and not the name of the slot.

additionaly this is what i get from the websocket
{
  "intent": {
    "name": "ChangeLightState",
    "confidence": 1
  },
  "entities": [
    {
      "entity": "name",
      "value": "lampe",
      "value_details": {
        "kind": "Unknown",
        "value": "lampe"
      },
      "raw_value": "mein licht",
      "start": 8,
      "end": 13,
      "raw_start": 8,
      "raw_end": 18
    },
    {
      "entity": "state",
      "value": "aus",
      "value_details": {
        "kind": "Unknown",
        "value": "aus"
      },
      "raw_value": "aus",
      "start": 14,
      "end": 17,
      "raw_start": 19,
      "raw_end": 22
    }
  ],
  "slots": {
    "name": "lampe",
    "state": "aus"
  },
  "text": "schalte lampe aus",
  "raw_text": "schalte mein licht aus",
  "tokens": [
    "schalte",
    "lampe",
    "aus"
  ],
  "raw_tokens": [
    "schalte",
    "mein",
    "licht",
    "aus"
  ],
  "wakeword_id": null,
  "siteId": "default",
  "sessionId": "9ecdabe0-2b0d-4601-9b15-fa6a953b83ae",
  "customData": null,
  "wakewordId": null,
  "lang": null,
  "_session": {
    "type": "websocket",
    "id": "4fc4aa74.9292f4"
  },
  "_msgid": "d2ac38f1.c3f4e8"
}

Are you using a setup with a satelites and a shared mqtt broker ?

Yes, a satellite with a mosquitto MQTT broker.

It’s not the name of the intent that is the problem though. This is the same for both messages.

The problem I get appears to be becuase I use the slot list, in the case above common/whatsubject and then specify a name {info} for this when I use it, because I may have a number of lists but want a single entity name of info returned for the value that is returned.

Does your sentence have a structure like this in it?
($common/whatsubject) {info}
which should give a single response for the slot “info” and value taken from the slot list, or do you just use ($lampe) ?

In both records on my system I get the slot name info is returned but it gives two records with different values for entity (which I don’t actually care about) but because it returns two records it triggers two events for the intent handler

I’ve tried using the websocket and that is even worse as there is no difference I can see between the two messages sent.

I am going to see if I can filter one of them out reliably, but I would still prefer this to be only sending one message, not one for the slot list and one for the slot name.

What are you using for intent recognition ?
Maybe it has something to do with the satelite setup.
I have similar intents and i am not getting duplicate intent responses.

Only one NLU service is required for the whole setup. Can you check that the NLU component is disabled on your satellite?

I suspect you have 2 NLUs responding with slightly different training data…

Watch for the MQTT topic hermes/nlu/query (there should be only one) and hermes/nlu/intentParsed(there should be only one also).

If you get 2 of the first then you have 2 dialogue managers enabled (don’t think this is the case here since the slot data are different between intents)

If you get 2 of the second then you have 2 NLUs enabled (or there is a bug in the NLU code)

If you get 1 of each then there is a severe bug in Rhasspy :wink:

Hope this helps.

2 Likes

Thanks @fastjack and @moqart,

I worked out what was going wrong and I’m guessing it is a bug.
In 2.4 I was using Remote HTTP from the satellite to the master for SST and Intent recognition.
I used the same for 2.5.

The problem only happens if I use it for Intent Recognition in 2.5. If I change that to Hermes MQTT the problem goes away.

When it is set to Remote HTTP, I get 2 query and 3 intentparsed messages.