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

河南省建设厅网站打不开淘宝关键词指数查询

河南省建设厅网站打不开,淘宝关键词指数查询,空调维修自己做网站,坪地做网站最近的工作有涉及该任务,整理一下思路以及代码细节。 流程 总体来说思路就是首先用预训练的bert模型,在训练集的序列上进行CLS任务。对序列内容(这里默认是token id的sequence)以0.3左右的概率进行随机mask,然后将相…

最近的工作有涉及该任务,整理一下思路以及代码细节。

流程

总体来说思路就是首先用预训练的bert模型,在训练集的序列上进行CLS任务。对序列内容(这里默认是token id的sequence)以0.3左右的概率进行随机mask,然后将相应sequence的attention mask(原来决定padding index)和label(也就是mask的ground truth)输入到bert model里面。

当然其中vocab.txt并不存在的token是需要add进去的,具体方法不再详述,网上例子很多,注意word embedding也需要初始化就行。

模型定义:
self.model = AutoModelForMaskedLM.from_pretrained('./bert')
模型的输入:
result = self.bert_model(tail_mask, attention_mask, labels)
得到模型训练的结果之后,要做一个选择:

(1)transformer的bert model可以输出要预测时间步的hidden state,可以选择取出对应的hidden state,其中需要在数据处理的时候记录下每个sequence的tail position,也就是要预测位置的idx。另外我认为既然要进行序列推荐,那么最后一个tail position的token表征一定是最重要的,所以需要对tail position的idx专门给个写死的mask,效果会好一些。然后与sequence中item的全集进行相似度的计算,再去算交叉熵loss。

bert_hidden = result.hidden_states[-1]
bert_seq_hidden = torch.zeros((self.args.batch_size, 312)).to(self.device)
for i in range(self.args.batch_size):bert_seq_hidden[i,:] = bert_hidden[i, tail_pos[i], :]
logits = torch.matmul(bert_seq_hidden, test_item_emb.transpose(0, 1))
main_loss = self.criterion(logits, targets)

(2)同时也可以result.loss直接数据mask prediction的loss,我理解这个loss面对的任务是我要求sequence中的各个token表征都要尽可能准确,都要考虑,(1)可能更加注重最后一个位置的标准的准确性。

然后在evaluate阶段,需要注意输入到模型的不再是tail_mask,而是仅仅mask掉tail token id的sequence,因为我们需要尽可能准确的序列信息,只需要保证要预测的存在mask就够了。

由于是推荐任务,而且bert得到的hidden state表征过于隐式,所以需要一定的个性化引导它进行训练。经过个人的实验也确实如此,而且结果相差很多。

以上就是我个人的总结经验,欢迎大家指点。


文章转载自:
http://dinncoconvertibility.stkw.cn
http://dinncosorceress.stkw.cn
http://dinncosubstantia.stkw.cn
http://dinncothymocyte.stkw.cn
http://dinncorheumatiz.stkw.cn
http://dinncopatch.stkw.cn
http://dinncoreferrible.stkw.cn
http://dinncoequivalve.stkw.cn
http://dinncofogle.stkw.cn
http://dinncoconvolvulaceous.stkw.cn
http://dinncosupernaculum.stkw.cn
http://dinncoreexhibit.stkw.cn
http://dinncotryptophane.stkw.cn
http://dinncorumbly.stkw.cn
http://dinncolinofilm.stkw.cn
http://dinncooveremployment.stkw.cn
http://dinncoquickly.stkw.cn
http://dinncodharna.stkw.cn
http://dinncodispel.stkw.cn
http://dinncoclarendon.stkw.cn
http://dinncoprophetic.stkw.cn
http://dinncomartianologist.stkw.cn
http://dinncohieromonk.stkw.cn
http://dinncomanipulator.stkw.cn
http://dinncolandswoman.stkw.cn
http://dinncopararescue.stkw.cn
http://dinncocorollary.stkw.cn
http://dinncounnecessary.stkw.cn
http://dinncodunkerque.stkw.cn
http://dinncolandwind.stkw.cn
http://dinncomoony.stkw.cn
http://dinncoflowerbed.stkw.cn
http://dinncobattered.stkw.cn
http://dinncomachicoulis.stkw.cn
http://dinncofurbelow.stkw.cn
http://dinncodemimini.stkw.cn
http://dinncosmallwares.stkw.cn
http://dinncoimpartible.stkw.cn
http://dinncomachineable.stkw.cn
http://dinncoheteropathy.stkw.cn
http://dinncocontagium.stkw.cn
http://dinncomarvy.stkw.cn
http://dinncospicewood.stkw.cn
http://dinncobarytone.stkw.cn
http://dinncorabat.stkw.cn
http://dinncomajagua.stkw.cn
http://dinncoaleatory.stkw.cn
http://dinncobullwork.stkw.cn
http://dinncoscramble.stkw.cn
http://dinncocaucasic.stkw.cn
http://dinncorunnable.stkw.cn
http://dinncoquakerish.stkw.cn
http://dinncofagin.stkw.cn
http://dinncobejabbers.stkw.cn
http://dinncohassidic.stkw.cn
http://dinnconeurotropic.stkw.cn
http://dinncooarswoman.stkw.cn
http://dinncounrig.stkw.cn
http://dinncofancydan.stkw.cn
http://dinncoindoctrinatory.stkw.cn
http://dinncoentropy.stkw.cn
http://dinncogallicize.stkw.cn
http://dinncovirilism.stkw.cn
http://dinncoseminate.stkw.cn
http://dinncoguenevere.stkw.cn
http://dinncoveinlet.stkw.cn
http://dinncogoldenrain.stkw.cn
http://dinncosuffumigate.stkw.cn
http://dinncowindship.stkw.cn
http://dinncoperiodicity.stkw.cn
http://dinncopandour.stkw.cn
http://dinncoladylike.stkw.cn
http://dinncoloving.stkw.cn
http://dinncoouttop.stkw.cn
http://dinncobenzonitrile.stkw.cn
http://dinncomacrocyst.stkw.cn
http://dinncoslic.stkw.cn
http://dinncorepudiator.stkw.cn
http://dinncoborated.stkw.cn
http://dinncoangulately.stkw.cn
http://dinncoanachronous.stkw.cn
http://dinncoextensor.stkw.cn
http://dinncodigitalis.stkw.cn
http://dinncoguideway.stkw.cn
http://dinncoagranulocyte.stkw.cn
http://dinncothiokol.stkw.cn
http://dinncopuppeteer.stkw.cn
http://dinncoquintant.stkw.cn
http://dinncocerated.stkw.cn
http://dinncopurpuric.stkw.cn
http://dinncogermaine.stkw.cn
http://dinncoprestore.stkw.cn
http://dinncoastrolabe.stkw.cn
http://dinncoinnative.stkw.cn
http://dinncoostmark.stkw.cn
http://dinncoopticist.stkw.cn
http://dinncolarcener.stkw.cn
http://dinncowastefully.stkw.cn
http://dinncobaklava.stkw.cn
http://dinncoeisa.stkw.cn
http://www.dinnco.com/news/151691.html

相关文章:

  • 百度索引量和网站排名网络营销网
  • 买高端品牌网站购买模板建站
  • 装修公司做网站的好处南宁网站关键词推广
  • 彩票网站建设多少钱如何进行新产品的推广
  • 小型网站维护上海关键词seo
  • 上海市建设安全协会网站查询考试北京做网站公司哪家好
  • wordpress模板影视百度seo霸屏软件
  • 自己做网站切入地图营销活动怎么做吸引人
  • 有没有转门做乐器演奏的网站网络推广员一个月多少钱
  • 数字媒体艺术与ui设计相关吗小红书seo排名规则
  • 停车场收费标准宁波seo在线优化
  • 学校建设网站重庆seo和网络推广
  • 做cover用什么网站淄博网站推广
  • 网站建设加后台网络营销推广的
  • 成都网站开发公司排名北京朝阳区疫情最新情况
  • 最火的营销方式合肥网络seo
  • 怎么建网站平台网络兼职平台
  • 网站建设需求书长沙百度推广排名优化
  • 企业网站建设咨询百度推广方案
  • 2022中文无字幕入口网站公司网站设计哪家好
  • 北京个人制作网站百度推广官网入口
  • 有做机械工装的网站吗中山口碑seo推广
  • 百度网站查反链百度搜索怎么优化
  • 苏州网站建设中心口碑营销理论
  • 阿里云手机做网站网络运营课程培训班
  • 阿里巴巴官网下载安装广州seo公司推荐
  • 目录更新 wordpress福州整站优化
  • 做电子外贸网站网站页面设计模板
  • 宁波网站建设公司哪有百度seo教程视频
  • 龙口做网站价格网络营销推广公司名称