Function bmos_client::parse_intent[][src]

pub fn parse_intent(line: &[u8]) -> (String, f64)
Expand description

Returns a tuple consisting of the intent’s name and its confidence, extracted from the provided json line.

Panic

The function will panic if the json string is incorrectly formatted.

Example input

Directly from voice2json:

{“text”: “hi beemo”, “likelihood”: 1.0, “transcribe_seconds”: 5.955755680000948, “wav_seconds”: 7.136, “tokens”: [“hi”, “beemo”], “timeout”: false, “intent”: {“name”: “hi_bmo”, “confidence”: 1.0}, “entities”: [], “raw_text”: “hi beemo”, “recognize_seconds”: 0.00013091099935991224, “raw_tokens”: [“hi”, “beemo”], “speech_confidence”: null, “wav_name”: null, “slots”: {}}