Coder Social home page Coder Social logo

sudharshanshanmugasundaram / chatbot Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 7.0 16.69 MB

Chatbot implementation using Cornell Movie Dialog Dataset in PyTorch.The bot can converse with the user and can answer the questions asked though it doesn't pass the Turing Test

License: MIT License

Jupyter Notebook 100.00%
natural-language-processing seq2seq attention-mechanism pytorch python deep-learning recurrent-neural-networks gru lstm cornell-corpus-dataset

chatbot's Introduction

Chatbot

Chatbot implementation using Cornell Movie Dialogs Dataset in PyTorch.The bot can converse with the user and can answer the questions asked though it doesn't pass the Turing Test.

It is bulit using Sequence to Sequence architecture with Attention Mechanism.

Sequence To Sequence model introduced in Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation has since then, become the Go-To model for Dialogue Systems and Machine Translation. It consists of two RNNs (Recurrent Neural Network) : An Encoder and a Decoder. The encoder takes a sequence(sentence) as input and processes one symbol(word) at each timestep. Its objective is to convert a sequence of symbols into a fixed size feature vector that encodes only the important information in the sequence while losing the unnecessary information.Each hidden state influences the next hidden state and the final hidden state can be seen as the summary of the sequence. This state is called the context or thought vector, as it represents the intention of the sequence. From the context, the decoder generates another sequence, one symbol(word) at a time.

What is a chatbot ???

A chatbot (also known as a smartbots, talkbot, chatterbot, Bot, IM bot, interactive agent, Conversational interface or Artificial Conversational Entity) is a computer program or an artificial intelligence which conducts a conversation via auditory or textual methods.Such programs are often designed to convincingly simulate how a human would behave as a conversational partner, thereby passing the Turing test. Chatbots are typically used in dialog systems for various practical purposes including customer service or information acquisition. Some chatterbots use sophisticated natural language processing systems, but many simpler systems scan for keywords within the input, then pull a reply with the most matching keywords, or the most similar wording pattern, from a database.

The term "ChatterBot" was originally coined by Michael Mauldin (creator of the first Verbot, Julia) in 1994 to describe these conversational programs.Today, most chatbots are either accessed via virtual assistants such as Google Assistant and Amazon Alexa, via messaging apps such as Facebook Messenger or WeChat, or via individual organizations' apps and websites.Chatbots can be classified into usage categories such as conversational commerce (e-commerce via chat), analytics, communication, customer support, design, developer tools, education, entertainment, finance, food, games, health, HR, marketing, news, personal, productivity, shopping, social, sports, travel and utilities.

Dataset

This corpus contains a large metadata-rich collection of fictional conversations extracted from raw movie scripts:

  • 220,579 conversational exchanges between 10,292 pairs of movie characters

  • involves 9,035 characters from 617 movies

  • in total 304,713 utterances

  • movie metadata included:

    • genres

    • release year

    • IMDB rating

    • number of IMDB votes

    • IMDB rating

  • character metadata included:

    • gender (for 3,774 characters)

    • position on movie credits (3,321 characters)

  • see README.txt (included) for details

The dataset can be downloaded here : Cornell Movie Dialogs Corpus

Requirements

  1. PyTorch
  2. Python
  3. CUDA (if you want to train on a GPU)

The overall implementation is inspired by this post on pytorch.org

chatbot's People

Contributors

sudharshanshanmugasundaram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chatbot's Issues

Missing train function usage

Hi,

I'm trying to use your code to a chatbot and your work is very valuable to me. However, I found that you only published the statement of function Train and TrainIters without an example of how I could use it.

Moreover, when I try to call the TrainIters function, I found some parameters, such as encoder_optimizer, decoder_optimizer and clip have never been mentioned before. So I have no idea with the format of them. Could you please tell me how to get these parameters or just give me an example of training the model.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.