{"id":14064784,"url":"https://github.com/curiousily/Deploy-BERT-for-Sentiment-Analysis-with-FastAPI","last_synced_at":"2025-07-29T19:31:18.758Z","repository":{"id":40962268,"uuid":"258980007","full_name":"curiousily/Deploy-BERT-for-Sentiment-Analysis-with-FastAPI","owner":"curiousily","description":"Deploy BERT for Sentiment Analysis as REST API using FastAPI, Transformers by Hugging Face and PyTorch","archived":false,"fork":false,"pushed_at":"2022-12-08T09:42:11.000Z","size":89,"stargazers_count":201,"open_issues_count":8,"forks_count":60,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-30T13:12:31.481Z","etag":null,"topics":["bert","deep-learning","deploy-machine-learning","deployment","fastapi","huggingface","huggingface-transformer","machine-learning","python","pytorch","rest","rest-api","sentiment-analysis","transformers","uvicorn"],"latest_commit_sha":null,"homepage":"https://www.curiousily.com/posts/deploy-bert-for-sentiment-analysis-as-rest-api-using-pytorch-transformers-by-hugging-face-and-fastapi/","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/curiousily.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}},"created_at":"2020-04-26T08:35:01.000Z","updated_at":"2024-11-01T03:07:19.000Z","dependencies_parsed_at":"2023-01-25T06:00:50.371Z","dependency_job_id":null,"html_url":"https://github.com/curiousily/Deploy-BERT-for-Sentiment-Analysis-with-FastAPI","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/curiousily%2FDeploy-BERT-for-Sentiment-Analysis-with-FastAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curiousily%2FDeploy-BERT-for-Sentiment-Analysis-with-FastAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curiousily%2FDeploy-BERT-for-Sentiment-Analysis-with-FastAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curiousily%2FDeploy-BERT-for-Sentiment-Analysis-with-FastAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curiousily","download_url":"https://codeload.github.com/curiousily/Deploy-BERT-for-Sentiment-Analysis-with-FastAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228040854,"owners_count":17860211,"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":["bert","deep-learning","deploy-machine-learning","deployment","fastapi","huggingface","huggingface-transformer","machine-learning","python","pytorch","rest","rest-api","sentiment-analysis","transformers","uvicorn"],"created_at":"2024-08-13T07:04:04.721Z","updated_at":"2024-12-04T03:31:31.133Z","avatar_url":"https://github.com/curiousily.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Deploy BERT for Sentiment Analsysi with FastAPI\n\nDeploy a pre-trained BERT model for Sentiment Analysis as a REST API using FastAPI\n\n## Demo\n\nThe model is trained to classify sentiment (negative, neutral, and positive) on a custom dataset from app reviews on Google Play. Here's a sample request to the API:\n\n```bash\nhttp POST http://127.0.0.1:8000/predict text=\"Good basic lists, i would like to create more lists, but the annual fee for unlimited lists is too out there\"\n```\n\nThe response you'll get looks something like this:\n\n```js\n{\n    \"confidence\": 0.9999083280563354,\n    \"probabilities\": {\n        \"negative\": 3.563107020454481e-05,\n        \"neutral\": 0.9999083280563354,\n        \"positive\": 5.596495248028077e-05\n    },\n    \"sentiment\": \"neutral\"\n}\n```\n\nYou can also [read the complete tutorial here](https://www.curiousily.com/posts/deploy-bert-for-sentiment-analysis-as-rest-api-using-pytorch-transformers-by-hugging-face-and-fastapi/)\n\n## Installation\n\nClone this repo:\n\n```sh\ngit clone git@github.com:curiousily/Deploy-BERT-for-Sentiment-Analysis-with-FastAPI.git\ncd Deploy-BERT-for-Sentiment-Analysis-with-FastAPI\n```\n\nInstall the dependencies:\n\n```sh\npipenv install --dev\n```\n\nDownload the pre-trained model:\n\n```sh\nbin/download_model\n```\n\n## Test the setup\n\nStart the HTTP server:\n\n```sh\nbin/start_server\n```\n\nSend a test request:\n\n```sh\nbin/test_request\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuriousily%2FDeploy-BERT-for-Sentiment-Analysis-with-FastAPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuriousily%2FDeploy-BERT-for-Sentiment-Analysis-with-FastAPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuriousily%2FDeploy-BERT-for-Sentiment-Analysis-with-FastAPI/lists"}