コード例 #1
0
ファイル: test_cli.py プロジェクト: wavelets/snips-nlu
    def test_parse(self):
        # Given / When
        train(BEVERAGE_DATASET_PATH, str(self.tmp_file_path), config_path=None)

        # When
        with self.fail_if_exception("Failed to parse using CLI script"):
            parse(str(self.tmp_file_path), "Make me two cups of coffee")
コード例 #2
0
ファイル: test_cli.py プロジェクト: wavelets/snips-nlu
    def test_train(self):
        # Given / When
        train(BEVERAGE_DATASET_PATH, str(self.tmp_file_path), config_path=None)

        # Then
        if not self.tmp_file_path.exists():
            self.fail("No trained engine generated")
        msg = "Failed to create an engine from engine dict."
        with self.fail_if_exception(msg):
            SnipsNLUEngine.from_path(self.tmp_file_path)
コード例 #3
0
    def test_train(self):
        # Given / When
        train(BEVERAGE_DATASET_PATH, str(self.tmp_file_path), config_path=None)

        # Then
        if not self.tmp_file_path.exists():
            self.fail("No trained engine generated")
        msg = "Failed to create an engine from engine dict."
        with self.fail_if_exception(msg):
            with self.tmp_file_path.open(mode="r", encoding="utf8") as f:
                trained_engine_dict = json.load(f)
            SnipsNLUEngine.from_dict(trained_engine_dict)
コード例 #4
0
ファイル: test_cli.py プロジェクト: wolfhu/snips-nlu
    def test_train(self):
        # Given / When
        train(self.beverage_dataset_path,
              str(self.tmp_file_path),
              config_path=None,
              verbose=False)

        # Then
        if not self.tmp_file_path.exists():
            self.fail("No trained engine generated")
        msg = "Failed to create an engine from engine dict."
        with self.fail_if_exception(msg):
            SnipsNLUEngine.from_path(self.tmp_file_path)