Code Monkey home page Code Monkey logo

nlu.devops's Introduction

NLU.DevOps · Build Status PRs Welcome

Continuous integration and deployment of NLU models.

Getting Started

Getting Started with the NLU.DevOps Azure DevOps extension

We have published an Azure DevOps extension that wraps the steps below into three pipeline tasks for training, testing and deleting your NLU model. To get started, install the NLU.DevOps extension to your Azure DevOps organization.

See the Azure DevOps extension overview for more details.

Detailed information for each Azure Pipelines task can be found in the docs folder:

Getting Started with the NLU.DevOps CLI

To install the NLU.DevOps CLI tool, run:

dotnet tool install -g dotnet-nlu

This will install the CLI tool to your default .NET Core tools path. See the documentation on the dotnet tool install command for more information on how to customize the installation directory or package source.

The CLI tool by default supports training and testing NLU models against LUIS and Lex.

Detailed information on the CLI tool sub-commands and arguments can be found in the docs folder:

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

For more information on reporting potential security vulnerabilities, see the Security overview.

nlu.devops's People

Contributors

bsherwin avatar esgraham avatar in4margaret avatar microsoftopensource avatar mokarian avatar msftgits avatar rozele avatar sabeegrewal avatar saroup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nlu.devops's Issues

Change NLU.DevOps.ModelPerformance to generic JSON compare

Change NLU.DevOps.ModelPerformance to a configurable JSON compare library such that any two JSON values can be compared.

We could have a simple interface like IConfusionMatrixEvaluator:

public interface IConfusionMatrixEvaluator
{
    IEnumerable<TestCase> Evaluate(JToken expected, JToken actual);
}

E.g., for NLU today, we would create the following config:

{
  "intent": "default",
  "text": "string-no-punctuation",
  "entities": "NLU.DevOps.ModelPerformance.Comparers.EntitiesEvaluator"
}

Where EntitiesEvaluator is an implementation of IConfusionMatrixEvaluator and string-no-punctuation and default is syntactic sugar for other evaluator implementations.

We may want to have an option that allows you to evaluate all JSON properties in the expected and actual JSON values (not just the configured properties), in which case any unconfigured property value would just use the default evaluator.

Add support for complex entity matching

Currently, we're only matching simple entities that have at most the recognized string in the text and a flat semantic string value. We'll want to add support for composite entities that are made up of groups of tokens in an utterance, or even entities that map to more complicated semantic values (for instance, dates).

Add .nuspec so we can easily create package with PluginLoader

Ideally, we'd leverage McMaster.DotNetCore.Plugins to resolve the NLU providers rather than the custom solution we have now. The approach works, but when we include the provider assemblies with the approach outlined here, the generated .nupkg does not include the providers subfolder in the NLU.DevOps.CommandLine output.

The way to work around this is likely to provide a .nuspec that we can use to ensure the providers folder is included.

Add support for LUIS batch test format

LUIS batch test format is slightly different than the generic utterance model. Namely:

{
    "intent": "<intent label>",
    "text": "<utterance text>",
    "entities": [
        {
            "entity": "<entity match text>",
            "startPos": <start pos>,
            "endPos": <end pos>
        }
    ]
}

So, "matchText" is replaced by "entity" and "matchIndex" is replaced by "startPos" and "endPos".

Update to the latest LUIS SDK for .NET

The LUIS SDK has been updated, and now also points to the V3 API. We should determine whether we need to keep a V2 option or if we should just deprecate / remove all together.

Investigate multi-intent support for NLU.DevOps

Some NLU providers may support multiple intents in a single utterance. E.g., "Book a flight to Paris and find me a hotel room". We may want to consider supporting these types of NLU providers. First step is to investigate what multi-intent providers are out there, and what changes we would need to make in order to support this.

Add scenario driven documentation

Current documentation covers variable setting and CLI usage, but scenario driven documentation would be more useful. E.g., adding a doc that talks about when it's worth using the generic utterance model for training, or adding a doc that talks about configuring pipelines to detect regressions.

Add support for loading models from LUDown

LUDown is a concise format for representing NLU models. We should consider adding an option to load NLU models from LUDown, as well as an option to define test sets in LUDown.

ResourceExhausted StatusCode when running a large test set on dialogflow

  • Dialogflow has a 180 Standard Edition text query operations quota limit per minute
  • Run a large test set (~300 test utterances)
  • Error:
    Unhandled Exception: System.AggregateException: One or more errors occurred. (Status(StatusCode=ResourceExhausted, Detail="Quota exceeded for quota metric 'dialogflow.googleapis.com/StandardTierTextQueryOperations' and limit 'StandardTierTextQueryOperationsPerMinutePerProject' of service 'dialogflow.googleapis.com' for consumer 'project_number:281834563702'.")) ---> Grpc.Core.RpcException: Status(StatusCode=ResourceExhausted, Detail="Quota exceeded for quota metric 'dialogflow.googleapis.com/StandardTierTextQueryOperations' and limit 'StandardTierTextQueryOperationsPerMinutePerProject' of service 'dialogflow.googleapis.com' for consumer 'project_number:281834563702'.")
    at Google.Api.Gax.Grpc.ApiCallRetryExtensions.<>c__DisplayClass0_0`2.<b__0>d.MoveNext()

Allow `--service-settings` to take a raw LUIS JSON app definition

Currently, you need to wrap the LUIS JSON in a top-level property called appTemplate in the service settings. We should allow users to just use a vanilla LUIS JSON app definition. One option could be to check for a top-level property like luis_schema_version, and if it's there, assume we're just loading from a vanilla LUIS JSON file.

Add documentation on alternatives for training models

You can use other tools for importing NLU models to LUIS or Lex, and only use NLU.DevOps to test your model. We should add a doc that discusses how to do this (e.g., using any LUIS or Lex CLI) and potentially include a sample Azure Pipelines YAML.

Test command does not return highest scoring intent in results

Tests run against a model fail because the tool reports the wrong intent has been returned ('AddItem' rather than 'None'). Running the utterance manually in the LUIS single test window shows that the correct intent ('None') is being returned from LUIS.
Tool maybe selects the first intent in alphabetical order, rather than the highest scoring intent?

Add configuration class that manages the LUIS app settings

There are a lot of LUIS app settings, and currently there is some spaghetti code in the LuisNLUServiceFactory that extracts app name, version ID, keys, etc. and the configuration validation logic is split between the factory, the NLU service, and the LUIS client wrapper. We should at least put all the logic into a LuisConfiguration class and ideally put all the validation in a single place (with methods to validate for training, testing, and speech)

Add support for query data (e.g., LUIS dynamic lists)

Currently, only string queries are supported. It would be more interesting if each service could define it's own query capabilities. Thinking the interface might change to something like...

interface INLUService {
    LabeledUtterance Test(IQuery query)
}

Move NLU pipeline to Windows Build Agent to work around bug

There is a bug with downloading artifacts on a Mac/Linux build agent, which prevents us from running the NLU pipeline on one of those agents. There is nothing specific in the nlu.yml pipeline that requires *nix, so we should move it over to Windows.

TooManyRequests error while pooling for training status

Training jobs not complete. Polling again.
trce: NLU.DevOps.Luis.LuisNLUTrainClient[0]
Training jobs not complete. Polling again.
trce: NLU.DevOps.Luis.LuisNLUTrainClient[0]
Training jobs not complete. Polling again.
trce: NLU.DevOps.Luis.LuisNLUTrainClient[0]
Training jobs not complete. Polling again.
trce: NLU.DevOps.Luis.LuisNLUTrainClient[0]
Training jobs not complete. Polling again.
trce: NLU.DevOps.Luis.LuisNLUTrainClient[0]
Training jobs not complete. Polling again.

Unhandled Exception: System.AggregateException: One or more errors occurred. (Operation returned an invalid status code 'TooManyRequests') ---> Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Models.ErrorResponseException: Operation returned an invalid status code 'TooManyRequests'

Add end-to-end testing for Bot Framework with NLU.DevOps

With the upcoming changes to NLU.DevOps.ModelPerformace, we'll be able to support arbitrary testing of JSON results from NLU. We should add a providers, NLU.DevOps.BotService, that supports both direct line via BotFramework and direct line speech via the Cognitive Service Speech SDK. The scenario would be as follows, consider the following tests:

[
  {
      "text": "add two avocados to my cart",
      "conversationID": 1,
      "userID": 1,
      "attachments": [
        [
           {
              "name": "avocado",
              "quantity": 2
           }
        ]
      ]
  },
  {
      "text": "remove one avocado and add two dozen eggs",
      "conversationID": 1,
      "userID": 1,
      "attachments": [
        [
           {
              "name": "avocado",
              "quantity": 1
           },
           {
              "name": "12 eggs",
              "quantity": "2"
           }
        ]
      ]
  }
]

In this case, we will set up the direct line channel to the bot and send two user queries "add two avocados to my cart" and "remove one avocado and add two dozen eggs".

The output may not contain any LUIS or other NLU provider specific info, but instead focuses on the end state contained in the activity.

Include confidence scores in results output

Currently, dotnet nlu test outputs the top scoring intent with no confidence score. The same goes for recognized entities. For better analysis, it may be worthwhile to output the confidence scores.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.