Modular INtelligent Evaluation for a Reliable Voice Assistant
Project description
Neon Minerva
Neon Minerva (Modular INtelligent Evaluation for a Reliable Voice Assistant) provides tools for testing skills.
Install the Minerva Python package with: pip install neon-minerva
The minerva entrypoint is available to interact with a bus via CLI.
Help is available via minerva --help.
Installation
If testing Padatious intents, the following system packages must be installed before installing this package:
sudo apt install swig libfann-dev
To install this package from PyPI, simply run:
pip install neon-minerva
If testing with Padatious, install with the padatious extras:
pip install neon-minerva[padatious]
Usage
This package provides a CLI for local testing of skills. Skills installed with
pip can be specified by entrypoint, or skills cloned locally can be specified
by root directory.
Resource Tests
To test that skill resources are defined for all supported languages,
minerva test-resources <skill-entrypoint> <test-file>
- <skill-entrypoint> is the string entrypoint for the skill to test as specified in
setup.pyOR the path to the skill's root directory- <test-file> is a relative or absolute path to the resource test file, usually
test_resources.yaml
example test_resources.yaml:
# Specify resources to test here.
# Specify languages to be tested
languages:
- "en-us"
- "uk-ua"
# vocab is lowercase .voc file basenames
vocab:
- ip
- public
- query
# dialog is .dialog file basenames (case-sensitive)
dialog:
- dot
- my address is
- my address on X is Y
- no network connection
- word_public
- word_local
# regex entities, not necessarily filenames
regex: []
intents:
# Padatious intents are the `.intent` file names
padatious: []
# Adapt intents are the name passed to the constructor
adapt:
- IPIntent
Intent Tests
To test that skill intents match as expected for all supported languages,
minerva test-intents <skill-entrypoint> <test-file>
- <skill-entrypoint> is the string entrypoint for the skill to test as specified in
setup.pyOR the path to the skill's root directory- <test-file> is a relative or absolute path to the resource test file, usually
test_intents.yaml- The
--padaciosoflag can be added to test with Padacioso instead of Padatious for relevant intents
example test_intents.yaml:
en-us:
IPIntent:
- what is your ip address
- what is my ip address:
- IP
- what is my i.p. address
- What is your I.P. address?
- what is my public IP address?:
- public: public
uk-ua:
IPIntent:
- шо в мене за ай пі:
- IP
- покажи яка в мене за мережа:
- IP
- покажи яка в мене публічний ай пі адреса:
- public: публічний
Test Configuration
The following top-level sections can be added to intent test configuration:
unmatched intents: dict oflangto list ofutterancesthat should match no intents. Note that this does not test for CommonQuery or CommonPlay matches.common query: dict oflangto list ofutterancesOR dict ofutterancesto expected:callback_data(list keys or dict data),min_confidence, andmax_confidencecommon play: TBD
Advanced Usage
In addition to convenient CLI methods, this package also provides test cases that may be extended.
Skill Unit Tests
neon_minerva.tests.skill_unit_test_base provides SkillTestCase, a class
that supplies boilerplate setup/teardown/mocking for testing a skill. An example
skill test implementation could look like:
from os import environ
from neon_minerva.tests.skill_unit_test_base import SkillTestCase
environ['TEST_SKILL_ENTRYPOINT'] = "my_skill.test"
class MySkillTest(SkillTestCase):
def test_skill_init(self):
self.assertEqual(self.skill.skill_id, "my_skill.test")
...
Be sure to review the base class for mocked methods and test paths as these may change in the future.
Chatbot Unit Tests
neon_minerva.chatbots contains mocked data for testing as well as some utility
methods. neon_minerva.tests.chatbot_v1_test_base provides TestSubmind which
may be extended to test a submind bot in a mocked v1 environment. For example:
from os import environ
from datetime import datetime
from chatbot_core.utils.enum import ConversationState
from neon_minerva.tests.chatbot_v1_test_base import TestSubmind
from neon_minerva.chatbots.test_constants import PROMPT, RESPONSES
environ["TEST_BOT_ENTRYPOINT"] = "tester"
class TestTester(TestSubmind):
def test_submind_chatbot(self):
self.submind.state = ConversationState.RESP
response = self.submind.ask_chatbot("testrunner", PROMPT,
datetime.now().strftime(
"%I:%M:%S %p"))
self.assertIsInstance(response, str)
self.assertIsNotNone(response)
Make sure to install the
chatbotsextra to use this test case
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neon-minerva-0.3.0.tar.gz.
File metadata
- Download URL: neon-minerva-0.3.0.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c88833d200b36a0be3ab525753e5bf8cf5d7096fc319137ed77d7c42161de49
|
|
| MD5 |
5d6c162653639775c132ffc91e6709ef
|
|
| BLAKE2b-256 |
0e7d064c31840664595366731a16602f99091396eb2db4b251991a90789e0e8e
|
File details
Details for the file neon_minerva-0.3.0-py3-none-any.whl.
File metadata
- Download URL: neon_minerva-0.3.0-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d04294e7b3d21c91a08d5ef1eb145b115bfd69b987955d07c54f9df7d44c042c
|
|
| MD5 |
dc7610c5995b4a61ef3332f3b1c20360
|
|
| BLAKE2b-256 |
2130488623f3988984b8fd52216df90637524296fc7a0c3fddbd3b80f6f3f807
|