当前位置: 首页 > news >正文

wordpress游戏支付宝百度seo公司

wordpress游戏支付宝,百度seo公司,前端和后端哪个难,做自我介绍的网站的图片素材EnToZhAPI项目简介 项目背景 提供本地化的英文翻译服务API。支持单句翻译请求或者批量翻译请求。支持建立查询词汇表。 项目架构 前端:使用原生js,使用MDB作为CSS框架。django模板引擎渲染可视化界面。 后端:使用waitress作为后端服务器…

EnToZhAPI项目简介

项目背景

提供本地化的英文翻译服务API。支持单句翻译请求或者批量翻译请求。支持建立查询词汇表。

项目架构

前端:使用原生js,使用MDB作为CSS框架。django模板引擎渲染可视化界面。

后端:使用waitress作为后端服务器。django作为web应用框架。

翻译模型:Helsinki-NLP/opus-mt-en-zh
ps: 有效果更好的模型欢迎留言。

API:使用django-ninjaAPI实现RESTFUL API服务以及API文档。

数据库:默认使用sqlite。

缓存:使用redis进行缓存数据管理。

异步任务队列:使用celery进行异步任务处理。

反向代理:使用Nginx处理用户请求并完成分发。

项目构建:使用docker进行项目开发部署以及项目生产部署。

项目开源地址

https://gitee.com/chaofanat/EnToZhAPI

在线测试地址http://api.chaofan.online/

轻量服务器计算性能有限,翻译速度较慢。翻译效果取决于翻译的模型。

python调用API示例

import httpx, json, timetranslate_api = "http://api.chaofan.online/api/translate"def batchtranslate(texts : list[str]):payload = {"text": texts}payload = json.dumps(payload)r = httpx.post(url = "http://api.chaofan.online/api/translate/batch/", data = payload).json()task_ids = r["task_ids"]print("已经获取任务ID:")print(task_ids)print("可以通过url:"+translate_api+"/{task_id} 获取任务执行结果。")print("任务执行中,等待获取结果(默认等待1分钟后获取任务结果)。。。")time.sleep(1*60)translate_res = []for task_id in task_ids: res = httpx.get(url = f"{translate_api}/{task_id}").json()translate_res = translate_res+res["result"]print("获取任务结果成功:")print("##################")for res in translate_res:print(res)return translate_ressentences = ["The quick brown fox jumps over the lazy dog.","Every moment is a fresh beginning.","Life is what happens when you're busy making other plans.","Stars can't shine without darkness.","Believe in yourself and all that you are.","Success is not final, failure is not fatal: it is the courage to continue that counts.","The best way to predict your future is to create it.","Smile, because it confuses people.","Dream big and dare to fail.","Happiness is a direction, not a destination.","You miss 100% of the shots you don't take.","The only way to do great work is to love what you do.","The future belongs to those who believe in the beauty of their dreams.","Be the change you wish to see in the world.","If you want to go fast, go alone. If you want to go far, go together.","The only limit to our realization of tomorrow will be our doubts of today.","The greatest glory in living lies not in never falling, but in rising every time we fall.","Opportunity is missed by most people because it is dressed in overalls and looks like work.","Life is 10% what happens to us and 90% how we react to it.","The best time to plant a tree was 20 years ago. The second best time is now."
]translate_res = batchtranslate(sentences)for i in translate_res:print(i)
http://www.mmbaike.com/news/98832.html

相关文章:

  • wordpress网站加密码制作网站的app
  • 深圳 公司网站设计网络营销论文题目
  • 做公司网站需要哪些资料活动推广软文范例
  • 唐山百度做网站多少钱文员短期电脑培训
  • wordpress商城主题点击精灵seo
  • 微信电影网站怎么做的百度推广登陆首页
  • 东莞海边网站建设工作室抖音推广渠道有哪些
  • 用自己的ip怎么查看dw8建设的网站百度软件中心官网
  • 有个专门做3d同人网站全球搜索引擎排名2022
  • 百度做网站价格芭嘞seo
  • 网页设计与网站建设实战大全促销活动推广方法有哪些
  • 手机网站模板开发房管局备案查询网站
  • 建英文网站有用吗黑马培训机构
  • 网站盈利模式友情链接的获取途径有哪些
  • 沈阳做招聘网站网站内容如何优化
  • 重庆中国建设监理协会网站网络软文怎么写
  • wordpress地址url进行优化
  • 衡水做wap网站的地方网站批量收录
  • 都江堰网站建设站长统计app
  • 网站怎么加在线客服推广怎么推
  • 在线教育做网站好还是app好知名seo公司
  • 淘宝客做网站怎么做百度指数官网登录
  • 正规做兼职的网站seo教程 seo之家
  • 青县网站建设价格网站seo基础优化
  • 电信备案新增网站seo综合查询怎么用的
  • 汽车网站策划东莞seo建站咨询
  • pc网站转换成微网站线上广告推广平台
  • 深圳网站模板投放广告怎么投放
  • 福州网站维护网页制作公司哪家好
  • 长沙网站建设策划厦门网站快速排名优化