{"id":20267422,"url":"https://github.com/ledsouza/machine-learning-api","last_synced_at":"2026-05-10T13:10:53.869Z","repository":{"id":250622277,"uuid":"834975062","full_name":"ledsouza/machine-learning-api","owner":"ledsouza","description":"Este projeto demonstra os conceitos básicos de desenvolvimento de APIs para modelos de Machine Learning utilizando Flask.","archived":false,"fork":false,"pushed_at":"2024-07-28T21:55:09.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T05:20:30.508Z","etag":null,"topics":["api","flask","machine-learning","mlops"],"latest_commit_sha":null,"homepage":"","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/ledsouza.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-07-28T21:49:41.000Z","updated_at":"2024-07-28T21:56:22.000Z","dependencies_parsed_at":"2024-07-28T23:17:00.997Z","dependency_job_id":null,"html_url":"https://github.com/ledsouza/machine-learning-api","commit_stats":null,"previous_names":["ledsouza/machine-learning-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fmachine-learning-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fmachine-learning-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fmachine-learning-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledsouza%2Fmachine-learning-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ledsouza","download_url":"https://codeload.github.com/ledsouza/machine-learning-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241746795,"owners_count":20013165,"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","flask","machine-learning","mlops"],"created_at":"2024-11-14T12:14:39.143Z","updated_at":"2026-05-10T13:10:48.833Z","avatar_url":"https://github.com/ledsouza.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## API para Predição de Preço de Imóveis e Análise de Sentimentos 🏡💬\n\n![Static Badge](https://img.shields.io/badge/Status-Finalizado-green)\n\n## Descrição\n\nEste projeto demonstra os conceitos básicos de desenvolvimento de APIs para modelos de Machine Learning utilizando Flask. Ele oferece dois endpoints principais:\n\n- **Análise de Sentimentos:** Analisa o sentimento expresso em um texto, retornando a polaridade da frase.\n- **Predição de Preço de Imóveis:** Prevê o preço de um imóvel com base em suas características (tamanho, ano de construção e número de vagas na garagem).\n\n## Tecnologias Utilizadas\n\n- Python\n- Flask\n- TextBlob\n- Googletrans\n- Scikit-learn (LinearRegression)\n- Pickle\n- Flask-BasicAuth\n\n## Endpoints da API\n\n### 1. Análise de Sentimentos\n\n- **Rota:** `/sentimento/\u003cfrase\u003e`\n- **Método:** GET\n- **Parâmetros:**\n    - `frase`: Frase a ser analisada (string).\n- **Retorno:** Polaridade da frase (número entre -1 e 1).\n\n**Exemplo de Requisição:**\n```\nGET /sentimento/Este filme é incrível!\n```\n\n**Exemplo de Resposta:**\n```\n  polaridade: 0.8\n```\n\n### 2. Predição de Preço de Imóveis\n\n- **Rota:** `/cotacao/`\n- **Método:** POST\n- **Autenticação:** Basic Auth (usuário: `user`, senha: `admin`)\n- **Corpo da Requisição (JSON):**\n```json\n{\n  \"tamanho\": 100,\n  \"ano\": 2010,\n  \"garagem\": 2\n}\n```\n- **Retorno:** Preço previsto do imóvel (número).\n\n**Exemplo de Requisição:**\n```\nPOST /cotacao/\nContent-Type: application/json\n\n{\n  \"tamanho\": 100,\n  \"ano\": 2010,\n  \"garagem\": 2\n}\n```\n\n**Exemplo de Resposta:**\n```json\n{\n  \"preco\": 550000.0\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fledsouza%2Fmachine-learning-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fledsouza%2Fmachine-learning-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fledsouza%2Fmachine-learning-api/lists"}