Coder Social home page Coder Social logo

intentparser's Introduction

IntentParser for Python

This is simple intent parser for using with chatbots, natural language processing ,etc.

Getting Started

What you have to do is declare your intent parser -> teach it -> Done!

intent = ip.intentParser({
        'description' : {
         #Type aka. Name of the intent parser
         "type" : 'FavMusicIntent',
         
         #arguement that need to be parse.
         "args" : [(ip.OPTIONAL, "musics_types")],
         
         #define all keyword you need to use.
         "keyword" : [(ip.REQUIRE, "musics_keyword"),(ip.OPTIONAL, "musics_types")] 
        },
        'musics_keyword' : ["is", "are", "music", "favourite", "genre"], #require keywords
        'musics_types' : ["pop","rock", "jazz", "country", "reggae"] #optional keywords
    })

This is all you have to do to set up your intent parser. Now how to train it is pretty easy.

intent.teachWords(["I love Reggae music.", "Rock is my favourite.", "I love Country music genre."])
#use teachWords() fill with list of sentence just simple as that.
#also you could train as many time as you want!

What it could do?

print(intent.getResult("I love Rock music."))
print(intent.getResult("Jazz is my favourite."))

Result

{'type': 'FavMusicIntent', 'args': [('musics_types', ['rock'])], 'confidence': 0.75}
{'type': 'FavMusicIntent', 'args': [('musics_types', ['jazz'])], 'confidence': 0.6666666666666666}

Cool! huh?!

Installing

To install it you just need to.

$ git clone https://github.com/nonkung51/IntentParser.git
$ cd IntentParser
$ python setup.py install

Usage

Contributing

This module is contributing by myself(nonkung51). If you want to contributing just contact me!

Authors

  • Nonthakon Jitchiranant - Initial work - nonkung51

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details

intentparser's People

Contributors

nonkung51 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.