Giter VIP home page Giter VIP logo

next-word-predictor's Introduction

NEXT WORD SUGGESTION

implementation of text classification using bigrams and then using them predicting the next word of a sentence. We have used a yelp dataset which consists of reviews and its sentiment for multiple restaurant. We have employed Naive Bayes approach for this project. The outcome of the project is that when the user inputs a word, it will predict the next word and will continue until the user wants to stop.

FUNCTIONS:

The various libraries used are:

• Pandas: Used to read the csv file.

• Nltk (Natural Language tool kit) : to remove unimportant/unnecessary words from the dataset.

The various functions of python employed are:

• Reviews are extracted from the HTML or XML files using the BeautifulSoup library.

example = BeautifulSoup(Text,"lxml")

Text=example.get_text();

• Punctuations are removed from the reviews using the string substitution operation.

Text= re.sub("[^a-zA-Z]"," ",Text);

• The entire review is split into an array consisting of its words as individual elements.

lower_case = Text.lower()

tempwords = lower_case.split()

• To split the text into pairs of words(bigrams)

warr.append(Text)

bigrams = [b for l in warr for b in zip(l.split(' ')[:-1], l.split(' ')[1:])]

next-word-predictor's People

Contributors

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