nelsondca / Eliza_Chatbot

0 stars 0 forks source link

Trigram-Based ELIZA Chatbot

This project is a version of ELIZA chatbot that generates responses using a trigram language model.

Table of contents

  1. Overview
  2. How it works
  3. Technology used
  4. Setup instructions
  5. Usage
  6. Purpose
  7. Conclusion

Overview

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.

How it workds

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

  2. Generating Responses

Why is This project Useful?

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.

Runing the code in VSCODE

- connect to codespaces

- select codeespace environment already existent HumbleDisco

- python 3 kernel

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