Skip to content

Commit

Permalink
fix: adjust adapt confidence levels
Browse files Browse the repository at this point in the history
maybe fixes #417

handle bad pipeline requests based on chat feedback

```
2024-02-24 18:20:09.365 - skills - ovos_core.transformers:transform:60 - DEBUG - ovos-utterance-normalizer: {'client_name': 'ovos_dinkum_listener', 'source': 'VoiceSatelliteV0.3.0:192.168.2.222::53c07e5b-e6a9-4467-bc5b-283842693997', 'destination': ['skills'], 'transcription': 'wie spät ist es', 'session': {'active_skills': [], 'utterance_states': {}, 'session_id': '53c07e5b-e6a9-4467-bc5b-283842693997', 'lang': 'en-us', 'context': {'timeout': 120, 'frame_stack': []}, 'site_id': 'unknown', 'pipeline': ['stop_high', 'converse', 'padatious_high', 'adapt_high', 'fallback_high', 'stop_medium', 'padatious_medium', 'adapt_medium', 'adapt_low', 'common_qa', 'fallback_medium', 'fallback_low'], 'stt': {'plugin_id': 'ovos-stt-plugin-server', 'config': {}}, 'tts': {'plugin_id': 'ovos-tts-plugin-server', 'config': {}}}, 'peer': 'VoiceSatelliteV0.3.0:192.168.2.222::53c07e5b-e6a9-4467-bc5b-283842693997', 'lang': 'de-de'}

2024-02-24 18:20:09.369 - skills - ovos_core.intent_services:handle_utterance:348 - ERROR - 'adapt_high'

Traceback (most recent call last):

  File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_core/intent_services/__init__.py", line 313, in handle_utterance

    for match_func in self.get_pipeline(session=sess):

                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_core/intent_services/__init__.py", line 238, in get_pipeline

    return [matchers[k] for k in pipeline]

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_core/intent_services/__init__.py", line 238, in <listcomp>

    return [matchers[k] for k in pipeline]

            ~~~~~~~~^^^

KeyError: 'adapt_high'

2024-02-24 18:20:09.464 - skills - ovos_bus_client.client.client:on_default_session_update:161 - DEBUG - synced default_session

```

Update requirements.txt
  • Loading branch information
JarbasAl committed Feb 24, 2024
1 parent dfe32ff commit bb12475
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ovos_core/intent_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ def get_pipeline(self, skips=None, session=None):
"ocp_fallback": self.ocp.match_fallback})
skips = skips or []
pipeline = [k for k in session.pipeline if k not in skips]
if any(k not in matchers for k in pipeline):
LOG.warning(f"Requested some invalid pipeline components! "
f"filtered {[k for k in pipeline if k not in matchers]}")
pipeline = [k for k in pipeline if k in matchers]
LOG.debug(f"Session pipeline: {pipeline}")
return [matchers[k] for k in pipeline]

def _validate_session(self, message, lang):
Expand Down
6 changes: 3 additions & 3 deletions ovos_core/intent_services/adapt_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def __init__(self, config=None):
self.max_words = 50 # if an utterance contains more words than this, don't attempt to match

# TODO sanitize config option
self.conf_high = self.config.get("conf_high") or 0.95
self.conf_med = self.config.get("conf_med") or 0.8
self.conf_low = self.config.get("conf_low") or 0.5
self.conf_high = self.config.get("conf_high") or 0.8
self.conf_med = self.config.get("conf_med") or 0.5
self.conf_low = self.config.get("conf_low") or 0.3

@property
def context_keywords(self):
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ adapt-parser>=1.0.0, <2.0.0
ovos-utils>=0.0.38
ovos_bus_client<0.1.0, >=0.0.8
ovos-plugin-manager<0.1.0, >=0.0.25
ovos-config~=0.0,>=0.0.13a6
ovos-config~=0.0,>=0.0.13a8
ovos-lingua-franca>=0.4.7
ovos-backend-client~=0.1.0
ovos-workshop<0.1.0, >=0.0.15
Expand Down

0 comments on commit bb12475

Please sign in to comment.