GithubHelp home page GithubHelp logo

next-word-prediction's Introduction

Text Prediction Java Program

This is a simple Java program that demonstrates how to use a text prediction model to predict the next word given a prefix. The program uses bigrams (pairs of adjacent words) to generate predictions. This project uses built in libraries for preprocessing (cleaning and tokenizing) the text data. An n-gram was used to vreate a contiguous sequence of n items from a given sample of text and then the NextWordPredictor class uses a simple frequency-based model to predict the next word based on the given n-gram.

Getting Started

To run this program, you will need to have Java installed on your computer. You can download the latest version of Java from the official website.

Once you have Java installed, you can compile and run the program using the following commands:

javac Main.java
java Main

This will compile the Main.java file and run the program.

Usage

The program is designed to predict the next word given a prefix. To change the prefix, you can modify the prefix variable in the main method of the Main class.

You can also modify the sample text used to train the model by changing the text variable in the main method. The text used in the main method was extrated from the book Journal of a cruise of the United States Schooner Dolphin.

Contributing

If you'd like to contribute to this project, please fork the repository and submit a pull request.

License

This project is licensed under the MIT License.

next-word-prediction's People

Contributors

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