{"id":21018638,"url":"https://github.com/amruthapatil/nyu-chatbot","last_synced_at":"2026-04-25T12:32:00.526Z","repository":{"id":231937686,"uuid":"783085996","full_name":"AmruthaPatil/NYU-ChatBot","owner":"AmruthaPatil","description":"Creating simple chatbot using movie scripts from the Cornell Movie Dialogs Corpus based on the PyTorch Chatbot Tutorial.","archived":false,"fork":false,"pushed_at":"2024-04-06T23:49:48.000Z","size":1561,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T17:56:30.793Z","etag":null,"topics":["high-performance-computing","machine-learning","pytorch","torchscript"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmruthaPatil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-06T22:40:51.000Z","updated_at":"2024-11-21T11:15:23.000Z","dependencies_parsed_at":"2024-04-06T23:29:15.192Z","dependency_job_id":"6c0c5916-34cc-41a0-b5e9-7a44541b3fb0","html_url":"https://github.com/AmruthaPatil/NYU-ChatBot","commit_stats":null,"previous_names":["amruthapatil/nyu-chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AmruthaPatil/NYU-ChatBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-ChatBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-ChatBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-ChatBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-ChatBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmruthaPatil","download_url":"https://codeload.github.com/AmruthaPatil/NYU-ChatBot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmruthaPatil%2FNYU-ChatBot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32262800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["high-performance-computing","machine-learning","pytorch","torchscript"],"created_at":"2024-11-19T10:26:54.799Z","updated_at":"2026-04-25T12:32:00.509Z","avatar_url":"https://github.com/AmruthaPatil.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatBot\n\n## Introduction\nThis project involves training a simple chatbot using movie scripts from the Cornell Movie Dialogs Corpus based on the PyTorch Chatbot Tutorial. The chatbot is implemented using a sequence-to-sequence model with Luong attention mechanism(s). The goal is to create an interactive chatbot that can engage in a meaningful conversation with users.\n\n## Prerequisites\nTo run this project, you will need the following:\n- Python 3.x\n- PyTorch\n- NumPy\n- Matplotlib\n- Weights and Biases (W\u0026B)\n\n## Methodology\nThe project consists of two main parts:\n\n### Part 1: Training a Simple Chatbot\n- Data Preparation: The chatbot is trained using the Cornell Movie Dialogs Corpus. The data is preprocessed and prepared for training.\n- Model Implementation: Implementation of a sequence-to-sequence model with Luong attention mechanism(s).\n- Training and Evaluation: Training and evaluation of the model using mini-batches.\n- Decoding Module: Implementation of greedy-search decoding module.\n- Interaction: Interaction with the trained chatbot.\n- Hyperparameter Tuning: Use of Weights and Biases (W\u0026B) for hyperparameter tuning.\n- Profiling: Profiling of the model using PyTorch Profiler to measure the time and memory consumption.\n![Training](images/BaiscRun.png)\n\n### Part 2: Transitioning to TorchScript\n- TorchScript Conversion: Explanation of differences between tracing and scripting in TorchScript and conversion of the trained model to TorchScript.\n- Model Evaluation: Evaluation of the TorchScript model.\n- Latency Comparison: Comparison of evaluation latency between the TorchScripted model and the original PyTorch model.\n\n## Results and Observations\n- The best hyperparameters were found using W\u0026B hyperparameter tuning, resulting in a minimum loss for the trained model.\n![W\u0026B](images/sweepimage.png)\n- The hyperparameters that significantly impacted the model's convergence were gradient clipping (clip), teacher forcing ratio (tf_ratio), and learning rate (lr).\n![Hyperparameter](images/parameter_loss.jpg)\n- Profiling of the model showed the time and memory consumption of the selected model’s operators.\n- The transition to TorchScript showed a significant improvement in performance on GPU, with the TorchScript model running approximately 1.93 times faster than the original PyTorch model.\n![Table](images/dftable.jpg)\n\n## How to Run and Use the Code\n1. Clone this repository.\n2. Install the required dependencies.\n3. Modify the W\u0026B initialization with appropriate project and user name (Update project=\"W\u0026BProjectName\", entity=\"W\u0026BUserName\")\n4. Run the Jupyter notebook `ChatBot.ipynb` to train and evaluate the chatbot model.\n5. For hyperparameter tuning, follow the instructions in the notebook to set up and run a sweep using W\u0026B.\n6. To convert the trained model to TorchScript and evaluate its performance, follow the instructions in the notebook.\n\n## References\n- [PyTorch Chatbot Tutorial](https://pytorch.org/tutorials/beginner/chatbot_tutorial.html)\n- [Cornell Movie Dialogs Corpus](https://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html)\n- [Weights and Biases Website](https://wandb.ai/site)\n- [PyTorch Profiler Example](https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html)\n- [PyTorch JIT and TorchScript](https://towardsdatascience.com/pytorch-jit-and-torchscript-c2a77bac0fff)\n\nThank you for exploring this repository!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famruthapatil%2Fnyu-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famruthapatil%2Fnyu-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famruthapatil%2Fnyu-chatbot/lists"}