Skip to main content

Provides a unified API to several popular intent recognition applications

Project description

Telekom NLU Bridge

DevelopmentDocumentationSupportContributeLicensing

The goal of this project is to provide a unified API to several popular intent recognition applications.

About this component

Installation

The core package including NLUdataset and Baseline vendors can be installed using pip

pip install nlubridge

To include optional dependencies for the vendors, e.g. Watson Assistant, type

pip install nlubridge[watson]

Some vendors require access credentials like API tokens, URLs etc. These can be passed on construction of the objects. Alternatively, such arguments can be passed as environment variables, where the vendor will look for variables named variable VENDORNAME_PARAM_NAME.

Some vendors require additional dependencies. E.g., Spacy requires a model that can be downloaded (for the model de_core_news_sm) with

python -m spacy download de_core_news_sm

Usage

Here is an example for the TfidfIntentClassifier:

import os

import pandas as pd

from nlubridge.vendors import TfidfIntentClassifier
from nlubridge import NLUdataset 

dataset = NLUdataset(texts, intents)
dataset = dataset.shuffle()

classifier = TfidfIntentClassifier()

train, test = dataset.train_test_split(test_size=0.25, random_state=0)
classifier = classifier.train_intent(train)
predicted = classifier.test_intent(test)
res = pd.DataFrame(list(zip(test.intents, predicted)), columns=['true', 'predicted'])

Most of the code uses python logging to report its progress. To get logs printed out to console or Jupyter notebook, a logger needs to be configured, before the nlutests code. Usually, log messages are on INFO level. This can be configured like this:

import logging

logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())

Concepts / Architecture

  • Vendors
    The vendors module implements standardized interfaces to the specific vendors. A specific Vendor instance is in charge of dealing with converting the data to the required format, uploading data to the cloud if applicable, training models and making predictions.

  • Datasets
    The datasets module provides a standard interface to NLU data. Data stored in different vendor's custom format can be loaded as a dataset and provided to any different vendor.

List of supported vendors

NOTE: Currently entity recognition is not implemented for any of the vendors!

Vendor Status Intents Entities Algorithm
TfidfIntentClassifier BoW + SVM
fasttext fasttext
spacy BoW linear + CNN
IBM Watson Assistant Propietary (probably LR)
Microsoft LUIS needs testing Propietary (probably LR)
TelekomModel tf-idf on char n-grams + LR
Rasa NLU starspace like

Features

  • Abstract class for Vendors with convenience methods (ex: scoring and scikit-learn compatibility)
  • Abstract class for datasets with convenience methods (ex: train_test_split, indexing, iteration)
  • Rate limiting to comply with cloud providers requirements

Development

TBD

Build

TBD

Code of Conduct

This project has adopted the Contributor Covenant in version 2.0 as our code of conduct. Please see the details in our CODE_OF_CONDUCT.md. All contributors must abide by the code of conduct.

Working Language

We decided to apply English as the primary project language.

Consequently, all content will be made available primarily in English. We also ask all interested people to use English as language to create issues, in their code (comments, documentation etc.) and when you send requests to us. The application itself and all end-user facing content will be made available in other languages as needed.

Documentation

The full documentation for the telekom nlu-bridge can be found in TBD

Support and Feedback

The following channels are available for discussions, feedback, and support requests:

Type Channel
Issues
Other Requests

How to Contribute

Contribution and feedback is encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines. By participating in this project, you agree to abide by its Code of Conduct at all times.

Licensing

Copyright (c) 2021 Deutsche Telekom AG.

Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License by reviewing the file LICENSE in the repository.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nlubridge-0.1.0.tar.gz (42.4 kB view details)

Uploaded Source

Built Distribution

nlubridge-0.1.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file nlubridge-0.1.0.tar.gz.

File metadata

  • Download URL: nlubridge-0.1.0.tar.gz
  • Upload date:
  • Size: 42.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for nlubridge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 003d9569cfb494b79ae67452d1fe88568778c13f39fe2990b9db034b1a6fbea5
MD5 1116ec71f9d5b78f2ce0d3ea2794f98b
BLAKE2b-256 ea86decd2decc883f1715a4fb7eba9ae579c72bd17605b389844434cc6f335c4

See more details on using hashes here.

File details

Details for the file nlubridge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nlubridge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for nlubridge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d16ee0956514e5852a440037b53a32142eb4e8da65fff7afa377bb98a625655d
MD5 88d925e8c9acaab87b6db9629767a0d6
BLAKE2b-256 083794d1ebfadb6b6ed100058edce9f69b646f0c52489ee9c22b93265390b744

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page