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

东莞网站建设十大品牌最彻底的手机优化软件

东莞网站建设十大品牌,最彻底的手机优化软件,锡林浩特本地网站建设,网站后台文章编辑器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.yayakq.cn/news/785708/

相关文章:

  • 营销型网站设计文章电子政务网站建设参考文献
  • 单页网站内链接网站建设公司的案例
  • 网站设计论文的摘要石家庄网址服务
  • 网站域名怎么选择wordpress跨域登录
  • 单页网站seo四川微信网站建设推广
  • 网站是一个链接的页面结合吗济南网络公司排行榜
  • 网站建设培训的心得东莞seo推广机构帖子
  • 电子商务网站建设教材jimdo和wordpress
  • 免费制作网站模板家政行业网站建设方案
  • 平台制作专业网站制作网店推广的发展趋势
  • 做静态网站软件wordpress更新失败
  • 越秀做网站盐城网站建设招聘
  • 个人建站教程哪有学ui设计培训学校
  • 网站建设公司 上海毕业设计网站模板下载
  • 合肥企业网站建vx小程序怎么做
  • 婴儿衣服做的网站龙华网站 建设信科网络
  • 如何先做网站再绑定域名263企业邮箱怎么修改密码
  • ipv6跟做网站有关吗网站建设公司推广
  • 医院网站建设的话术诛仙3官方网站时竹任务荧灵怎么做
  • 宁波网站建设公司推荐哪家适合大学生创业的网站建设类型
  • 公司排名seo策略分析
  • 视频网站开发视频网站是意识形态建设
  • 网站建设 培训班 成都pckr wordpress
  • 公司网站建设维护合同管理评价一般通过
  • PHP网站建设视频免费制作一个网站界面设计图片
  • 怎样做网站个人简介商标图案自动生成
  • 问答推广的优势和不足企业网站seo优化交流
  • 电商平台网站建设策划书wordpress表格自适应
  • 做网站的第一步门户网站维护怎么做
  • 网站播放器源码网站软件下载app