Skip to content

Commit

Permalink
Merge pull request snipsco#483 from snipsco/release/0.11.1
Browse files Browse the repository at this point in the history
Release 0.11.1
  • Loading branch information
Adrien Ball authored Feb 6, 2018
2 parents 3401e34 + b5fc14e commit 690696f
Show file tree
Hide file tree
Showing 14 changed files with 1,093 additions and 18 deletions.
11 changes: 9 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def buildWheel() {
executeInVirtualEnv(pythonPath, "venv", cmd)
}

def installAndTest(pythonPath, venvPath, includeIntegrationTest=false) {
def installAndTest(pythonPath, venvPath, includeIntegrationTest=false, includeLintingTest=false) {
stage('Checkout') {
deleteDir()
checkout scm
Expand All @@ -54,6 +54,13 @@ def installAndTest(pythonPath, venvPath, includeIntegrationTest=false) {
python -m unittest discover
"""

if(includeLintingTest) {
sh """
. ${venvPath}/bin/activate
python -m unittest discover -p 'linting_test*.py'
"""
}

if(includeIntegrationTest && (branchName.startsWith("release/") || branchName.startsWith("hotfix/") || branchName == "master")) {
sh """
. ${venvPath}/bin/activate
Expand All @@ -71,7 +78,7 @@ node('macos') {
def python35path = sh(returnStdout: true, script: 'which python3.5').trim()
def python36path = sh(returnStdout: true, script: 'which python3.6').trim()

installAndTest(python36path, "venv36", true)
installAndTest(python36path, "venv36", true, true)
installAndTest(python27path, "venv27")
installAndTest(python34path, "venv34")
installAndTest(python35path, "venv35")
Expand Down
10 changes: 10 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include snips_nlu/__version__
recursive-include cli *.py
recursive-include samples *
recursive-include snips_nlu/snips-nlu-resources/de *
recursive-include snips_nlu/snips-nlu-resources/en *
recursive-include snips_nlu/snips-nlu-resources/es *
recursive-include snips_nlu/snips-nlu-resources/fr *
recursive-include snips_nlu/snips-nlu-resources/ko *
recursive-include snips_nlu/snips-nlu-resources/zh *
global-exclude __pycache__ *.py[cod]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Install the package in edition mode:
## API

### Data
The input of the NLU engine training is a dataset which format can be found [here](https://github.com/snipsco/snips-nlu/blob/master/snips_nlu/tests/resources/sample_dataset.json)
The input of the NLU engine training is a dataset which format can be found [here](https://github.com/snipsco/snips-nlu/blob/master/samples/sample_dataset.json)

### Code

Expand All @@ -65,13 +65,13 @@ import io
import json
from pprint import pprint

from snips_nlu import SnipsNLUEngine, NLUEngineConfig
from snips_nlu import SnipsNLUEngine

############## Initialization ##############

# The nlu config is optional here
with io.open("config.json") as f:
nlu_config = NLUEngineConfig.from_dict(json.load(f))
nlu_config = json.load(f)

engine = SnipsNLUEngine(config=nlu_config)

Expand Down Expand Up @@ -124,8 +124,8 @@ trained_engine = SnipsNLUEngine.from_dict(trained_engine_dict)
### CLI

```bash
>>> train-engine /path/to/input/dataset.json /path/to/output/trained_engine.json
>>> engine-inference /path/to/output/trained_engine.json
train-engine /path/to/input/dataset.json /path/to/output/trained_engine.json
engine-inference /path/to/output/trained_engine.json
```

### Versioning
Expand Down
Empty file added samples/__init__.py
Empty file.
190 changes: 190 additions & 0 deletions samples/configs/config_de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
{
"unit_name": "nlu_engine",
"intent_parsers_configs": [
{
"unit_name": "deterministic_intent_parser",
"max_queries": 50,
"max_entities": 200
},
{
"unit_name": "probabilistic_intent_parser",
"slot_filler_config": {
"unit_name": "crf_slot_filler",
"feature_factory_configs": [
{
"args": {
"common_words_gazetteer_name": "top_10000_words",
"use_stemming": true,
"n": 1
},
"factory_name": "ngram",
"offsets": [
-2,
-1,
0,
1,
2
]
},
{
"args": {
"common_words_gazetteer_name": "top_10000_words",
"use_stemming": true,
"n": 2
},
"factory_name": "ngram",
"offsets": [
-2,
1
]
},
{
"args": {
"prefix_size": 2
},
"factory_name": "prefix",
"offsets": [
0
]
},
{
"args": {
"prefix_size": 5
},
"factory_name": "prefix",
"offsets": [
0
]
},
{
"args": {
"suffix_size": 2
},
"factory_name": "suffix",
"offsets": [
0
]
},
{
"args": {
"suffix_size": 5
},
"factory_name": "suffix",
"offsets": [
0
]
},
{
"args": {},
"factory_name": "is_digit",
"offsets": [
-1,
0,
1
]
},
{
"args": {},
"factory_name": "is_first",
"offsets": [
-2,
-1,
0
]
},
{
"args": {},
"factory_name": "is_last",
"offsets": [
0,
1,
2
]
},
{
"args": {
"n": 1
},
"factory_name": "shape_ngram",
"offsets": [
0
]
},
{
"args": {
"n": 2
},
"factory_name": "shape_ngram",
"offsets": [
-1,
0
]
},
{
"args": {
"n": 3
},
"factory_name": "shape_ngram",
"offsets": [
-1
]
},
{
"args": {
"use_stemming": true,
"tagging_scheme_code": 2
},
"factory_name": "entity_match",
"offsets": [
-2,
-1,
0
],
"drop_out": 0.5
},
{
"args": {
"tagging_scheme_code": 1
},
"factory_name": "builtin_entity_match",
"offsets": [
-2,
-1,
0
]
}
],
"crf_args": {
"c1": 0.1,
"c2": 0.1,
"algorithm": "lbfgs"
},
"tagging_scheme": 1,
"entities_offsets": [
-2,
-1,
0
],
"exhaustive_permutations_threshold": 64,
"data_augmentation_config": {
"min_utterances": 200,
"capitalization_ratio": 0.2
},
"random_seed": null
},
"intent_classifier_config": {
"unit_name": "log_reg_intent_classifier",
"data_augmentation_config": {
"min_utterances": 20,
"noise_factor": 5,
"unknown_word_prob": 0.0,
"unknown_words_replacement_string": null
},
"featurizer_config": {
"sublinear_tf": false
},
"random_seed": null
}
}
]
}
Loading

0 comments on commit 690696f

Please sign in to comment.