{"id":21457833,"url":"https://github.com/rupanjana15/beforreal-backend","last_synced_at":"2026-05-04T21:37:06.431Z","repository":{"id":262460325,"uuid":"887300127","full_name":"rupanjana15/beforreal-backend","owner":"rupanjana15","description":"A FastAPI-based sarcasm detection API that uses a fine-tuned BERT model to classify text as sarcastic or not, with a sarcasm probability score.","archived":false,"fork":false,"pushed_at":"2024-11-12T14:26:40.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T13:33:57.094Z","etag":null,"topics":["api","bert","docker","fastapi","machine-learning","nlp","python","sarcasm-detection","text-classification","torch","transformers"],"latest_commit_sha":null,"homepage":"https://beforreal.api-cloud.one/docs","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/rupanjana15.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-11-12T14:05:22.000Z","updated_at":"2024-11-12T14:27:02.000Z","dependencies_parsed_at":"2024-11-12T19:30:40.384Z","dependency_job_id":null,"html_url":"https://github.com/rupanjana15/beforreal-backend","commit_stats":null,"previous_names":["rupanjana15/beforreal-backend"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupanjana15%2Fbeforreal-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupanjana15%2Fbeforreal-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupanjana15%2Fbeforreal-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupanjana15%2Fbeforreal-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rupanjana15","download_url":"https://codeload.github.com/rupanjana15/beforreal-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971193,"owners_count":20376784,"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":["api","bert","docker","fastapi","machine-learning","nlp","python","sarcasm-detection","text-classification","torch","transformers"],"created_at":"2024-11-23T06:07:18.805Z","updated_at":"2026-05-04T21:37:06.352Z","avatar_url":"https://github.com/rupanjana15.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# beforreal backend 🧐\r\n\r\n![FastAPI](https://img.shields.io/badge/FastAPI-0.95.2-green)\r\n![Docker](https://img.shields.io/badge/Docker-Supported-blue)\r\n![Python](https://img.shields.io/badge/Python-3.8%2B-yellow)\r\n![License](https://img.shields.io/badge/License-MIT-brightgreen)\r\n\r\nA FastAPI-based sarcasm detection API using a fine-tuned BERT model to predict sarcasm in text.\r\n\r\n## Setup\r\n\r\n### 1. Download Model and Tokenizer\r\n\r\nGet `model.pt` and `tokenizer.pkl` from the [Releases](https://github.com/yourusername/sarcasm-detection-api/releases) section, and place them in the `src/` directory.\r\n\r\n### 2. Run Locally\r\n\r\n```bash\r\npip install -r requirements.txt\r\nuvicorn src.app:app --host 0.0.0.0 --port 8000\r\n```\r\n\r\n### 3. Run with Docker\r\n\r\n```bash\r\ndocker build -t sarcasm-detection-api .\r\ndocker run -p 8000:8000 sarcasm-detection-api\r\n```\r\n\r\n## Usage\r\n\r\n**Endpoint:** `POST /predict`\r\n\r\n**Payload:**\r\n```json\r\n{\r\n  \"sentence\": \"I just love waiting in traffic all day!\"\r\n}\r\n```\r\n\r\n**Response:**\r\n```json\r\n{\r\n  \"prediction\": \"Sarcastic\",\r\n  \"sarcasm_score\": 0.87,\r\n  \"sarcasm\": true\r\n}\r\n```\r\n\r\n**Example:**\r\n```bash\r\ncurl -X POST \"http://localhost:8000/predict\" -H \"Content-Type: application/json\" -d '{\"sentence\": \"Your input here\"}'\r\n```\r\n\r\n## Testing\r\n\r\n```bash\r\npytest test_api.py\r\n```\r\n\r\n## License\r\n\r\n[MIT License](./LICENSE)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupanjana15%2Fbeforreal-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frupanjana15%2Fbeforreal-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupanjana15%2Fbeforreal-backend/lists"}