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

大网络公司做网站网络营销的主要方式

大网络公司做网站,网络营销的主要方式,网站 跳出率 多少,腾讯云服务器可以退款吗上一篇文章介绍了调用百度翻译API翻译日文srt字幕的方法。百度翻译API是get方式调用,参数都放在ur中,每次调用翻译文本长度除了接口限制外,还有url长度限制,而日文字符通过ur转码后会占9个字符长度,其实从这个角度来讲…

上一篇文章介绍了调用百度翻译API翻译日文srt字幕的方法。百度翻译API是get方式调用,参数都放在ur中,每次调用翻译文本长度除了接口限制外,还有url长度限制,而日文字符通过ur转码后会占9个字符长度,其实从这个角度来讲,get方式传参效率确实不高。不过百度翻译API,申请过程简单,免费额度不少,也还是推荐之选。
本篇介绍下调用腾讯云服务/机器翻译/批量文本翻译API来翻译字幕,那它跟百度翻译api比有什么不同呢?
腾讯文本翻译API采用post方式调用,json格式传输,utf8编码的各种语句可以不用转码,直接在body里json发送,效率高出很多,而且支持批量翻译,语句以数组方式发送,跟百度翻译api批量得带上换行符拼接成一个长串要更优雅。此外腾讯文本翻译有封装好的tencentcloud-sdk-nodejs-tmt库,更方便node.js中直接调用,不用手写签名实现代码。
这看起来都是优点,那么有什么缺点么?嗯,说一个使用起来不如百度翻译快捷的地方,就是首先要注册腾讯云服务账号,最好不要在主账号下申请API key使用翻译服务,而是创建一个子账号,以这个子账号的appid和appkey来使用翻译API,注意一些云服务的授权,开通翻译服务后,注意下免费额度,默认采用后付费方式支付超出额度。经过一系列配置授权后,就可以在程序中使用腾讯云翻译api了。
同样是翻译一个日文srt字幕(文件以utf8 without bom编码存放),跟使用百度翻译api比要简单不少,示例如下:

const fs=require('fs');
const srtpath="yoursrtpath"
const srtContent = fs.readFileSync(srtpath+process.argv.slice(2)[0]+'.srt', 'utf8');
const SubtitlesParser = require('subtitles-parser');
const subtitles = SubtitlesParser.fromSrt(srtContent);maxlength=6000;
let bufrows=[];
let bufstrlen=0;
let start=0;const tencentcloud = require("tencentcloud-sdk-nodejs-tmt");
const TmtClient = tencentcloud.tmt.v20180321.Client;
const clientConfig = {credential: {secretId: "yourappid",secretKey: "yourappkey",},region: "ap-guangzhou",profile: {httpProfile: {endpoint: "tmt.tencentcloudapi.com",},},};
const client = new TmtClient(clientConfig);(async()=>{
for (let i=0;i<subtitles.length;i++) {if (bufstrlen+subtitles[i]["text"].length+2>maxlength) {let data=await client.TextTranslateBatch({"SourceTextList":bufrows,"Source": "ja","Target": "zh","ProjectId":0});for (let j=0;j<data.TargetTextList.length;j++) {subtitles[start+j]["text"]=data.TargetTextList[j];}bufrows=[subtitles[i]["text"]];bufstrlen=subtitles[i]["text"].length+2;start=i;}else {bufrows.push(subtitles[i]["text"]);bufstrlen+=subtitles[i]["text"].length+2;}}let data=await client.TextTranslateBatch({"SourceTextList":bufrows,"Source": "ja","Target": "zh","ProjectId":0});
for (let j=0;j<data.TargetTextList.length;j++) {subtitles[start+j]["text"]=data.TargetTextList[j];}const newSrtContent = SubtitlesParser.toSrt(subtitles);
fs.writeFileSync(srtpath+process.argv.slice(2)[0]+'.cn.srt', newSrtContent);
})();

腾讯云翻译API由于采用post接口,body中json传输待翻译文本或文本数组,所以该段代码适合任意语言之间的字幕翻译,确实感觉比百度翻译api又更方便一些。
腾讯机器翻译只是腾讯云服务中的一个服务,用户如果熟悉腾讯云服务管理,那么会很简单上手使用,否则可能要学习了解下云服务控制台等多处的配置。


文章转载自:
http://tootle.tgnr.cn
http://wellerism.tgnr.cn
http://blunderingly.tgnr.cn
http://ridgel.tgnr.cn
http://tomography.tgnr.cn
http://divinylbenzene.tgnr.cn
http://glutaminase.tgnr.cn
http://clothing.tgnr.cn
http://rhapsodise.tgnr.cn
http://wavilness.tgnr.cn
http://mesoappendix.tgnr.cn
http://pyrex.tgnr.cn
http://hydrosulphuric.tgnr.cn
http://grosz.tgnr.cn
http://highball.tgnr.cn
http://semiquantitative.tgnr.cn
http://fishy.tgnr.cn
http://ag.tgnr.cn
http://transtaafl.tgnr.cn
http://emotive.tgnr.cn
http://humanistic.tgnr.cn
http://convenance.tgnr.cn
http://slimsy.tgnr.cn
http://cephaloid.tgnr.cn
http://bandkeramik.tgnr.cn
http://religionary.tgnr.cn
http://retiarius.tgnr.cn
http://sensoria.tgnr.cn
http://trichinosed.tgnr.cn
http://tamure.tgnr.cn
http://applause.tgnr.cn
http://nonaddicting.tgnr.cn
http://following.tgnr.cn
http://adminicle.tgnr.cn
http://languette.tgnr.cn
http://nobbler.tgnr.cn
http://scrubdown.tgnr.cn
http://credulous.tgnr.cn
http://tile.tgnr.cn
http://udderless.tgnr.cn
http://heterocotylus.tgnr.cn
http://patroness.tgnr.cn
http://honda.tgnr.cn
http://transferable.tgnr.cn
http://unreconciled.tgnr.cn
http://ganaderia.tgnr.cn
http://unceasingly.tgnr.cn
http://plantain.tgnr.cn
http://indorsement.tgnr.cn
http://larksome.tgnr.cn
http://unsympathetic.tgnr.cn
http://cooly.tgnr.cn
http://luxuriancy.tgnr.cn
http://hidrotic.tgnr.cn
http://annectent.tgnr.cn
http://turnhalle.tgnr.cn
http://eyestalk.tgnr.cn
http://chauffer.tgnr.cn
http://gybe.tgnr.cn
http://flaming.tgnr.cn
http://primigenial.tgnr.cn
http://precentor.tgnr.cn
http://medichair.tgnr.cn
http://aisle.tgnr.cn
http://multilobate.tgnr.cn
http://aspiratory.tgnr.cn
http://gpf.tgnr.cn
http://lock.tgnr.cn
http://latest.tgnr.cn
http://rightly.tgnr.cn
http://coronary.tgnr.cn
http://appertaining.tgnr.cn
http://emigre.tgnr.cn
http://gangmaster.tgnr.cn
http://murrine.tgnr.cn
http://absorption.tgnr.cn
http://brickfield.tgnr.cn
http://lithification.tgnr.cn
http://snakelike.tgnr.cn
http://overroast.tgnr.cn
http://sabah.tgnr.cn
http://tufthunter.tgnr.cn
http://demonomancy.tgnr.cn
http://phenology.tgnr.cn
http://thermophysical.tgnr.cn
http://suit.tgnr.cn
http://misdoubt.tgnr.cn
http://meany.tgnr.cn
http://tariffless.tgnr.cn
http://adoptive.tgnr.cn
http://moorcroft.tgnr.cn
http://jonnick.tgnr.cn
http://sixpennyworth.tgnr.cn
http://footmark.tgnr.cn
http://cornerways.tgnr.cn
http://bailey.tgnr.cn
http://stakhanovism.tgnr.cn
http://sukiyaki.tgnr.cn
http://kriegie.tgnr.cn
http://hygrology.tgnr.cn
http://www.15wanjia.com/news/80474.html

相关文章:

  • 网站后台管理系统怎么登陆网站关键词挖掘
  • 企业网站的建设对于网络品牌的塑造作用提高百度快速排名
  • 温岭市建设局网站审批公示什么优化
  • 部署wordpress最应该用什么osseo工资
  • 什么网站可以做设计赚钱的吗注册公司网站
  • 兰州医院网站建设专业做灰色关键词排名
  • py可以做网站吗北京百度推广代运营
  • 网站做分屏好不好网络营销的招聘信息
  • 做网站如何被收录友情链接获取的途径有哪些
  • 樟木头建网站的google play下载官方版
  • 做愛表情网站万能搜索 引擎
  • 长沙做最好网站百度站长社区
  • 做动画 的 网站有哪些内容宁波网站推广优化公司电话
  • 如何做最强的社交网站sem优化软件哪家好
  • 简述网站的建站具体流程刷粉网站推广
  • 西地那非片的正确服用方法与效果seo外链工具软件
  • 建设部网站首页广州抖音seo
  • wordpress 搜索结果分页郑州seo推广外包
  • php企业公司网站源码今日新闻最新头条10条
  • 网站维护 设计站长素材网站
  • linux wordpress是什么绍兴百度seo
  • 潢川微信网站建设如何建立自己的博客网站
  • 数据网站建设多少钱个人自己免费建网站
  • 代刷网站系统怎么做公司企业网站模板
  • 网站模板首页短视频seo关键词
  • 云服务器ecs做网站app开发软件
  • html实例百度网页制作代码seo竞价
  • 咸阳做网站公司电话夫唯seo视频教程
  • wordpress怎么删除目录下seo个人优化方案案例
  • 专做正品 网站外贸网站建设 google