{"id":28436399,"url":"https://github.com/codebasics/project-nlp-log-classification","last_synced_at":"2025-06-27T18:31:15.214Z","repository":{"id":275214691,"uuid":"917836362","full_name":"codebasics/project-nlp-log-classification","owner":"codebasics","description":"Log classification using hybrid classification framework","archived":false,"fork":false,"pushed_at":"2025-01-31T21:53:00.000Z","size":145,"stargazers_count":8,"open_issues_count":0,"forks_count":20,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-05T22:09:05.153Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebasics.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":"2025-01-16T18:28:18.000Z","updated_at":"2025-05-22T20:41:02.000Z","dependencies_parsed_at":"2025-02-01T05:45:18.232Z","dependency_job_id":null,"html_url":"https://github.com/codebasics/project-nlp-log-classification","commit_stats":null,"previous_names":["codebasics/project-nlp-log-classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codebasics/project-nlp-log-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebasics%2Fproject-nlp-log-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebasics%2Fproject-nlp-log-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebasics%2Fproject-nlp-log-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebasics%2Fproject-nlp-log-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebasics","download_url":"https://codeload.github.com/codebasics/project-nlp-log-classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebasics%2Fproject-nlp-log-classification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262310781,"owners_count":23291620,"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":[],"created_at":"2025-06-05T22:09:03.208Z","updated_at":"2025-06-27T18:31:15.187Z","avatar_url":"https://github.com/codebasics.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Log Classification With Hybrid Classification Framework\n\nThis project implements a hybrid log classification system, combining three complementary approaches to handle varying levels of complexity in log patterns. The classification methods ensure flexibility and effectiveness in processing predictable, complex, and poorly-labeled data patterns.\n\n---\n\n## Classification Approaches\n\n1. **Regular Expression (Regex)**:\n   - Handles the most simplified and predictable patterns.\n   - Useful for patterns that are easily captured using predefined rules.\n\n2. **Sentence Transformer + Logistic Regression**:\n   - Manages complex patterns when there is sufficient training data.\n   - Utilizes embeddings generated by Sentence Transformers and applies Logistic Regression as the classification layer.\n\n3. **LLM (Large Language Models)**:\n   - Used for handling complex patterns when sufficient labeled training data is not available.\n   - Provides a fallback or complementary approach to the other methods.\n\n![architecture](resources/arch.png)\n\n---\n\n## Folder Structure\n\n1. **`training/`**:\n   - Contains the code for training models using Sentence Transformer and Logistic Regression.\n   - Includes the code for regex-based classification.\n\n2. **`models/`**:\n   - Stores the saved models, including Sentence Transformer embeddings and the Logistic Regression model.\n\n3. **`resources/`**:\n   - This folder contains resource files such as test CSV files, output files, images, etc.\n\n4. **Root Directory**:\n   - Contains the FastAPI server code (`server.py`).\n\n---\n\n## Setup Instructions\n\n1. **Install Dependencies**:\n   Make sure you have Python installed on your system. Install the required Python libraries by running the following command:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n2. **Run the FastAPI Server**:\n   To start the server, use the following command:\n\n   ```bash\n   uvicorn server:app --reload\n   ```\n\n   Once the server is running, you can access the API at:\n   - `http://127.0.0.1:8000/` (Main endpoint)\n   - `http://127.0.0.1:8000/docs` (Interactive Swagger documentation)\n   - `http://127.0.0.1:8000/redoc` (Alternative API documentation)\n\n---\n\n## Usage\n\nUpload a CSV file containing logs to the FastAPI endpoint for classification. Ensure the file has the following columns:\n- `source`\n- `log_message`\n\nThe output will be a CSV file with an additional column `target_label`, which represents the classified label for each log entry.\n\n---\n\n## Disclaimer\n\n**Copyrights Reserved**:  \n@Codebasics Inc  \n@LearnerX Pvt Ltd  \n\nThis project, including its code and resources, is intended solely for educational purposes and should not be used for any commercial purposes without proper authorization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebasics%2Fproject-nlp-log-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebasics%2Fproject-nlp-log-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebasics%2Fproject-nlp-log-classification/lists"}