{"id":32693057,"url":"https://github.com/abhinavdev369/mini_ai","last_synced_at":"2026-05-07T19:05:24.539Z","repository":{"id":320830136,"uuid":"1083484437","full_name":"abhinavdev369/Mini_ai","owner":"abhinavdev369","description":" A Python/Flask API that serves three Hugging Face AI models: Sentiment Analysis, Zero-Shot Classification, and Named Entity Recognition (NER).  Option 2 (Longer \u0026 More Descriptive) A multi-task AI microservice built with Python and Flask. Serves pre-traine","archived":false,"fork":false,"pushed_at":"2025-10-26T05:57:39.000Z","size":202,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-26T07:19:30.448Z","etag":null,"topics":["api","artificial-intelligence","flask","huggingface","model","namedentityrecognition","nlp-machine-learning","pytorch","sentiment-analysis","zeroshot-classification"],"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/abhinavdev369.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-26T05:37:12.000Z","updated_at":"2025-10-26T06:01:23.000Z","dependencies_parsed_at":"2025-10-26T07:19:34.127Z","dependency_job_id":"eaa7881e-5fad-41b6-a816-7708a13de8d2","html_url":"https://github.com/abhinavdev369/Mini_ai","commit_stats":null,"previous_names":["abhinavdev369/mini_ai"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/abhinavdev369/Mini_ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavdev369%2FMini_ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavdev369%2FMini_ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavdev369%2FMini_ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavdev369%2FMini_ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhinavdev369","download_url":"https://codeload.github.com/abhinavdev369/Mini_ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavdev369%2FMini_ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32751795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["api","artificial-intelligence","flask","huggingface","model","namedentityrecognition","nlp-machine-learning","pytorch","sentiment-analysis","zeroshot-classification"],"created_at":"2025-11-01T16:02:49.373Z","updated_at":"2026-05-07T19:05:24.535Z","avatar_url":"https://github.com/abhinavdev369.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Task AI Microservice 🤖\n\nA lightweight Python \u0026 Flask API that serves three different pre-trained AI models from Hugging Face for real-time Natural Language Processing (NLP).\n\nThis project demonstrates how to operationalize multiple sophisticated AI models into a simple, easy-to-use web service. It can perform sentiment analysis, flexible zero-shot classification, and named[...]\n\n---\n\n## 🚀 Features\n\n- **Sentiment Analysis:** Classifies text as POSITIVE or NEGATIVE.  \n- **Zero-Shot Classification:** Classifies text against a custom list of labels you provide.  \n- **Named Entity Recognition (NER):** Extracts and categorizes entities like people (PER), organizations (ORG), and locations (LOC).  \n- **Lightweight \u0026 Fast:** Uses the Flask web server and optimized models.  \n- **Easy to Test:** All endpoints are accessible via simple GET requests in your browser.\n\n---\n\n## 🛠️ Tech Stack\n\n- **Python:** Core programming language.  \n- **Flask:** Lightweight web framework for building the API.  \n- **Hugging Face transformers:** Library for downloading and running the pre-trained AI models.  \n- **PyTorch:** The deep learning backend used by the models.\n\n---\n\n## 🏁 Getting Started\n\nFollow these instructions to get a copy of the project up and running on your local machine.\n\n### 1. Prerequisites\n\n- Python 3.8 or newer  \n- git installed on your machine\n\n### 2. Installation \u0026 Setup\n\nClone the repository:\n\n```bash\ngit clone https://github.com/abhinavdev369/Mini_ai.git\ncd Mini_ai\n```\n\nCreate a Python Virtual Environment:\n(Using venv5 as an example name, like in our setup)\n\n```bash\npython -m venv v5\n```\n\nActivate the Virtual Environment:\n\nOn Windows (PowerShell):\n\n```powershell\n.\\v5\\Scripts\\Activate.ps1\n```\n\nOn macOS / Linux:\n\n```bash\nsource v5/bin/activate\n```\n\nInstall the required libraries:\n\n```bash\npip install flask transformers torch\n```\n\n### 3. Running the Application\n\nStart the Flask server:\n\n```bash\npython app.py\n```\n\nWait for the models to load. The first time you run this, it will download several GB of AI models. This is normal. You will see messages like \"Loading AI model...\"\n\nOnce it says * Running on http://127.0.0.1:5000/, your AI API is live!\n\n---\n\n## 📖 API Endpoints \u0026 Usage\n\nYou can test all endpoints directly in your web browser.\n\n### 1. Homepage\n\nShows that the API is running.\n\n- URL: http://127.0.0.1:5000/\n\n---\n\n### 2. Sentiment Analysis\n\nClassifies a piece of text as either POSITIVE or NEGATIVE.\n\n- Endpoint: /analyze  \n- Model: distilbert-base-uncased-finetuned-sst-2-english  \n- URL Parameter: text\n\nTest URL:\n\nhttp://127.0.0.1:5000/analyze?text=This is a wonderful project and I am very happy\n\nSample Response:\n\n```json\n{\n  \"label\": \"POSITIVE\",\n  \"score\": 0.9998819828033447\n}\n```\n\n---\n\n### 3. Zero-Shot Classification\n\nClassifies text against a custom list of labels you provide.\n\n- Endpoint: /classify  \n- Model: facebook/bart-large-mnli  \n- URL Parameters: text and labels (comma-separated)\n\nTest URL:\n\nhttp://1.0.0.1:5000/classify?text=Apple just announced the new M5 chip\u0026labels=technology,sports,politics,food\n\nSample Response:\n\n```json\n{\n  \"labels\": [\n    \"technology\",\n    \"politics\",\n    \"sports\",\n    \"food\"\n  ],\n  \"scores\": [\n    0.9942001104354858,\n    0.002824905328452587,\n    0.002167098456993699,\n    0.0008078970131464303\n  ],\n  \"sequence\": \"Apple just announced the new M5 chip\"\n}\n```\n\n---\n\n### 4. Named Entity Recognition (NER)\n\nExtracts people, organizations, locations, and other entities from text.\n\n- Endpoint: /extract  \n- Model: dbmdz/bert-large-cased-finetuned-conll03-english  \n- URL Parameter: text\n\nTest URL:\n\nhttp://1.0.0.1:5000/extract?text=My name is Rohan and I work at Google in India.\n\nSample Response:\n\n```json\n[\n  {\n    \"entity_group\": \"PER\",\n    \"score\": 0.9996020793914795,\n    \"word\": \"Rohan\",\n    \"start\": 11,\n    \"end\": 16\n  },\n  {\n    \"entity_group\": \"ORG\",\n    \"score\": 0.9986345171928406,\n    \"word\": \"Google\",\n    \"start\": 31,\n    \"end\": 37\n  },\n  {\n    \"entity_group\": \"LOC\",\n    \"score\": 0.9996538162231445,\n    \"word\": \"India\",\n    \"start\": 41,\n    \"end\": 46\n  }\n]\n```\n\n---\n\n## 📄 Project Report\n\nFor a detailed breakdown of the project methodology, model choices, and results, please see the PROJECT_REPORT.md file.\n\n---\n\n## 📜 License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinavdev369%2Fmini_ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhinavdev369%2Fmini_ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinavdev369%2Fmini_ai/lists"}