美文网首页
常用操作2

常用操作2

作者: Songger | 来源:发表于2019-08-21 11:15 被阅读0次
  1. dssm常用表

create table hs_dssm_dic_query_7 as
select distinct query_id, query from hs_tmp_247;

create table hs_dssm_dic_title_11 as
select distinct item_id, title from hs_tmp_247;

create table graph_embedding.hs_dssm_dic_title_12 as
select graph_embedding:hs_split_1(item_id, pair, "|") as (item_id, word, weight) from
(select bi_udf:bi_split_value(item_id, tag_result, "%") as (item_id, pair) from
(select item_id, search_kg:alinlp_termweight_ecom(title, "%", "{word}|{weight}", 1, 0) as tag_result from graph_embedding.hs_dssm_dic_title_11 where lengthb(title) > 0)a)b where lengthb(b.pair) > 0;

create table graph_embedding.hs_dssm_dic_query_8 as
select graph_embedding:hs_split_1(query_id, pair, "|") as (query_id, word, weight) from
(select bi_udf:bi_split_value(query_id, tag_result, "%") as (query_id, pair) from
(select query_id, search_kg:alinlp_termweight_ecom(query, "%", "{word}|{weight}", 1, 0) as tag_result from graph_embedding.hs_dssm_dic_query_7 where lengthb(query) > 0)a)b where lengthb(b.pair) > 0;

create table hs_dssm_dic_query_9 as select query_id as id, word, search_kg:alinlp_word_embedding(hs_return_clean(word), "100", "CONTENT_SEARCH") as emb from hs_dssm_dic_query_8;

create table hs_dssm_dic_query_10 as
select b.id, a.word, b.emb, a.weight, graph_embedding:change_weight_query_key_1(a.word, a.weight) as new_weight from hs_dssm_dic_query_8 a join hs_dssm_dic_query_9 b on a.query_id == b.id and a.word == b.word;

create table hs_dssm_dic_query_11 as
select id, return_concat_1(new_weight, emb) as query_emb from hs_dssm_dic_query_10 group by id;

create table hs_dssm_dic_title_13 as select item_id as id, word, search_kg:alinlp_word_embedding(hs_return_clean(word), "100", "CONTENT_SEARCH") as emb from hs_dssm_dic_title_12;

create table hs_dssm_dic_title_14 as
select b.id, a.word, b.emb, a.weight, graph_embedding:change_weight_query_key_1(a.word, a.weight) as new_weight from hs_dssm_dic_title_12 a join hs_dssm_dic_title_13 b on a.item_id == b.id and a.word == b.word;

create table hs_dssm_dic_title_15 as
select id, return_concat_1(new_weight, emb) as title_emb from hs_dssm_dic_title_14 group by id;

  1. 构造ground truth表

create table hs_query_title_inference_gt_3 as
select distinct c., d.item_id as title_id from
(select a.
, b.query_id as query_id from (select * from hs_query_title_inference_gt)a join (select * from hs_dssm_dic_query_7)b on a.query == b.query)c join (select * from hs_dssm_dic_title_inf_10)d on c.title == d.title;

insert overwrite table hs_query_title_inference_gt_3 select distinct * from hs_query_title_inference_gt_3 where label == 1 or label == 0;

create table hs_tmp_267 as
select distinct c.query_id, c.query_ws, c.title_id as video_id, d.title_emb as video_ws from
(select a.*, b.query_emb as query_ws from hs_query_title_inference_gt_3 a join hs_dssm_dic_query_inf_11 b on a.query_id == b.id)c join hs_dssm_dic_title_inf_14 d on c.title_id == d.id;

相关文章

  • 常用操作(2)

    windows+R调出运行,在窗口输入regedit, windows+R调出运行, Jupyter的部分快捷键:...

  • 常用操作2

    dssm常用表 create table hs_dssm_dic_query_7 asselect distinc...

  • linux and python and git

    Linux 操作系统目录结构的简介image.png2.Linux常用操作linux常用操作.jpg3.Pytho...

  • pyspark dataframe常用操作

    pySpark DataFrames常用操作指南 前1, 2步是环境数据集操作,如果只想看常用操作请跳到3 1. ...

  • PostgreSQL常用命令

    0 连接数据库 1 数据库查询常用命令 2 数据创建删改查操作 3 数据表常用操作 4 数据备份恢复常用操作

  • iOS主要知识总结--多线程之操作队列

    操作队列(NSOperation) 操作队列的几种常用方法 1. NSInvocationOperation 2....

  • RxJava2 中常用操作符和Subject常用子类说明

    RxJava2 中常用操作符和Subject常用子类代码练习及说明。ReactiveX 系列所有操作符以及RxJa...

  • 3RDD创建

    1键值对rdd的创建 2常用的RDD键值对转换操作 常用的键值对转换操作有reduceByKey(func),gr...

  • 2、Axure元件简介与操作

    目录: 1、Axure常用元件介绍 2、Axure元件常用操作介绍 一、Axure常用元件介绍 内联框架:可以连接...

  • RAC进阶

    RAC中关于信号的常用操作本节整理了以下几种常用信号操作:1.信号映射:map与flattenMap2.信号过滤:...

网友评论

      本文标题:常用操作2

      本文链接:https://www.haomeiwen.com/subject/etkbsctx.html