Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

mcdulltii/CChatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CChatbot

*.ini file specifications

  • intent (encapsulated by "[ ]")
    • [ < intent > ]
  • Keyword, Answer (delimited by "=", must be specified under an intent)
    • < ... >=< ... >

User commands

  1. reset
  2. load
  3. exit
  4. help
  5. save

Linked list method

  • Creates a new linked list for every intent loaded from the config ini file
  • Each keyword and answer is stored as a node within the linked list created
  • For the chatbot to answer a question, the intent is retrieved from the question to identify the correct linked list, then iterates through its nodes to find a keyword used from the question, then outputs its answer if found.

Hashtable method

  • Creates 4 hashtables (*counts, *weights, *hashtable, *intents)
  • For every intent loaded from the config ini file, *intents is appended
  • *counts and *weights are separated depending on each intent within *intents, where *counts signify the number of keyword-answer pair loaded into each intent, and *weights signify the unique index of each keyword for its output
  • *hashtable then stores the answer with weights as its index, such that its dependent on *weights
  • Rendezvous hashing and feature hashing are used such that known keywords within the question are retrieved, then its weights are calculated and totalled from *weights, and used as an index to retrieve the answer from *hashtable

To-dos

  • ✓ Linked list method has been fully implemented
  • ✕ Hashtable method suffers from memory leakage
  • ✕ Hashtable method can have *counts removed
  • ✕ Hashtable method lacks user command implementation

References