Skip to content

Commit

Permalink
Merge pull request #114 from snipsco/release/0.63.0
Browse files Browse the repository at this point in the history
Release 0.63.0
  • Loading branch information
ClemDoum authored Feb 4, 2019
2 parents 1edd181 + ec1d3f2 commit 12fd27e
Show file tree
Hide file tree
Showing 153 changed files with 242,291 additions and 242,184 deletions.
13 changes: 6 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ install:
- if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin
- rustc -V
- cargo -V
- echo [workspace] > Cargo.toml
- echo members = [ >> Cargo.toml
- echo "snips-nlu-ffi", >> Cargo.toml
- echo "snips-nlu-ffi/python/snips-nlu-python-ffi", >> Cargo.toml
- echo "snips-nlu-lib", >> Cargo.toml
- echo ] >> Cargo.toml
- ps: (Get-Content snips-nlu-ffi/python/snips-nlu-python-ffi/Cargo.toml) | ForEach-Object { $_ -replace "^snips-nlu-ffi = .*$", "snips-nlu-ffi = { path = `"../..`" }" } | Set-Content snips-nlu-ffi/python/snips-nlu-python-ffi/Cargo.toml
- ps: (Get-Content platforms/python/ffi/Cargo.toml) | ForEach-Object { $_ -replace "^snips-nlu-ffi = .*$", "snips-nlu-ffi = { path = `"../../../ffi`" }" } | Set-Content platforms/python/ffi/Cargo.toml

build: false

test_script:
- cargo build --all --tests --benches
- cargo test --all

cache:
- target
- platforms\python\ffi\target
- C:\Users\appveyor\.cargo\registry
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

target/
Cargo.lock
/Cargo.toml
**/*.rs.bk

## Idea
Expand Down
40 changes: 12 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
sudo: required # This ensures more memory (https://docs.travis-ci.com/user/reference/overview/#Virtualisation-Environment-vs-Operating-System)
cache:
- cargo
- directories:
- platforms/python/ffi/target

jobs:
allow_failures:
- rust: nightly
include:
- if: env(TRAVIS_BRANCH) = master or branch =~ /^main\/.+$/
- if: branch = master or head_branch =~ /^release\/.+$/
os: osx
osx_image: xcode9.3
osx_image: xcode10.1
language: generic
env:
- TOXENV=py27
- PYTHON_TESTS=true
- if: env(TRAVIS_BRANCH) = master or branch =~ /^main\/.+$/
- if: branch = master or head_branch =~ /^release\/.+$/
os: osx
osx_image: xcode9.3
osx_image: xcode10.1
language: generic
env:
- TOXENV=py36
- PYTHON_TESTS=true
- if: env(TRAVIS_BRANCH) = master or branch =~ /^main\/.+$/
- if: branch = master or head_branch =~ /^release\/.+$/
os: osx
osx_image: xcode9.3
osx_image: xcode10.1
language: generic
env:
- MACOS_SWIFT_TESTS=true
- if: env(TRAVIS_BRANCH) = master or branch =~ /^main\/.+$/
os: osx
osx_image: xcode9.3
language: generic
env:
- IOS_SWIFT_TESTS=true
- if: env(TRAVIS_BRANCH) = master or branch =~ /^main\/.+$/
- if: branch = master or head_branch =~ /^release\/.+$/
os: linux
language: python
python: 2.7
Expand All @@ -43,7 +39,7 @@ jobs:
env:
- TOXENV=py36
- PYTHON_TESTS=true
- if: env(TRAVIS_BRANCH) = master or branch =~ /^main\/.+$/
- if: branch = master or head_branch =~ /^release\/.+$/
os: linux
language: rust
rust: stable
Expand All @@ -54,18 +50,6 @@ jobs:
rust: stable
env:
- RUST_TESTS=true
- if: env(TRAVIS_BRANCH) = master or branch =~ /^main\/.+$/
os: linux
language: rust
rust: beta
env:
- RUST_TESTS=true
- if: env(TRAVIS_BRANCH) = master or branch =~ /^main\/.+$/
os: linux
language: rust
rust: nightly
env:
- RUST_TESTS=true

before_install: . ./.travis/before_install.sh

Expand Down
12 changes: 8 additions & 4 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
set -ev

# Install Rust
if [ -z ${TRAVIS_RUST_VERSION+w} ]; then
if [[ -z ${TRAVIS_RUST_VERSION+w} ]]; then
curl https://sh.rustup.rs -sSf | bash -s -- -y
fi

if [ $TRAVIS_OS_NAME == "osx" ]; then
if [ $PYTHON_TESTS == true ]; then
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
if [[ ${PYTHON_TESTS} == true ]]; then
# install pyenv
git clone --depth 1 https://github.com/pyenv/pyenv ~/.pyenv
PYENV_ROOT="$HOME/.pyenv"
Expand All @@ -23,14 +23,18 @@ if [ $TRAVIS_OS_NAME == "osx" ]; then
pyenv install 3.6.1
pyenv global 3.6.1
;;
"py37")
pyenv install 3.7.2
pyenv global 3.7.2
;;
esac
pyenv rehash

# A manual check that the correct version of Python is running.
python --version
fi

if [ "${IOS_SWIFT_TESTS}" == "true" ]; then
if [[ "${IOS_SWIFT_TESTS}" == "true" ]]; then
PATH="$HOME/.cargo/bin:$PATH"
rustup target install x86_64-apple-ios
fi
Expand Down
26 changes: 0 additions & 26 deletions .travis/common.sh

This file was deleted.

14 changes: 3 additions & 11 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
#!/bin/bash
set -ev

source .travis/common.sh

echo '
[workspace]
members=[
"snips-nlu-ffi",
"snips-nlu-ffi/python/snips-nlu-python-ffi",
"snips-nlu-lib"
]' > Cargo.toml

echo "Replacing snips-nlu-ffi url for local version"
perl -p -i -e "s/^snips-nlu-ffi = .*\$/snips-nlu-ffi = { path = \"..\/..\" \}/g" snips-nlu-ffi/python/snips-nlu-python-ffi/Cargo.toml
perl -p -i -e \
"s/^snips-nlu-ffi = .*\$/snips-nlu-ffi = { path = \"..\/..\/..\/ffi\" \}/g" \
platforms/python/ffi/Cargo.toml
27 changes: 14 additions & 13 deletions .travis/test.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
#!/bin/bash
set -ev

source .travis/common.sh
export PATH="$HOME/.cargo/bin:$PATH"

if [ "${RUST_TESTS}" == "true" ]; then
if [[ "${RUST_TESTS}" == "true" ]]; then
echo "Running rust tests..."
cargo test --all || die "Rust tests failed"
cargo test --all
cargo check --benches
fi

if [ "${PYTHON_TESTS}" == "true" ]; then
if [[ "${PYTHON_TESTS}" == "true" ]]; then
echo "Running python tests..."
cd snips-nlu-ffi/python
python -m pip install tox
tox || die "Python tests failed"
cd platforms/python
pip install tox
tox
cd -
fi

if [ "${KOTLIN_TESTS}" == "true" ]; then
if [[ "${KOTLIN_TESTS}" == "true" ]]; then
echo "Running kotlin tests..."
cargo build -p snips-nlu-ffi
cd snips-nlu-ffi/kotlin
cd platforms/kotlin
./gradlew -Pdebug -PrustTargetPath=../../target test --info
cd -
fi

if [ "${MACOS_SWIFT_TESTS}" == "true" ]; then
if [[ "${MACOS_SWIFT_TESTS}" == "true" ]]; then
echo "Running macOS swift tests..."
cargo build -p snips-nlu-ffi
cd snips-nlu-ffi/swift
cd platforms/swift
mkdir -p build/DerivedData
set -o pipefail && xcodebuild \
-IDECustomDerivedDataLocation=build/DerivedData \
Expand All @@ -41,11 +42,11 @@ if [ "${MACOS_SWIFT_TESTS}" == "true" ]; then
cd -
fi

if [ "${IOS_SWIFT_TESTS}" == "true" ]; then
if [[ "${IOS_SWIFT_TESTS}" == "true" ]]; then
echo "Running iOS swift tests..."
TARGET_SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) \
cargo build -p snips-nlu-ffi --target x86_64-apple-ios
cd snips-nlu-ffi/swift
cd platforms/swift
mkdir -p build/DerivedData
set -o pipefail && xcodebuild \
-IDECustomDerivedDataLocation=build/DerivedData \
Expand Down
36 changes: 32 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.63.0] - 2019-02-04
### Added
- `get_intents` API: get the probabilities of all intents (including the null intent) with respect to an input text
- Pass `--top_intents` to the parsing CLI to use the `get_intents` API instead of `parse`
- `get_slots` API: extract slots by providing a text along with its corresponding intent
- Added a an optional `CooccurrenceVectorizer` to the `Featurizer` that extracts co-occurrence features

## [0.62.0] - 2018-11-26
### Changed
- A probability is now returned when no intent is found
- The `parse` API now takes a new optional parameter `intents_blacklist` which allows to filter out specific intents
- `Slot` object now contains an optional `confidence_score` attribute
- `intent` value of `IntentParserResult` is no longer optional: the optionality is moved to `intent_name` in the `IntentClassificationResult` object
- `slots` value of `IntentParserResult` is no longer optional (`None` is replaced by empty `Vec`)
- Update to Rust 2018
- Refactored the `Featurizer` and moved its attributes to an underlying `TfidfVectorizer`

## [0.61.2] - 2019-01-17
### Changed
- Bump `snips-nlu-ontology` to `0.61.3`

## [0.61.1] - 2018-12-14
### Changed
- Bump `snips-nlu-ontology` to `0.61.2`

### Fixed
- Issue when resolving custom entities

## [0.62.0] - 2018-11-26
### Changed
- Bumped `snips-nlu-ontology` to `0.62.0`

Expand All @@ -18,7 +43,7 @@ All notable changes to this project will be documented in this file.
## [0.61.0] - 2018-10-16
### Changed
- Entity injection API is now handled by an `NLUInjector` object

### Added
- Support for builtin music entities in english

Expand Down Expand Up @@ -75,7 +100,7 @@ being statically hardcoded, reducing the binary size by 31Mb.

### Removed
- `snips-nlu-resources` and `snips-nlu-resources-packed` crates no longer exists.
- `FileBasedConfiguration`, `ZipBasedConfiguration` and `NluEngineConfigurationConvertible
- `FileBasedConfiguration`, `ZipBasedConfiguration` and `NluEngineConfigurationConvertible`
- Rust examples (replaced by interactive CLI).

## [0.57.2] - 2018-07-12
Expand Down Expand Up @@ -140,7 +165,10 @@ being statically hardcoded, reducing the binary size by 31Mb.
- Improve support for japanese
- Rename python package to `snips_nlu_rust`


[Unreleased]: https://github.com/snipsco/snips-nlu-rs/compare/0.63.0...HEAD
[0.63.0]: https://github.com/snipsco/snips-nlu-rs/compare/0.62.0...0.63.0
[0.61.2]: https://github.com/snipsco/snips-nlu-rs/compare/0.61.1...0.61.2
[0.61.1]: https://github.com/snipsco/snips-nlu-rs/compare/0.61.0...0.61.1
[0.62.0]: https://github.com/snipsco/snips-nlu-rs/compare/0.61.0...0.62.0
[0.61.0]: https://github.com/snipsco/snips-nlu-rs/compare/0.60.1...0.61.0
[0.60.1]: https://github.com/snipsco/snips-nlu-rs/compare/0.60.0...0.60.1
Expand Down
18 changes: 13 additions & 5 deletions snips-nlu-lib/Cargo.toml → Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snips-nlu-lib"
version = "0.62.0"
version = "0.63.0"
authors = [
"Adrien Ball <[email protected]>",
"Clement Doumouro <[email protected]>",
Expand All @@ -9,12 +9,20 @@ authors = [
]
repository = "https://github.com/snipsco/snips-nlu-rs"
description = "Rust implementation of Snips NLU"
edition = "2018"

[workspace]
members = [
".",
"ffi",
"platforms/python/ffi",
]

[dependencies]
crfsuite = { git = "https://github.com/snipsco/crfsuite-rs", rev = "30b2ea6" }
snips-nlu-ontology = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.62.0" }
snips-nlu-ontology-parsers = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.62.0" }
snips-nlu-utils = { git = "https://github.com/snipsco/snips-nlu-utils", tag = "0.7.0" }
crfsuite = { git = "https://github.com/snipsco/crfsuite-rs", rev = "91fda4b" }
snips-nlu-ontology = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.63.1" }
snips-nlu-parsers = { git = "https://github.com/snipsco/snips-nlu-parsers", tag = "0.1.2" }
snips-nlu-utils = { git = "https://github.com/snipsco/snips-nlu-utils", tag = "0.7.1" }
failure = "0.1"
base64 = "0.9"
itertools = { version = "0.7", default-features = false }
Expand Down
6 changes: 4 additions & 2 deletions snips-nlu-lib/benches/nlu_engine.rs → benches/nlu_engine.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#![allow(clippy::never_loop)]

#[macro_use]
extern crate bencher;
extern crate snips_nlu_lib;
extern crate dinghy_test;
extern crate snips_nlu_lib;

use std::env;

Expand Down Expand Up @@ -40,7 +42,7 @@ fn nlu_parsing(b: &mut Bencher) {
.unwrap();

b.iter(|| {
let _ = nlu_engine.parse(&sentence, None);
let _ = nlu_engine.parse(&sentence, None, None);
});
}

Expand Down
Loading

0 comments on commit 12fd27e

Please sign in to comment.