Constants And Required Functions

Data Preprocessing

Required Directories Creation

Listing Directories

Evaluation Matrix For First Model for Chatbot using Seq2seq Approach

Dataset and DataLoader Creation

Question & Answer ChatBot QABot Model Creation

Attention

Encoder

Decoder

Seq2Seq

The heart of chatbot is a sequence-to-sequence (seq2seq) model. The goal of a seq2seq model is to take a variable-length question sequence as an input, and return a variable-length answer sequence as an output.

Components :

Loading Best Seq2seq ChatBot Model

Evaluation : Test Results

BLEU Score

F1 Score

$$ \frac{2 \times precession \times recall}{precession + recall} $$

Rouge L Score

RougeL

"Recall-Oriented Understudy for Gisting Evaluation. It includes measures to automatically determine the quality of a summary by comparing it to other (ideal) summaries created by humans. The measures count the number of overlapping units such as n-gram, word sequences, and word pairs between the computer-generated summary to be evaluated and the ideal summaries created by humans.

"Given two sequences X and Y, the longest common subsequence (LCS) of X and recall reflects the proportion of words in X (reference summary sentence) that are also present in Y (candidate summary sentence); while unigram precision is the proportion of words in Y that are also in X. Unigram recall and precision count all cooccurring words regardless their orders; while ROUGE-L counts only in-sequence co-occurrences."

ROUGE-L is one type of ROUGE measures. It is calculated by taking into account longest common subsequence (LCS) between two sequences.It counts only in-sequence co-occurrences.

$$ \frac{(1+\beta^2) \times R \times P}{R + \beta^2 \times P} $$

Chat

Start Conversation with the Bot