{"id":18305792,"url":"https://github.com/yaricom/chatbot-shopping-list","last_synced_at":"2025-04-05T16:32:47.979Z","repository":{"id":94042368,"uuid":"106120604","full_name":"yaricom/chatbot-shopping-list","owner":"yaricom","description":"This is simple chatbot application with Natural Language Understanding to maintain very simple shopping list","archived":false,"fork":false,"pushed_at":"2017-10-10T14:53:20.000Z","size":14,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T06:51:20.745Z","etag":null,"topics":["chat-bot","chatbot","natural-language-processing","natural-language-understanding","rasa-nlu","spacy-nlp"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/yaricom.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":"2017-10-07T18:23:25.000Z","updated_at":"2023-03-08T13:09:32.000Z","dependencies_parsed_at":"2023-05-03T12:00:37.872Z","dependency_job_id":null,"html_url":"https://github.com/yaricom/chatbot-shopping-list","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaricom%2Fchatbot-shopping-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaricom%2Fchatbot-shopping-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaricom%2Fchatbot-shopping-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaricom%2Fchatbot-shopping-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaricom","download_url":"https://codeload.github.com/yaricom/chatbot-shopping-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247366930,"owners_count":20927625,"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":["chat-bot","chatbot","natural-language-processing","natural-language-understanding","rasa-nlu","spacy-nlp"],"created_at":"2024-11-05T15:35:44.117Z","updated_at":"2025-04-05T16:32:47.974Z","avatar_url":"https://github.com/yaricom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is simple chatbot application with Natural Language Understanding to maintain very simple shopping list. It's built using [RASA NLU][rasa_nlu_home] Python library with [Spacy NLP][spacy_nlp_home] backend.\nThe bot which we will create assumes that anything our bot's users say can be categorized into one of the following intents:\n1. Greetings (**greet**)\n2. Adding item to the shopping list (**add_item**)\n3. Removing all items from shopping list (**clear_list**)\n4. Displaying shopping list (**show_items**) \n5. The debug command to return number of items in the list (**_num_items**) \n\n## System Requirements ##\nAs it was already mentined we are going to use RASA NLU and Spacy NLP Python libraries which should be installed.\n\nTo install current stable version of [RASA NLU][rasa_nlu_home] just run\n```python\npip install rasa_nlu\n```\n\nTo install current version of [Spacy NLP][spacy_nlp_home] execute\n```python\npip install -U spacy\n```\n\nWe will use English language Spacy model which can be installed as following:\n```python\npython -m spacy download en\n```\n\nAlso please make sure that sklearn_crfsuite installed on the system or install it:\n```python\npip install sklearn_crfsuite\n```\n\n## Preparing the Training Data ##\nTo build NLU model able to parse user's intents first we need to create appropriate training data which will allow our chatbot to interpret user's inputs and created structured data (intent/entities). The best way to get training texts is from real users, and the best way to get the structured data is to pretend to be the bot yourself. For the purpose of this experiment we will create small training data corpus in format described at: https://rasa-nlu.readthedocs.io/en/stable/dataformat.html\n\nThe best way to create training data in rasa's format and to validate it is to use great [online tool](https://rasahq.github.io/rasa-nlu-trainer/) created by [@azazdeaz](https://github.com/azazdeaz).\n\nThe resulting training data file in JSON format can be found in the *data* folder.\n\n## Training a New NLU Model ##\nThere are two modes to use Rasa NLU models - as a HTTP server or directly from Python. In this experiment taking into account small size of our training data we will train and use NLU model directly from Python. \n\nTo do this first we need to create corresponding Rasa NLU configuration file. We will use Spacy NLP as backend thus configuration file will be:\n```json\n{\n  \"pipeline\": \"spacy_sklearn\",\n  \"path\" : \"./projects\",\n  \"data\" : \"./data/shopping-list/rasa/shopping-list-small.json\"\n}\n```\n\nFor more details as how to run Rasa NLU models directly from Python refer to: https://rasa-nlu.readthedocs.io/en/stable/python.html\n\n## The Shopping List Chatbot ##\nThe training data includes extremelly limited knowledge of grocery items to be purchased - eggs, milk, and butter. But it can be easy extended by modifying training data file mentioned above.\n\nThe chatbot can be used as following:\n```python\nIn [1]: from shopping_bot import ShoppingBot\n\nIn [2]: bot = ShoppingBot()\n\nIn [3]: bot.handle(\"Hello\")\nHow are you!\n\nIn [4]: bot.handle(\"add milk\")\nShopping list items:\nmilk - quantity: 1\n\nIn [5]: bot.handle(\"i need eggs\")\nShopping list items:\nmilk - quantity: 1\neggs - quantity: 1\n\nIn [6]: bot.handle(\"i need eggs and milk\")\nShopping list items:\nmilk - quantity: 2\neggs - quantity: 2\n\nIn [7]: bot.handle(\"my list\")\nShopping list items:\nmilk - quantity: 2\neggs - quantity: 2\n\nIn [8]: bot.handle(\"_num_items\")\n# of unique items: 2, total # of items: 4\n\nIn [9]: bot.handle(\"clear list\")\nItems removed from your list!\nYour shopping list is empty!\n\nIn [10]: bot.handle(\"_num_items\")\nshopping list is empty\n# of unique items: 0, total # of items: 0\n```\n\nThe supported grocery items:\n* eggs\n* milk\n* butter\n\n[rasa_nlu_home]:https://rasa-nlu.readthedocs.io/en/stable/\n[spacy_nlp_home]:https://spacy.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaricom%2Fchatbot-shopping-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaricom%2Fchatbot-shopping-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaricom%2Fchatbot-shopping-list/lists"}