Comments (1)
Hi textproofreading,
To train your own custom version, you can either (a) serialize your own data set before program initialization or you can (b) update the n-gram probabilities after each session with the user, which will require a HashMap buffer and a reserializing of data after each use, which will be fairly resource intensive.
(a) You'll need to have your custom training set in a .txt file and use a StringTokenizer to read the probabilities and grams into the HashMap. After it is full, you can serialize it into a file to be read by the program with:
try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(new File("trigram_hashmap.ser"))); oos.writeObject( trigrams ); // This is your data set HashMap oos.close(); } catch( IOException e ) { System.err.println( "Failed to Serialize file" ); System.err.println( e.getStackTrace() ); }
(b) The process is the same, except you will need to parse each n-gram set as it is being typed into the GUI window and store it in a buffer HashMap to serialize periodically and save user training data
Hope this helps!
from nlpwordpredictor.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nlpwordpredictor.