ebu / benchmarkstt

Open Source AI Benchmarking toolkit for benchmarking speech to text services
MIT License
54 stars 8 forks source link

Load external python code #142

Closed MikeSmithEU closed 3 years ago

MikeSmithEU commented 4 years ago

Adds --load argument to CLI, allowing to load external code. This allows the toolkit to be more modular and extensible without having to add to the core benchmarkstt code.

Eg.

If you have file test.py in current working directory:

class Uppercase:
    """Uppercase the text"""
    def normalize(self, text):
        return text.upper()

And you do

$> benchmarkstt --load test --help

The help output will have an addition normalizer:

 --uppercase           Uppercase the text

which can be used e.g.

$> echo "Should be uppercased" | benchmarkstt-tools normalization --load test --uppercase
SHOULD BE UPPERCASED
aro-max commented 3 years ago

Adds --load argument to CLI, allowing to load external code. This allows the toolkit to be more modular and extensible without having to add to the core benchmarkstt code.

Eg.

If you have file test.py in current working directory:

class Uppercase:
    """Uppercase the text"""
    def normalize(self, text):
        return text.upper()

And you do

$> benchmarkstt --load test --help

The help output will have an addition normalizer:

 --uppercase           Uppercase the text

which can be used e.g.

$> echo "Should be uppercased" | benchmarkstt-tools normalization --load test --uppercase
SHOULD BE UPPERCASED