Giter Club home page Giter Club logo

Comments (4)

NathanC avatar NathanC commented on June 18, 2024

Yeah, this doesn't meet hermes spec. I think parsers of hermes should explicitly be tolerant of additional fields (or a standardized custom or something)-- the issue here isn't the kind field addition but the fact that slots used to contain a "values" json object that had "value" and "rawValue" iirc, though the reference is vague on the slots field structure.

I just updated my parser to deal with the change. I'm not married to a protocol from a service that decided to become more closed-- but if the spec is changed it should probably be another major version or forked/renamed. It would give rhasspy more creative freedom to control the spec's future, but not sure who all the consumers of the spec are or if anyone is currently considered an authority on it, and having a shared protocol is really important. If Snips was the only authority and now there's a vacuum, it could make sense to explicitly fork it as a community project and have a github repo for it. @synesthesiam wdyt?

Does anyone have a mirror of the protocol link from the old snips wiki? Found it as a dead link when researching this, but not sure if it had a more detailed spec and can't find it in the Wayback Machine.

from rhasspy.

manju-rn avatar manju-rn commented on June 18, 2024

I see some fix has been done. However, looks like the fix is partial. The JSON object retrieved from the UI looks okay (does not have 'kind': 'Unknown') but is quite different from the ones seen in the log. And it is this value seen in log that is sent to HA and is wrong. i.e, the value of value={'kind': 'Unknown', 'value': 'on'} is still sent, this should just be value=on Can we have the same fix done to the actual values being sent to HA?

Please see both the data

JSON from UI

    "entities": [
        {
            "end": 6,
            "entity": "state",
            "raw_end": 6,
            "raw_start": 4,
            "raw_value": "on",
            "start": 4,
            "value": "on"
        }
    ],
    "intent": {
        "confidence": 1,
        "name": "FanControl"
    },
    "raw_text": "fan on",
    "raw_tokens": [
        "fan",
        "on"
    ],
    "recognize_seconds": 0.1324244789993827,
    "slots": {
        "state": "on"
    },
    "speech_confidence": 1,
    "text": "fan on",
    "tokens": [
        "fan",
        "on"
    ],
    "wakeword_id": null
}

Values from the logs
[DEBUG:2020-04-11 15:41:48,430] rhasspyhomeassistant_hermes: <- NluIntent(input='fan on', intent=Intent(intent_name='FanControl', confidence_score=1.0), site_id='default', id='xxxxx', slots=[Slot(entity='state', value={'kind': 'Unknown', 'value': 'on'}, slot_name='state', raw_value='on', confidence=1.0, range=SlotRange(start=4, end=6, raw_start=4, raw_end=6))], session_id='xxxx', custom_data=None, asr_tokens=[[AsrToken(value='fan', confidence=1.0, range_start=0, range_end=3, time=None), AsrToken(value='on', confidence=1.0, range_start=4, range_end=6, time=None)]], asr_confidence=None, raw_input='fan on', wakeword_id=None)

from rhasspy.

synesthesiam avatar synesthesiam commented on June 18, 2024

I've moved the extra details of the value (kind, unit, etc.) into a "value_details" property.

from rhasspy.

manju-rn avatar manju-rn commented on June 18, 2024

Confirm & tested it is working fine. The JSON sent to HA is correct now. However, the debugger logs still seem to show old values

value from logs

[DEBUG:2020-04-16 12:39:39,482] rhasspyserver_hermes: <- NluIntent(input='fan swing', intent=Intent(intent_name='FanControl', confidence_score=1.0), site_id='default', id=None, slots=[Slot(entity='state', value={'kind': 'Unknown', 'value': 'swing'}, slot_name='state', raw_value='swing', confidence=1.0, range=SlotRange(start=4, end=9, raw_start=4, raw_end=9))], session_id='default-xxx-xxx', custom_data=None, asr_tokens=[[AsrToken(value='fan', confidence=1.0, range_start=0, range_end=3, time=None), AsrToken(value='swing', confidence=1.0, range_start=4, range_end=9, time=None)]], asr_confidence=None, raw_input='fan swing', wakeword_id='Jarvis')

from rhasspy.

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.