Giter Club home page Giter Club logo

nlpsql's Introduction

NlpSQL

NlpSQL is a question answering system that uses natural language processing to generat SQL statements. I used NLTK <http://nltk.org/> to parse the text and created a parse grammar to build the SQL query. The goal of the project is to create an easy way for regular to fetch data from the database even if they don't know SQL language. The database engin used in this project is MySQL <https://www.mysql.com/>

License

NlpSQL is free software, released under the MIT.

Requirements

You will need some Python packages

To install dependencies (on a Debian-like GNU/Linux distribution):

git clone https://github.com/SalN3t/NlpSQL.git
cd NlpSQL
pip install requirements.txt

You will also need to download some NLTK data package. You can do so executing:

python -m nltk.downloader genesis maxent_treebank_pos_tagger punkt stopwords averaged_perceptron_tagger

You will also need MySQL database. You can do so if you don't have it by:

apt-get install mysql

Now you would need to create the databse schema provided. A good tutorial Create a MySQL Database on Linux via Command Line

Please make sure to name the database employees Ok, Now we will need to papulate the data:

mysql -u username -p employee < schema.sql

You would need to update the config file to connect to the databse by filling the data:

nano config.py

Then Change the following:

db_config = {
    'user': '##username##',
    'passwd': '##password##',
    'host': '##host##',   
    'db': 'employees',
    }

That's it!

Runing

Make sure you fulfill the requirements First.

To run:

python main.py

YouTube Demo

Demo

nlpsql's People

Contributors

saln3t avatar

Watchers

James Cloos avatar

Forkers

devshree07

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.