Coder Social home page Coder Social logo

gp_rasa_nlu's Introduction

Natural Language Understanding

This project is based on rasa.ai NLU. It is used to predict the intents for our core server based on natural language. For more details on the core project, lookup the following links KFZ-Core or Core. The main part of this project are the intents which are test data to trail the nlu in order to understand and predict the user intents.

Structure

  • intents contains training data, each intent got a single file to separate them.
  • config.yaml describes the configuration of the nlu, there are additional information about data processing and entity extraction.
  • models contains the trained models, these are autogenerated at run time.
  • tests contains example test files for some intents.
  • train_nlu.py script which will train a model with all given intents.

Deploy and run the project

locally

First you need to install the requirements by using the provided 'requirements.txt'. To achieve this you can run the following command: If you wnat to get more informations about the installation, please read NLU Installation.

pip install -r requirements.txt

Furthermore you need to install the language specific package of spacy which could not be done be the 'requirements.txt'. You could user the next command to install this dependency:

python -m spacy download de

In order to run the nlu you need to fill the intents directory with some trainings data. After that you can simply generate (train) a model by using the following line:

python src/train_nlu.py

After generating a model, you need to start the http server so the core could interact with the nlu. This is done be the following command:

python -m rasa_nlu.server --path models/ -c config.yaml

build

To deploy and run this project docker is mandatory, you would need to install docker as well as docker stack or docker compose. You can run the build by the following command. We will tag the image with our docker registry url and the projects name.

docker build -t docker.nexus.gpchatbot.archi-lab.io/chatbot/nlu .

run

In order to run the nlu you will need to create a docker network which is called 'chatbot'. You can do this by running the following command:

docker network create chatbot

The project could be run by the following command:

docker-compose -f docker/docker-compose.yaml up -d

Testing

automated testing

If you want to test the nlu automated, you can add some test scripts in the tests directory and run the following command:

py.test

If you want to test the nlu by yourself you can send http-request to the nlu-server api. It will respond with its prediction data.

curl -XPOST localhost:5000/parse -d '{"q":"hallo"}'

Further information about the status and configuration of the nlu-server could be received by querying /status or /config

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.