A Marvelous ChatBot implement using PyTorch.

Overview

PyTorch Marvelous ChatBot

[Update]

it's 2019 now, previously model can not catch up state-of-art now. So we just move towards the future a transformer based chatbot, it's much more accurate and flexiable as well as full of imagination interms of being a cahtbot!!! More importantly we are opensourced the whole codes here: http://manaai.cn/aicodes_detail3.html?id=36 Be sure to check it if you interested in chatbot and NLP!! it's build with tensorflow 2.0 newest api!!

Aim to build a Marvelous ChatBot

Synopsis

This is the first and the only opensource of ChatBot, I will continues update this repo personally, aim to build a intelligent ChatBot, as the next version of Jarvis.

This repo will maintain to build a Marvelous ChatBot based on PyTorch, welcome star and submit PR.

Already Done

Currently this repo did those work:

  • based on official tutorial, this repo will move on develop a seq2seq chatbot, QA system;
  • re-constructed whole project, separate mess code into data, model, train logic;
  • model can be save into local, and reload from previous saved dir, which is lack in official tutorial;
  • just replace the dataset you can train your own data!

Last but not least, this project will maintain or move on other repo in the future but we will continue implement a practical seq2seq based project to build anything you want: Translate Machine, ChatBot, QA System... anything you want.

Requirements

PyTorch
python3
Ubuntu Any Version
Both CPU and GPU can works

Usage

Before dive into this repo, you want to glance the whole structure, we have these setups:

  • config: contains the config params, which is global in this project, you can change a global param here;
  • datasets: contains data and data_loader, using your own dataset, you should implement your own data_loader but just a liitle change on this one;
  • models: contains seq2seq model definition;
  • utils: this folder is very helpful, it contains some code may help you get out of anoying things, such as save model, or catch KeyboardInterrupt exception or load previous model, all can be done in here.

to train model is also straightforward, just type:

python3 train.py

Contribute

wecome submit PR!!!! Let's build ChatBot together!

Contact

if you have anyquestion, you can find me via wechat jintianiloveu

You might also like...
Implement of "Training deep neural networks via direct loss minimization" in PyTorch for 0-1 loss

This is the implementation of "Training deep neural networks via direct loss minimization" published at ICML 2016 in PyTorch. The implementation targe

Unofficial pytorch-lightning implement of Mip-NeRF
Unofficial pytorch-lightning implement of Mip-NeRF

mipnerf_pl Unofficial pytorch-lightning implement of Mip-NeRF, Here are some results generated by this repository (pre-trained models are provided bel

This repository is related to an Arabic tutorial, within the tutorial we discuss the common data structure and algorithms and their worst and best case for each, then implement the code using Python.

Data Structure and Algorithms with Python This repository is related to the Arabic tutorial here, within the tutorial we discuss the common data struc

Implement object segmentation on images using HOG algorithm proposed in CVPR 2005
Implement object segmentation on images using HOG algorithm proposed in CVPR 2005

HOG Algorithm Implementation Description HOG (Histograms of Oriented Gradients) Algorithm is an algorithm aiming to realize object segmentation (edge

Memoized coduals - Shows that it is possible to implement reverse mode autodiff using a variation on the dual numbers called the codual numbers
Politecnico of Turin Thesis: "Implementation and Evaluation of an Educational Chatbot based on NLP Techniques"

THESIS_CAIRONE_FIORENTINO Politecnico of Turin Thesis: "Implementation and Evaluation of an Educational Chatbot based on NLP Techniques" GENERATE TOKE

Keqing Chatbot With Python
Keqing Chatbot With Python

KeqingChatbot A public running instance can be found on telegram as @keqingchat_bot. Requirements Python 3.8 or higher. A bot token. Local Deploy git

Implement face detection, and age and gender classification, and emotion classification.
Implement face detection, and age and gender classification, and emotion classification.

YOLO Keras Face Detection Implement Face detection, and Age and Gender Classification, and Emotion Classification. (image from wider face dataset) Ove

offical implement of our Lifelong Person Re-Identification via Adaptive Knowledge Accumulation in CVPR2021
offical implement of our Lifelong Person Re-Identification via Adaptive Knowledge Accumulation in CVPR2021

LifelongReID Offical implementation of our Lifelong Person Re-Identification via Adaptive Knowledge Accumulation in CVPR2021 by Nan Pu, Wei Chen, Yu L

Comments
  • Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.

    Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.

    Hello, While running train.py, I have got the below issue, could you check please?

    python train.py Reading lines... Read 141382 sentence pairs Trimmed to 11132 sentence pairs Counting words... Counted words: eng 2953 fra 4540 start training... ...\models\models.py:97: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. attn_weights = F.softmax( ...\models\models.py:109: UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument. output = F.log_softmax(self.out(output[0])) Traceback (most recent call last): File "train.py", line 186, in main() File "train.py", line 181, in main train(pair_data_loader, encoder1, attn_decoder1, 75000) File "train.py", line 99, in train loss = train_model(data_loader, input_variable, target_variable, encoder, File "train.py", line 69, in train_model loss += criterion(decoder_output[0], target_variable[di])

    opened by badi3-zz 0
  • got error when I run your code.

    got error when I run your code.

    Reading lines... Read 141382 sentence pairs Trimmed to 11132 sentence pairs Counting words... Counted words: eng 2953 fra 4540 start training... Traceback (most recent call last): File "train.py", line 186, in main() File "train.py", line 181, in main train(pair_data_loader, encoder1, attn_decoder1, 75000) File "train.py", line 100, in train decoder, encoder_optimizer, decoder_optimizer, criterion) File "train.py", line 52, in train_model loss += criterion(decoder_output[0], target_variable[di]) File "/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 224, in call result = self.forward(*input, **kwargs) File "/anaconda3/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 132, in forward self.ignore_index) File "/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py", line 676, in nll_loss raise ValueError('Expected 2 or 4 dimensions (got {})'.format(dim)) ValueError: Expected 2 or 4 dimensions (got 1)

    opened by carlhung 1
Owner
JinTian
You know who I am.
JinTian
Implement Decoupled Neural Interfaces using Synthetic Gradients in Pytorch

disclaimer: this code is modified from pytorch-tutorial Image classification with synthetic gradient in Pytorch I implement the Decoupled Neural Inter

Andrew 114 Dec 22, 2022
Using pytorch to implement unet network for liver image segmentation.

Using pytorch to implement unet network for liver image segmentation.

zxq 1 Dec 17, 2021
Deployment of PyTorch chatbot with Flask

Chatbot Deployment with Flask and JavaScript In this tutorial we deploy the chatbot I created in this tutorial with Flask and JavaScript. This gives 2

Patrick Loeber (Python Engineer) 107 Dec 29, 2022
Third party Pytorch implement of Image Processing Transformer (Pre-Trained Image Processing Transformer arXiv:2012.00364v2)

ImageProcessingTransformer Third party Pytorch implement of Image Processing Transformer (Pre-Trained Image Processing Transformer arXiv:2012.00364v2)

null 61 Jan 1, 2023
Official pytorch implement for “Transformer-Based Source-Free Domain Adaptation”

Official implementation for TransDA Official pytorch implement for “Transformer-Based Source-Free Domain Adaptation”. Overview: Result: Prerequisites:

stanley 54 Dec 22, 2022
a Pytorch easy re-implement of "YOLOX: Exceeding YOLO Series in 2021"

A pytorch easy re-implement of "YOLOX: Exceeding YOLO Series in 2021" 1. Notes This is a pytorch easy re-implement of "YOLOX: Exceeding YOLO Series in

null 91 Dec 26, 2022
PyTorch Implement of Context Encoders: Feature Learning by Inpainting

Context Encoders: Feature Learning by Inpainting This is the Pytorch implement of CVPR 2016 paper on Context Encoders 1) Semantic Inpainting Demo Inst

null 321 Dec 25, 2022
A Pytorch implement of paper "Anomaly detection in dynamic graphs via transformer" (TADDY).

TADDY: Anomaly detection in dynamic graphs via transformer This repo covers an reference implementation for the paper "Anomaly detection in dynamic gr

Yue Tan 21 Nov 24, 2022
SFD implement with pytorch

S³FD: Single Shot Scale-invariant Face Detector A PyTorch Implementation of Single Shot Scale-invariant Face Detector Description Meanwhile train hand

Jun Li 251 Dec 22, 2022
Implement of homography net by pytorch

HomographyNet Implement of homography net by pytorch Brief Introduction This project is based on the work Homography-Net: @article{detone2016deep, t

ronghao_CN 4 May 19, 2022