This project is a version of ELIZA chatbot that generates responses using a trigram language model.
This ELIZA chatbot version uses a trigram model( sequence of three characters) to generate responses. The model is trained on a collection of English texts and stored in trigrams.json. When the user types a message, the chatbot constructs a response by predicting the character based on the last two characters, using patterns from the trigram data.
Loads the trigram Model The trigram model, saved as trigrams.json, is loaded in JS code. This model is a JSON object where each trigram is mapped indicating how often it appeared in the training text.
Generating Responses
If you're curious about how simple rules can create a conversation-like interaction, this project is a great learning tool. To explore: AI principles How to build a client-side app with just HTML,CSS,and JavaScript.
TH IS A SA MP LE OF TE XT TH AT LO OKS LI KE EN GL ISH BUT MI GH T NO T MA KE S EN SE