{"id":49549150,"url":"https://github.com/adityajhakumar/walmart_ai_chatbot","last_synced_at":"2026-05-02T21:04:39.178Z","repository":{"id":253141548,"uuid":"842595194","full_name":"adityajhakumar/WALMART_ai_CHATBOT","owner":"adityajhakumar","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-15T08:59:40.000Z","size":1177,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-15T19:10:11.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adityajhakumar.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-08-14T17:06:42.000Z","updated_at":"2024-08-15T08:59:43.000Z","dependencies_parsed_at":"2024-08-17T01:34:01.800Z","dependency_job_id":null,"html_url":"https://github.com/adityajhakumar/WALMART_ai_CHATBOT","commit_stats":null,"previous_names":["adityajhakumar/walmart_ai_chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adityajhakumar/WALMART_ai_CHATBOT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FWALMART_ai_CHATBOT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FWALMART_ai_CHATBOT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FWALMART_ai_CHATBOT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FWALMART_ai_CHATBOT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityajhakumar","download_url":"https://codeload.github.com/adityajhakumar/WALMART_ai_CHATBOT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityajhakumar%2FWALMART_ai_CHATBOT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32549390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2026-05-02T21:04:36.245Z","updated_at":"2026-05-02T21:04:39.174Z","avatar_url":"https://github.com/adityajhakumar.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Shopping Assistant Chatbot\n\n## Overview\n\nThe Shopping Assistant Chatbot is a Python application designed to facilitate shopping by providing information about food recipes and supermarket items. It leverages the GPT-2 model for generating natural language responses and integrates data from Excel spreadsheets to offer specific item details and recommendations.\n\n## Features\n\n- **Natural Language Processing:** Utilizes the GPT-2 model to understand and respond to user queries.\n- **Item Information:** Retrieves and displays details about supermarket items, including price and brand.\n- **Recipe Suggestions:** Provides examples of food recipes to inspire users.\n- **Preference Tracking:** Remembers user preferences for shopping items to personalize future interactions.\n\n## Requirements\n\nTo run this chatbot, you'll need:\n\n- **Python 3.7 or higher**: Ensure Python is installed on your system.\n- **Libraries**: Install required libraries using pip:\n  - `pandas` for data manipulation.\n  - `transformers` for GPT-2 model.\n\n## Installation\n\nFollow these steps to set up the chatbot:\n\n1. **Clone the Repository:**\n   ```bash\n   git clone https://github.com/yourusername/shopping-assistant-chatbot.git\n   cd shopping-assistant-chatbot\n   ```\n\n2. **Install Dependencies:**\n   Install the necessary Python libraries:\n   ```bash\n   pip install pandas transformers\n   ```\n\n3. **Prepare Data Files:**\n   - Ensure you have the following Excel files:\n     - `food_recipes_large.xlsx`: Contains food recipes with columns like `Food Item Name`.\n     - `supermarket_items_large.xlsx`: Contains supermarket items with columns like `Item Name`, `Price`, and `Brand`.\n   - Place these files in the `/content` directory or adjust the file paths in the script accordingly.\n\n## Usage\n\nTo interact with the chatbot:\n\n1. **Run the Chatbot Script:**\n   ```bash\n   python chatbot.py\n   ```\n\n2. **Provide User Input:**\n   - **Show Examples:** Type `show me more food` or `show me more supermarket` to get additional examples.\n   - **Find Item Details:** Enter a query like `I want to buy [item name] from Walmart` to get information about a specific item.\n   - **Exit:** Type `exit`, `quit`, or `bye` to end the conversation.\n\n## Detailed Explanation of Functions\n\n### `generate_response(prompt)`\n\n- **Purpose:** Generates a natural language response to the user's input using the GPT-2 model.\n- **Parameters:** `prompt` (string) - The user's query or input.\n- **Returns:** A string containing the generated response.\n\n### `get_random_examples(df, num_examples=5)`\n\n- **Purpose:** Retrieves a random sample of items from the provided DataFrame.\n- **Parameters:** \n  - `df` (DataFrame) - The DataFrame to sample from (either food recipes or supermarket items).\n  - `num_examples` (int) - The number of random examples to return.\n- **Returns:** A DataFrame containing the sampled examples.\n\n### `get_supermarket_info(item_name)`\n\n- **Purpose:** Fetches details of an item from the supermarket database.\n- **Parameters:** `item_name` (string) - The name of the item to search for.\n- **Returns:** A list of dictionaries with item details (`Item Name`, `Price`, `Brand`) if found; otherwise, `None`.\n\n### `remember_shopping_preference(item_name, category)`\n\n- **Purpose:** Stores the user's preference for a particular item in a specified category.\n- **Parameters:**\n  - `item_name` (string) - The name of the item.\n  - `category` (string) - The category of the item (e.g., 'Shopping').\n- **Returns:** None. Updates the `shopping_preferences` dictionary.\n\n### `handle_shopping_query(item_name)`\n\n- **Purpose:** Handles queries related to purchasing items and provides information or generates additional responses if the item is not found.\n- **Parameters:** `item_name` (string) - The name of the item being queried.\n- **Returns:** A string with details about where to buy the item or a generated response if the item is not found.\n\n### `initial_welcome()`\n\n- **Purpose:** Provides a welcome message with examples of food and supermarket items.\n- **Returns:** A string with the initial greeting and example items.\n\n### `show_more_examples(df, num_examples=10)`\n\n- **Purpose:** Shows additional examples from the provided DataFrame.\n- **Parameters:**\n  - `df` (DataFrame) - The DataFrame to sample from (either food recipes or supermarket items).\n  - `num_examples` (int) - The number of additional examples to return.\n- **Returns:** A DataFrame containing the sampled examples.\n\n## Notes\n\n- Ensure that the Excel files are formatted correctly with the necessary columns.\n- Adjust file paths in the script if the data files are not in the `/content` directory.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityajhakumar%2Fwalmart_ai_chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityajhakumar%2Fwalmart_ai_chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityajhakumar%2Fwalmart_ai_chatbot/lists"}