-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #824 from snipsco/release/0.19.8
Release 0.19.8
- Loading branch information
Showing
62 changed files
with
1,513 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
__email__ = "[email protected], [email protected]" | ||
__license__ = "Apache License, Version 2.0" | ||
|
||
__version__ = "0.19.7" | ||
__version__ = "0.19.8" | ||
__model_version__ = "0.19.0" | ||
|
||
__download_url__ = "https://github.com/snipsco/snips-nlu-language-resources/releases/download" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
from snips_nlu_parsers import get_ontology_version | ||
from deprecation import deprecated | ||
|
||
from snips_nlu.__about__ import __model_version__, __version__ | ||
from snips_nlu.nlu_engine import SnipsNLUEngine | ||
from snips_nlu.pipeline.configs import NLUEngineConfig | ||
from snips_nlu.resources import load_resources | ||
|
||
__builtin_entities_version__ = get_ontology_version() | ||
|
||
@deprecated(deprecated_in="0.19.7", removed_in="0.21.0", | ||
current_version=__version__, | ||
details="Loading resources in the client code is no longer " | ||
"required") | ||
def load_resources(name, required_resources=None): | ||
from snips_nlu.resources import load_resources as _load_resources | ||
|
||
return _load_resources(name, required_resources) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,6 @@ | ||
from __future__ import print_function, unicode_literals | ||
|
||
|
||
def main(): | ||
import sys | ||
|
||
import plac | ||
|
||
from snips_nlu.__about__ import __version__, __model_version__ | ||
from snips_nlu.cli import ( | ||
cross_val_metrics, download, download_all_languages, generate_dataset, | ||
link, train_test_metrics) | ||
from snips_nlu.cli.download_entity import ( | ||
download_builtin_entity, download_language_builtin_entities) | ||
from snips_nlu.cli.inference import parse | ||
from snips_nlu.cli.training import train | ||
from snips_nlu.cli.utils import PrettyPrintLevel, pretty_print | ||
|
||
commands = { | ||
"train": train, | ||
"parse": parse, | ||
"download": download, | ||
"download-all-languages": download_all_languages, | ||
"download-entity": download_builtin_entity, | ||
"download-language-entities": download_language_builtin_entities, | ||
"version": lambda: print(__version__), | ||
"model-version": lambda: print(__model_version__), | ||
"link": link, | ||
"generate-dataset": generate_dataset, | ||
"cross-val-metrics": cross_val_metrics, | ||
"train-test-metrics": train_test_metrics, | ||
} | ||
if len(sys.argv) == 1: | ||
pretty_print(', '.join(commands), title="Available commands", exits=1, | ||
level=PrettyPrintLevel.INFO) | ||
command = sys.argv.pop(1) | ||
sys.argv[0] = 'snips-nlu %s' % command | ||
if command in commands: | ||
plac.call(commands[command], sys.argv[1:]) | ||
else: | ||
pretty_print("Available: %s" % ', '.join(commands), | ||
title="Unknown command: %s" % command, exits=1, | ||
level=PrettyPrintLevel.INFO) | ||
|
||
|
||
if __name__ == "__main__": | ||
from snips_nlu.cli import main | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,53 @@ | ||
from snips_nlu.cli.download import download, download_all_languages | ||
from snips_nlu.cli.generate_dataset import generate_dataset | ||
from snips_nlu.cli.inference import parse | ||
from snips_nlu.cli.link import link | ||
from snips_nlu.cli.metrics import train_test_metrics, cross_val_metrics | ||
from snips_nlu.cli.training import train | ||
import argparse | ||
|
||
|
||
class Formatter(argparse.HelpFormatter): | ||
def __init__(self, prog): | ||
super(Formatter, self).__init__(prog, max_help_position=35, width=150) | ||
|
||
|
||
def get_arg_parser(): | ||
from snips_nlu.cli.download import ( | ||
add_download_parser, add_download_all_languages_parser) | ||
from snips_nlu.cli.download_entity import ( | ||
add_download_entity_parser, add_download_language_entities_parser) | ||
from snips_nlu.cli.generate_dataset import add_generate_dataset_subparser | ||
from snips_nlu.cli.inference import add_parse_parser | ||
from snips_nlu.cli.link import add_link_parser | ||
from snips_nlu.cli.metrics import ( | ||
add_cross_val_metrics_parser, add_train_test_metrics_parser) | ||
from snips_nlu.cli.training import add_train_parser | ||
from snips_nlu.cli.versions import ( | ||
add_version_parser, add_model_version_parser) | ||
|
||
arg_parser = argparse.ArgumentParser( | ||
description="Snips NLU command line interface", | ||
prog="python -m snips_nlu", formatter_class=Formatter) | ||
arg_parser.add_argument("-v", "--version", action="store_true", | ||
help="Print package version") | ||
subparsers = arg_parser.add_subparsers( | ||
title="available commands", metavar="command [options ...]") | ||
add_generate_dataset_subparser(subparsers) | ||
add_train_parser(subparsers) | ||
add_parse_parser(subparsers) | ||
add_download_parser(subparsers) | ||
add_download_all_languages_parser(subparsers) | ||
add_download_entity_parser(subparsers) | ||
add_download_language_entities_parser(subparsers) | ||
add_link_parser(subparsers) | ||
add_cross_val_metrics_parser(subparsers) | ||
add_train_test_metrics_parser(subparsers) | ||
add_version_parser(subparsers) | ||
add_model_version_parser(subparsers) | ||
return arg_parser | ||
|
||
|
||
def main(): | ||
arg_parser = get_arg_parser() | ||
args = arg_parser.parse_args() | ||
|
||
if hasattr(args, "func"): | ||
args.func(args) | ||
else: | ||
arg_parser.print_help() | ||
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.