Git Product home page Git Product logo

intent-reco's Introduction

This repository was created as a part of a diploma thesis Semantic Sentence Similarity for Intent Recognition Task. While all the included code works and is well documented, as of now, it might be hard for anyone to actually use it, but feel free to try. It is my intention to convert it into a proper Python library in the future.

intent-reco

Template-based intent recognition system built on word embedding models.

Installation instructions:

Prerequisites:

Install Python 3.6 and higher

sudo python3 python3-pip python3-dev build-essential

Install Python package manager pipenv

pip3 install --user pipenv

Create and enter the virtual environment

pipenv shell

Install dependencies (including development):

pipenv install --dev

The intent recognition system is dependent on the used embedding model. These models are loaded using the wrappers in embeddings directory.

Currently supported embedding algorithms:

Depending on the embedding algorithm used, it might be needed to install its implementation. You will find the installation instructions for each algorithm on the respective repository.

Model compression

Module model_compression.py includes functions for compressing embedding models. It is able to compress the models by using different versions of vocabulary pruning and by using vector quantization.

The vector quantization is based on the LBG clustering algorithm, which is implemented in module lbg.py.

Intent recognition

The resulting intent recognition system is implemented in intent_query.py. As of now, it loads an embedding model and a set of intent templates from a JSON file (the templates are further quantized). The user can then write sentences in the command line and the algorithm will output the matched intent, together with the respective template and its cosine similarity to the input sentence.

Examples of an embedding model and a JSON template file can be found in the data directory.

intent-reco's People

Contributors

tiriar avatar

Watchers

James Cloos avatar Jiří Spilka avatar

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.