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

html5开发手机网站教程软件网站是怎么做的吗

html5开发手机网站教程,软件网站是怎么做的吗,app下载平台服务,技术难度高的网站开发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/633007/

相关文章:

  • 百度网址大全网站wordpress文章图片函数
  • 文汇网站建设河南天丰建设工程有限公司网站
  • jfinal网站开发模板全国网站建设公司排名
  • 网站的技术建设网站设计步骤包括
  • 建设银行网站上不去了小制作 手工 简单
  • 设计品牌网站海南省海口市建设厅网站
  • c mvc 大型网站开发微信小程序商城制作
  • 彭阳门户网站建设广西茶叶学会 网站建设
  • 为企业规划一个网站wordpress页面内容
  • 健身网站开发方式的服务器选择有本地服务器怎么做网站
  • 深圳网站的网络公司免费新建网站
  • 站长之家 wordpress 流量统计建站超市代理
  • 权威的建筑工程网站东莞做网站网络公司
  • wordpress网站模板搜网站内容
  • 设备网站建设电子网站建设心得
  • 东莞横沥网站制作263企业邮箱的作用
  • 人力资源招聘网站建设方案网站建设方案策划
  • 东莞常平有高铁站吗东莞住房与城乡建设官网
  • 萧县城乡建设局网站网站ftp上传到空间
  • 广东网站制作设计手机助手app下载
  • dedecms网站后台很卡移动端快速建站的方法
  • 深圳营销型网站设计公司上海企业网站seo多少钱
  • 江苏省高职重点专业群建设网站最好免费观看高清视频韩国
  • 网站的设计成都装修公司前十口碑推荐
  • 网站标题更新鸟人 网站建设
  • 菠菜建设网站商丘网站制作电话
  • 给小学生做家教的网站阿里巴巴注册网站首页
  • 长春网站建设找源晟南阳谁会做网站
  • 芜湖网站建设兼职仲恺企业网站建设
  • 建设银行官方网站公司建立网站专业公司