Docker一条命令部署humanize-text AI文本拟人化REST API服务FastAPI与docker-compose完整指南【免费下载链接】humanize-textOpen-source text humanization pipeline with every intermediate step published. Two LLM rewrites at temp 1.3, then two hops across different NMT engines. Four documented methodologies you can read, modify, and run locally.项目地址: https://gitcode.com/gh_mirrors/hu/humanize-text想让 AI 生成的文章读起来更像人写的humanize-text 是一个开源的 AI 文本拟人化流水线先用 LLM 改写两轮temperature 1.3再跨两个不同的机器翻译引擎跳两次语言把 AI 味的统计指纹打散。而 Docker 部署让它更简单——一条docker compose up -d命令就能把整套流水线跑成 REST API 服务用 FastAPI 提供/humanize等接口HTTP 调用即得拟人化结果 humanize-text 的 4 步拟人化流水线在动手部署前先花 30 秒理解它拟人的原理。标准流水线共四步步骤引擎方向作用1LLMtemp 1.3输入 → 中文改写第一轮拟人化改写2LLMtemp 1.3中文 → 日语改写第二轮拟人化携带第一步历史3Google Translate日语 → 芬兰语一轮翻译远距离语言破坏结构4Niutrans芬兰语 → 英文二轮翻译跨引擎重建每一步的中间产物都可以导出查看这也是该项目每个中间步骤都公开的卖点。Docker 一条命令部署完整 3 步第 1 步克隆仓库并准备配置git clone https://gitcode.com/gh_mirrors/hu/humanize-text.git cd humanize-text cp config/config.example.toml config/config.toml然后编辑config/config.toml填入两个必需的 API Key详见 config/config.example.toml[api_keys] deepseek_api_key sk-... # LLM 改写用 niutrans_api_key your-key # 第4步翻译用 [llm] provider deepseek # 可选 openrouter / atlascloud / orcarouter 为什么必须挂载配置Docker 镜像不打包密钥config/目录以卷的形式挂载进容器改配置无需重新构建镜像。第 2 步一条命令启动服务docker compose up -d这一条命令背后docker-compose.yml 已经帮你安排好了一切构建上下文使用 docker/Dockerfile基于python:3.11-slim自动安装fastapi、pydantic、uvicorn端口映射8000:8000服务暴露在http://localhost:8000卷挂载./config:/app/config并设置CONFIG_PATH/app/config/config.toml重启策略unless-stopped异常退出后自动拉起第 3 步验证服务是否就绪curl http://localhost:8000/health # 返回 {status:ok} 即部署成功 ✅调用 REST API3 个端点Docker 版服务暴露的是 v1.0 多方法调度器源码src/methodologies/humanizer.py提供三个端点POST /humanize —— 核心拟人化接口curl -X POST http://localhost:8000/humanize \ -H Content-Type: application/json \ -d {text: Your AI text here, method: translation_chain}响应示例{ result: 拟人化后的文本……, method: translation_chain, processing_time_ms: 3456 }method参数支持 4 种已文档化的拟人化方法用GET /methods可随时查询方法说明translation_chain翻译链默认无需 GPUllm_rewriteLLM 多轮改写detection_guided检测器反馈闭环需本地模型约 4GB 显存mixed_engine混合引擎另外两个辅助端点GET /methods— 列出可用方法GET /health— 健康检查适合接入监控完整接口说明见 docs/api-reference.md。日常运维这些命令够用docker compose down # 停止并删除容器 docker compose up -d # 重新启动 docker compose logs -f # 实时查看日志 docker compose up -d --build # 修改代码后重新构建并启动由于config/是卷挂载的修改config/config.toml后只需重启容器即可生效docker compose restart常见问题速查 ️端口 8000 被占用编辑 docker-compose.yml把8000:8000改成9000:8000然后用http://localhost:9000访问。返回 422 校验错误检查请求体是否为合法 JSONtext字段必填。detection_guided报错该方法需要本地检测模型Binoculars RoBERTa标准场景用默认的translation_chain即可完全免 GPU。改了配置不生效确认配置写在容器外的config/config.toml并执行docker compose restart。写在最后Docker 部署 humanize-text 的核心就三条命令克隆仓库、写好config/config.toml、docker compose up -d。之后你获得的是一个带健康检查、支持 4 种拟人化方法的 REST API可以直接集成到自己的写作工具或后端服务中。 延伸阅读安装指南docs/installation.md配置详解docs/configuration.mdAPI 参考docs/api-reference.mdn8n 无代码工作流n8n/humanize_standard.json【免费下载链接】humanize-textOpen-source text humanization pipeline with every intermediate step published. Two LLM rewrites at temp 1.3, then two hops across different NMT engines. Four documented methodologies you can read, modify, and run locally.项目地址: https://gitcode.com/gh_mirrors/hu/humanize-text创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考