Coder Social home page Coder Social logo

cognitive-luis-python's Introduction

LUIS

LUIS is a service for language understanding that provides intent classification and entity extraction. In order to use the SDK you first need to create and publish an app on www.luis.ai where you will get your appID and appKey and input their values when prompted by the sample applications.

The SDK

The SDK can be used in 2 different ways with a separate sample for each way.

  • One way to use it is synchronously by calling the functions "predict" and "reply" that are present in the "LUISClient" and receiving the response as a returned object from the class "LUISResponse".
  • Another way is asynchronously by creating 2 callback functions "on_success" and "on_failure" and passing them to the "predict" and "reply" functions to be called asynchronously in the cases of the request success or failure.

Sample Application

The sample application allows you to perform the Predict and Reply operations and to view the following parts of the parsed response:

  • Query
  • Top Intent
  • Dialog prompt, parameter name, and status
  • Entities

License

All Microsoft Cognitive Services SDKs and samples are licensed with the MIT License. For more details, see LICENSE.

Developer Code of Conduct

Developers using Cognitive Services, including this client library & sample, are required to follow the โ€œDeveloper Code of Conduct for Microsoft Cognitive Servicesโ€.

cognitive-luis-python's People

Contributors

ahmkel avatar microsoft-github-policy-service[bot] avatar msftgits avatar v-youel 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  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  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  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  avatar  avatar  avatar

cognitive-luis-python's Issues

Typo in the project description

I know it sounds silly, and its an extremely small issue, but I just thought it might be a good idea to correct "Congitive" to "Cognitive" in the project description :)

Automate the LUIS model training using custom data

Can I customize the classification & clustering using my own analytics algorithm for LUIS model training ?
It would be extremely tedious procedure to do training the model if I have 1000 or more messages that cannot get good answer from LUIS every day?
Does Microsoft have plan to have R language sample code for LUIS?

Error when importing from Json endpoint

I downloaded a dummy bot I made, just using the PreBuild domains and exporting it from the apps.

Once with the downloaded Json I wanted to upload it to a new bot to test the API

When I try to post the datas I get a 400 Missing phraselist features field
It's the same if I try to upload it from the UI in the versioning tab

However, the phraselist field is in the json.
I tried phraselist / phraselists / phraseList / PhraseLists / phraselist_features etc... without sucess

Return :

400
{
  "error": {
    "code": "BadArgument",
    "message": "Missing phraselist features field."
  }
}

Python Code :

with open('./Luis/data/exemple/allDefault.json', 'r') as file:
        bot_data = json.load(file)
app_id = requests.post('https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/import', 
                                      params=params,
                                      headers={'content-type': 'application/json',
                                                       'content-type': 'application/json',
                                                       'Ocp-Apim-Subscription-Key': TRIAL_KEY},
                                      json=bot_data)

Json file (I just put one of each on the issue to reduce the size, my real json is complete) it's the todo template

{
  "luis_schema_version": "7.0.0",
  "intents": [
    {
      "name": "ToDo.AddToDo",
      "inherits": {
        "domain_name": "ToDo",
        "model_name": "AddToDo"
      },
      "features": []
    }
  ],
  "entities": [
    {
      "name": "ToDo.ContainsAll",
      "children": [],
      "inherits": {
        "domain_name": "ToDo",
        "model_name": "ContainsAll"
      },
      "roles": [],
      "features": []
    }
  ],
  "hierarchicals": [],
  "composites": [],
  "closedLists": [],
  "prebuiltEntities": [
    {
      "name": "ordinal",
      "roles": []
    }
  ],
  "utterances": [
    {
      "text": "access my shopping list",
      "intent": "ToDo.ShowToDo",
      "entities": [
        {
          "entity": "ToDo.ListType",
          "startPos": 10,
          "endPos": 17,
          "children": []
        }
      ]
    }
  ],
  "versionId": "0.1",
  "name": "plop",
  "desc": "",
  "culture": "en-us",
  "tokenizerVersion": "1.0.0",
  "patternAnyEntities": [
    {
      "name": "ToDo.TaskContent.Any",
      "inherits": {
        "domain_name": "ToDo",
        "model_name": "TaskContent.Any"
      },
      "roles": [],
      "explicitList": []
    }
  ],
  "regex_entities": [],
  "phraselists": [],
  "regex_features": [],
  "patterns": [
    {
      "pattern": "^(add|create|append) an item [(called|about|of)] \"{ToDo.TaskContent.Any}\" [as (next|first|last) task][(in|on|to) my (to do|to-do|todos) list]",
      "intent": "ToDo.AddToDo"
    },
    {
      "pattern": "^[(would you|could you|can you)] [please] cancel (previous|current|this) (step|operation)",
      "intent": "ToDo.Cancel"
    }
  ],
  "settings": []
}

Upload to PyPI

Hi,

I'm heavily using this nice package for integrating our robotic framework and would like to make it easy on installation process.
Is there any plan to register this python package to PyPI repository like other awesome python packages?
By registering to PyPI, this package can be installed by one line of command:

pip install luis_sdk

Thank you very much in advance!

API always points to Production?

Hi,

I am unable to choose the LUIS instance to which the SDK should connect to. Is there a way in which we could target "Staging" instead of "Production"

API does not work behind corporate proxy

Because the LUISClient uses the low level http.client library, it needs to care for proxies.

For example, it could grab the environment variables http_proxy and https_proxy and, if they exist, use them along with HTTPConnection.set_tunnel().

As is, it the library won't work behind corporate proxies.

Regarding error in Cognitive-LUIS-Python

I am trying to run Cognitive-LUIS-Python code with my own App ID and Key but it shows that Empty App Id when i run code "sample_run.py"

Please help me.

/Neha

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.