{"id":21141246,"url":"https://github.com/shz-code/chatbot-nltk","last_synced_at":"2025-07-08T10:40:15.892Z","repository":{"id":65560058,"uuid":"593501829","full_name":"shz-code/chatbot-nltk","owner":"shz-code","description":"Python Contextual Chatbot with Voice Recognition.","archived":false,"fork":false,"pushed_at":"2023-01-29T14:55:53.000Z","size":18,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T22:27:47.388Z","etag":null,"topics":["chatbot","pipeline","python","python-chatbot","pytorch-implementation","pyttsx3","speech-recognition","speech-to-text"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shz-code.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-26T06:38:05.000Z","updated_at":"2024-05-09T08:17:19.000Z","dependencies_parsed_at":"2023-02-15T23:15:37.348Z","dependency_job_id":null,"html_url":"https://github.com/shz-code/chatbot-nltk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shz-code/chatbot-nltk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fchatbot-nltk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fchatbot-nltk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fchatbot-nltk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fchatbot-nltk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shz-code","download_url":"https://codeload.github.com/shz-code/chatbot-nltk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fchatbot-nltk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264252275,"owners_count":23579836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chatbot","pipeline","python","python-chatbot","pytorch-implementation","pyttsx3","speech-recognition","speech-to-text"],"created_at":"2024-11-20T07:25:48.405Z","updated_at":"2025-07-08T10:40:15.828Z","avatar_url":"https://github.com/shz-code.png","language":"Python","readme":"# Python contextual chatbot with voice recognition.\n\n## Major packages used\n- Speech Recognition\n- PyTorch\n- Pyttsx\n- NLTK\n\n## Project requirements\n- `Python 3.7-3.9` (Pytorch limitation)\n\n## Installation Process\n\nFirst clone this git repository or download zip\n```console\n  git clone https://github.com/shz-code/chatbot-nltk.git\n```\nCreate a new virtual environment(Use Conda/ Virtual Environment) [Learn More.](https://docs.python.org/3/library/venv.html#:~:text=A%20virtual%20environment%20is%20created,the%20virtual%20environment%20are%20available.)\n\n**If virtual environment is not installed on your machine install it using below command.*\n```console\n  pip install virtualenv\n```\nActivate **virtualenv**\n```console\n   virtualenv env\n  .\\env\\Scripts\\activate  \n```\nRun pip to install all the dependencies\n```console\n  pip install -r requirements.txt\n```\nTrain your model based on [intents.json](https://github.com/shz-code/chatbot-nltk/blob/master/nlp_pipeline/training%20data/intents.json)\n\nIt will create `data.pth` which is the model data.\n\n```console\n  py .\\nlp_pipeline\\train.py\n```\nIf you get an error during the first run, you also need to install `nltk.tokenize.punkt`:\n\n*Run this once in your terminal:*\n\n```console\n  python\n  \u003e\u003e\u003e import nltk\n  \u003e\u003e\u003e nltk.download('punkt')\n```\nFinally start main.py\n```console\n  py main.py\n```\n\n## Features\n- Users can chat or speak with the bot.\n- The bot can generate answers based on pre-defined conditions or it will generate answer trained from [intents.json](https://github.com/shz-code/chatbot-nltk/blob/master/nlp_pipeline/training%20data/intents.json) data.\n## Customize\nYou can easily feed more data or customize the model by adding or modifying [intents.json](https://github.com/shz-code/chatbot-nltk/blob/master/nlp_pipeline/training%20data/intents.json) file.\n\nFor example\n```json\n{\n  \"intents\": [\n    {\n      \"tag\": \"new-tag\",\n      \"patterns\": [\n        \"all the question patterns related to that tag\",\n        \"question 1\",\n        \"question 2\"\n      ],\n      \"responses\": [\n        \"all the response patterns related to that tag\",\n        \"response 1\",\n        \"response 2\"\n      ]\n    },\n    ...\n  ]\n}\n```\n**NB**: You need to train your model again if you have modified the [intents.json](https://github.com/shz-code/chatbot-nltk/blob/master/nlp_pipeline/training%20data/intents.json) file. Run `train.py` file to train your chatbot. If you see no changes happening than delete the old **data.pth** file and train again.\n\n\n\n## Acknowledgements\n- Main Project idea [Patrick Loeber](https://github.com/patrickloeber/pytorch-chatbot)\n- Main article [Contextual Chatbots with TenserFlow](https://chatbotsmagazine.com/contextual-chat-bots-with-tensorflow-4391749d0077) \n- Supporting article [Complete guide to build your ai chatbot with nlp in python](https://www.analyticsvidhya.com/blog/2021/10/complete-guide-to-build-your-ai-chatbot-with-nlp-in-python/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshz-code%2Fchatbot-nltk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshz-code%2Fchatbot-nltk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshz-code%2Fchatbot-nltk/lists"}