Coder Social home page Coder Social logo

kajabraz / nextwordpredictor Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4.46 MB

A program which guesses next words based on the user's input. Suggestions are the words with the highest probability to follow what has been already written, calculated in the n_grams of different size.

Python 100.00%
nlp machine-learning ngrams bigram-model language-model prediction nltk corpus-linguistics brown-corpus next-word-prediction suggestion

nextwordpredictor's Introduction

NextWordPredictor

A program, the aim of which is to give suggestions of possible next words guessed on the basis of the user's input.

With the use of the nltk's brown corpus as training data, once adequately preprocessed, the program creates n_grams as the base for the prediction of possible next words which are most probable to be chosen by the user. The maximum size of n_grams is provided in advance. To choose the best matches, the program follows the n_grams hierarchy, which means that it calculates the probabilities of the highest n_grams and in case of missing data, the same process is repeated on the 'lower level', i.e. using the smaller n_grams, until it reaches the lowest n_grams (bigrams). If the desired number of suggestions is still not reached, they will be filled with the default words, selected on the basis of frequency.

The users are given suggestions of possible next words and in case their needs are not met, they may type their own word.

To run the program, you have to execute the "main.py" file.

obraz

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.