{"id":16048261,"url":"https://github.com/analyticalmonk/slack-gpt-classifier","last_synced_at":"2025-09-11T05:05:43.833Z","repository":{"id":236805599,"uuid":"793185222","full_name":"analyticalmonk/slack-gpt-classifier","owner":"analyticalmonk","description":"Python scripts to extract Slack messages, and classify their intent using OpenAI's GPT-4 API","archived":false,"fork":false,"pushed_at":"2024-04-28T17:04:33.000Z","size":4,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T07:01:59.448Z","etag":null,"topics":["gpt-4","intent-classification","openai","openai-api","slack","slack-api","zero-shot-learning"],"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/analyticalmonk.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-28T17:04:00.000Z","updated_at":"2024-09-18T16:31:14.000Z","dependencies_parsed_at":"2024-04-28T18:23:15.716Z","dependency_job_id":"25c6b26a-48f7-4406-bde4-74a0bee345a7","html_url":"https://github.com/analyticalmonk/slack-gpt-classifier","commit_stats":null,"previous_names":["analyticalmonk/slack-gpt-classifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analyticalmonk%2Fslack-gpt-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analyticalmonk%2Fslack-gpt-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analyticalmonk%2Fslack-gpt-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analyticalmonk%2Fslack-gpt-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/analyticalmonk","download_url":"https://codeload.github.com/analyticalmonk/slack-gpt-classifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902270,"owners_count":20366259,"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":["gpt-4","intent-classification","openai","openai-api","slack","slack-api","zero-shot-learning"],"created_at":"2024-10-09T00:05:36.654Z","updated_at":"2025-03-18T04:30:56.987Z","avatar_url":"https://github.com/analyticalmonk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Message Intent Classification\n\nThis repository contains Python scripts to extract messages from a specific Slack channel and user, and then classify those messages based on their intent using the OpenAI GPT-4 API.\n\n## Overview\n\nThe project consists of two main scripts:\n\n1. `export_slack_channel_data.py`: This script fetches messages from a specific Slack channel and user, and exports them to a CSV file.\n2. `classify_slack_csv.py`: This script reads the exported CSV file, sends each message to the OpenAI GPT-4 API for intent classification, and appends the API response to a new CSV file.\n\n## Use Case and Prompt Customization\n\nThe current implementation of the `classify_slack_csv.py` script is designed to classify Slack messages based on their sales intent. The script uses a predefined prompt to send messages to the OpenAI GPT-4 API for classification. The API response indicates whether the message is related to a customer's purchase decision, a sales decision, or a dropout from a sales discussion.\n\nHowever, this use case is just one example, and the script can be easily adapted to classify messages based on different intents or purposes by modifying the prompt.\n\nTo customize the prompt, open the `classify_slack_csv.py` script and locate the following line:\n\n```\nsales_intent_classifiction_prompt = \"\"\"\nProvided below is a Slack message from a sales team member from our company. \nIf the below text message is about a customer making a purchase decision about a product, providing reason for a sales decision, or dropping from sales discussion, respond with \"TRUE\", otherwise respond with \"FALSE\". \nDon't get confused between general feedback and sales intent.\n\nSLACK MESSAGE:\n\"\"\"\n```\n\nHere's how you can modify the prompt to classify customer support queries:\n\n```\nsales_intent_classification_prompt = \"\"\"\nProvided below is a Slack message from a team member. \nIf the below text message is about a customer asking for support or reporting an issue, respond with \"TRUE\", otherwise respond with \"FALSE\". \nEnsure to distinguish between general inquiries and specific support requests.\n\nSLACK MESSAGE:\n\"\"\"\n```\n\n## Prerequisites\n\nBefore running the scripts, you'll need to have the following:\n\n- Python 3.6 or later installed\n- A Slack workspace and the necessary permissions to export data\n- An OpenAI API key\n\n## Installation\n\n1. Clone the repository:\n\n`git clone https://github.com/your-username/slack-message-intent-classification.git`\n\n2. Install the required Python packages:\n\n`pip install -r requirements.txt`\n\n3. Set up the necessary environment variables:\n\nexport OPENAI_API_KEY='your_openai_api_key'\n\nReplace `'your_openai_api_key'` with your OpenAI API key.\n\n## Usage\n\n1. Run the `export_slack_channel_data.py` script to export messages from a specific Slack channel and user to a CSV file:\n\n2. Run the `python classify_slack_csv.py` script to read the previously exported CSV file, send each message to the GPT-4 API for intent classification, and append the API response to a new CSV file.\n\n*Note: Make sure to replace the required variables in both files before executing them.*\n\n## Contributing\n\nContributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the [MIT License](https://opensource.org/license/mit).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalyticalmonk%2Fslack-gpt-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanalyticalmonk%2Fslack-gpt-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalyticalmonk%2Fslack-gpt-classifier/lists"}