{"id":20321282,"url":"https://github.com/hellokaton/text-moderation-api","last_synced_at":"2025-04-11T19:03:18.823Z","repository":{"id":262794061,"uuid":"888371152","full_name":"hellokaton/text-moderation-api","owner":"hellokaton","description":"使用 Hono 开发的文本审核 API 服务 :)","archived":false,"fork":false,"pushed_at":"2024-11-19T09:36:56.000Z","size":154,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T14:51:16.876Z","etag":null,"topics":["hono","openai"],"latest_commit_sha":null,"homepage":"https://try.hono.my/api/check?text=hi","language":"TypeScript","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/hellokaton.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-14T09:33:41.000Z","updated_at":"2025-03-17T09:49:00.000Z","dependencies_parsed_at":"2025-04-11T19:01:35.213Z","dependency_job_id":null,"html_url":"https://github.com/hellokaton/text-moderation-api","commit_stats":null,"previous_names":["hellokaton/text-moderation-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellokaton%2Ftext-moderation-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellokaton%2Ftext-moderation-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellokaton%2Ftext-moderation-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellokaton%2Ftext-moderation-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellokaton","download_url":"https://codeload.github.com/hellokaton/text-moderation-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465301,"owners_count":21108243,"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":["hono","openai"],"created_at":"2024-11-14T19:12:34.521Z","updated_at":"2025-04-11T19:03:18.786Z","avatar_url":"https://github.com/hellokaton.png","language":"TypeScript","readme":"# 文本审核 API 服务\n\n基于 **Hono** 和 **OpenAI** 的文本审核 API 服务，使用了 **千问大模型**，能够高效、准确地对文本内容进行审核和分类。此服务支持识别色情、暴力、涉政等敏感内容，并可根据上下文进行语境判断，适合需要高精度文本审核的场景。\n\n## 功能特性\n\n- **语境分析**：支持上下文理解，提高分类准确性。\n- **色情内容识别**：准确识别潜在的色情内容。\n- **暴力内容识别**：检测文字中的暴力倾向和表达。\n- **涉政内容识别**：过滤敏感政治内容。\n- **多领域扩展性**：可以根据需求调整模型参数和审核策略。\n\n## 技术栈\n\n- **Hono**：用于构建高性能的 API 后端框架。\n- **OpenAI**：提供 Qwen 大模型的文本处理能力。\n- **Qwen-2-7b**：负责具体的文本审核任务，包括敏感内容识别和语境判断。\n\n## 效果图\n\n\u003ccenter class=\"half\"\u003e\n    \u003cimg src=\"screenshot/Snipaste_2024-11-14_18-01-18.jpg\" width=\"400\"/\u003e\n    \u003cimg src=\"screenshot/Snipaste_2024-11-14_18-00-28.jpg\" width=\"400\"/\u003e\n\u003c/center\u003e\n\n## 快速开始\n\n### 环境要求\n\n- Node.js 版本：`16.x` 或以上\n- npm / yarn\n- OpenAI API 密钥\n\n### 安装依赖\n\n在项目根目录下执行以下命令：\n\n```bash\npnpm install\n```\n\n### 配置文件\n\n在项目根目录创建 `wrangler.toml` 文件，设置 [OpenRouter](https://openrouter.ai/settings/keys) API 密钥：\n\n```bash\ncp wrangler.toml.example wrangler.toml \n```\n\n可以修改以下配置：\n\n- `OPENAI_BASE_URL`：API 服务的基础 URL。\n- `OPENAI_API_KEY`：OpenAI API 密钥。\n- `OPENAI_MODEL`：OpenAI 模型名称。\n\n### 启动服务\n\n运行以下命令启动 API 服务：\n\n```bash\npnpm run dev\n```\n\n启动后，API 服务将运行在 http://localhost:8787 上。\n\n可以使用 CURL 命令进行验证：\n\n```bash\ncurl -X POST http://localhost:8787/api/check -d 'text=今晚可以那个吗？' \n```\n\n### 发布到 Cloudflare Workers\n\n```bash\npnpm run deploy\n```\n\n## 贡献\n\n欢迎提交 Issue 和 Pull Request 来改进此项目。如有任何问题，请在仓库中进行讨论。\n\n### License\n\nMIT\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellokaton%2Ftext-moderation-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellokaton%2Ftext-moderation-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellokaton%2Ftext-moderation-api/lists"}