Settings for Kaldi to send complete command

I’m quite new to Rhasspy. I’m using Kaldi, the intents are sent to Node-red.
Now I have some problems with Kaldi
I have the following sentence:
what time is it
My command is: “what time is it in London”
Kaldi sends only “what time is it” to node-red. (“in London” is skipped)
is there a way to send also “in London” to node-red?

1 Like

You have to

  • add the city info to the sentences.ini as well, and
  • (most likely) tell Rhasspy to fill a data field to hand over to your automation (node-red).

Would look somehow like:

what time is it [in (london){City}]

A very instructive video about the syntax to use in sentences.ini might be a good introduction for you, link should be found on the official docu site.

1 Like

first of all: thanks for the answer.
To be honest: I did not expect an answer any more - thus i did not check. Sorry for that!!

My problem is: add city info to sentences.ini
I can not add all cities of the world to sentence.ini

may be time was not the good example. Temperature explains my problem better.
Let’s say I have the following sentence.ini:
room_name = (livingroom | kitchen) {name}
what is the temperature in [the] <room_name>

below some examples of command and the output which I get in node red:

  • what is the temperature in the livingroom → what is the temperature in the livingroom
  • what is the temperature in the cellar-> what is the temperature in the kitchen
  • what is the temperature in london → what is the temperature in kitchen

once there is any unknown <room_name>, rhasspy sends the last name of its list (which is kitchen)

I would like node-red to make the decision, if it is a valid room (-> check sensors of HA) or anything different (-> check internet)

OK, this shows more what might be the aspects to look at:

  • you may add a so-called “slot program” for all cities around the world or use sth. called the “open transcription” mode. With both methods, you might need much more computing power, but overcome the restriction of “Rhasspy” trying to match whatever you say to whatever Rhasspy knows as sentence…
    (To my experience, it’s not always the last word in the list, but more what may be regardes as phonetical close - but indeed, sometimes the results are ridiculous…). But the more combinations Rhasspy knows as sentence, the better the results match to what might be intented.

  • second is how to organize sentences in intents and how to feed your automation in a smart way. Imo splitting things up in quite a lot of intents is not the optimal way. Instead of having “GetTemperatureInRoom”, “GetTemperatureInHeatingSystem” and “GetTemperatureInCity”, I’d just use “GetTemperature” and make the further decissions, to which type the requested data is refering to within the automation. It should be quite easy to decide wheter the sentence analysis provides a {room}, {device_name} or {city} and to use an appropriate different code, once you’re on the automation (node-red) side.

Your second point: I 10000% agree. This is exactly the reason why I want all words to be transferred to node-red.

Your first point: I am relative new to HA, Rhasspy, node-red and even docker. I was happy to make it work with the default settings on my PI4. I have no idea what “slot program” or “open transcription” means - but I will find it :slight_smile:. And the reaction of my Raspberry to much more power … we will see :thinking:.
(and yes, you are right … not always the last. only if there is no similar word in the list)

I did some reading of the docu. As of my understanding now, it is not kaldi but the intent recognition what I have to change. I’m using fsticuffs (as it is the recommended). But the docu says: “ignores unknown words”.
Should I change this?

About sentences and slot programs, I found the official video very (!) instructive: Rhasspy In Depth - Sentences - YouTube

Wrt. to “open transcription”: Afaik, this does no longer limit the recognized “raw content” to what’s defined in the sentences.ini, but may deliver text just like G**gle (etc.) would do. Feeding Rhasspy with “open” text results will change e.g. also things like the “confidence level” of the matches and so on. That’s a bit hard to explain, if you never had a look at what’s different there on the MQTT side.

Wrt. to the question about the “optimal settings” for fsticuffs, I’m also doing some testing from time to time, so I’d be happy for tipps wrt. that as well.

You are right … the video is very interesting. (but does not solve the problem with “unknown words”).

My question was not about settings for fsticuffs. It was about changing to another intent recognition system.

Anyhow … once I have some progress or new information, I will let u know

Today I did some further trial: I enabled “open transcription” in kaldi.
It works (more or less).

The sentence.ini:
what time is it

Asking “what time is it in London” results in the intent “GetTime” and the raw text “what time is it in London”.
Problem: it takes around 10 seconds :joy: :joy: