Git Product home page Git Product logo

next_word_predictor's Introduction

Next Word Predictor

A Deep Learning Model to predict next word in a sequence using LSTM.

The Application is created using Tensorflow and Python.

Getting Started

  • Clone the repo and cd into the directory
$ git clone https://github.com/raj713335/Next_Word_Predictor.git
$ cd Next_Word_Predictor

The training data is present in the corpus.txt file.

The WordCloud of the traing Data

Install tensorflow and all the other required libraries

$ pip install tensorflow, keras 

import numpy as np
from nltk.tokenize import RegexpTokenizer
from keras.models import Sequential, load_model
from keras.layers import LSTM
from keras.layers.core import Dense, Activation
from keras.optimizers import RMSprop
import matplotlib.pyplot as plt
import pickle
import heapq
import tensorflow as tf
from wordcloud import WordCloud, STOPWORDS
import numpy as npy
from PIL import Image

Now To train the Model Enter to the NLP_DEEP_LEARNING FOLDER and then again to the sub directory CODE and run the Model Creator.py file

$ cd NLP_DEEP_LEARNING
$ cd CODE
$ python Model Creator.py

The Summary of the model created

Model: "sequential_1"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
lstm_1 (LSTM)                (None, 128)               749056    
_________________________________________________________________
dense_1 (Dense)              (None, 1334)              172086    
_________________________________________________________________
activation_1 (Activation)    (None, 1334)              0         
=================================================================
Total params: 921,142
Trainable params: 921,142
Non-trainable params: 0
_________________________________________________________________

Now To run the Model keras_next_word_model.h5 run the Output.py file

$ python Output.py

After that in command line you can enter the input for which you want to check the output.

NOW TO RUN THE GUI VERSION OF THE WORD_PREDICTOR

$ cd ..
$ cd ..
$ cd GUI
$ python GUI_WP.py

Thank You !

next_word_predictor's People

Contributors

raj713335 avatar

Stargazers

 avatar  avatar

Watchers

 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.