Commit 1fe6455c authored by 高雅喆's avatar 高雅喆

update

parent a3446a7f
......@@ -108,6 +108,35 @@ if __name__ == '__main__':
db_zhengxing.close()
cur_zhengxing.close()
# 画像冷启动
hot_search_words = get_hot_search_words_tag()
hot_search_words_portrait = list()
for tag_info in hot_search_words:
tmp = dict()
tmp["tag_score"] = 0.2
tmp["weight"] = 10
tmp["tag2"] = tag_info["id"]
hot_search_words_portrait.append(tmp)
hot_search_words_portrait_portrait_key2 = "user:service_coldstart_tags2"
hot_search_words_portrait_dict = {i["id"]: 0.2 for i in hot_search_words}
redis_client.hmset(hot_search_words_portrait_portrait_key2, hot_search_words_portrait_dict)
hot_search_words_portrait_portrait_key2 = "user:service_coldstart_tags2_name"
hot_search_words_portrait_dict = {i["keywords"]: 0.2 for i in hot_search_words}
redis_client.hmset(hot_search_words_portrait_portrait_key2, hot_search_words_portrait_dict)
hot_search_words = ["明星娱乐", "网红扒一扒", "明星颜值打call", "颜商", "颜值高光时刻", "瘦脸针", "水光针", "光子嫩肤", "热玛吉", "瘦腿针", "超声刀",
"瘦肩针", "皮秒", "果酸焕肤",
"热拉提", "微针", "超皮秒", "点阵激光", "小气泡", "玻尿酸丰下巴", "埋线双眼皮", "纹眉", "溶脂针瘦脸", "黄金微针", "点痣", "激光祛斑",
"白瓷娃娃",
"除皱针注射", "微针祛痘坑", "玻尿酸", "胶原蛋白", "果酸", "黑脸娃娃", "童颜针", "祛斑", "祛痣", "祛黑头", "祛疤",
"祛痘", "蜂巢皮秒", "美瞳", "孕睫", "少女针", "脱毛", "面部提升", "嫩肤", "镭射净肤", "红蓝光", "清洁",
"补水", "抗衰", "美白", "冷光美白", "网红抗衰", "网红整形", "网红颜值", "网红婚恋", "明星抗衰", "明星整形", "明星婚恋", "明星颜值"]
hot_search_words_portrait_portrait_key3 = "user:service_coldstart_tags3"
hot_search_words_portrait3_dict = {i: 0.2 for i in hot_search_words}
redis_client.hmset(hot_search_words_portrait_portrait_key3, hot_search_words_portrait3_dict)
# rdd
sparkConf = SparkConf().set("spark.hive.mapred.supports.subdirectories", "true") \
.set("spark.hadoop.mapreduce.input.fileinputformat.input.dir.recursive", "true") \
......
......@@ -152,41 +152,6 @@ if __name__ == '__main__':
# 标签id对应的中文名称
all_tags_name = get_all_tags_name()
# 画像冷启动
hot_search_words = get_hot_search_words_tag()
hot_search_words_portrait = list()
for tag_info in hot_search_words:
tmp = dict()
tmp["tag_score"] = 0.2
tmp["weight"] = 10
tmp["tag2"] = tag_info["id"]
hot_search_words_portrait.append(tmp)
# gm_kv_cli = redis.Redis(host="172.16.40.135", port=5379, db=2, socket_timeout=2000)
# hot_search_words_portrait_portrait_key = "user:service_coldstart_tags"
# hot_search_words_portrait_json = json.dumps(hot_search_words_portrait)
# gm_kv_cli.set(hot_search_words_portrait_portrait_key, hot_search_words_portrait_json)
# gm_kv_cli.expire(hot_search_words_portrait_portrait_key, time=30 * 24 * 60 * 60)
# redis_client.set(hot_search_words_portrait_portrait_key, hot_search_words_portrait_json)
# redis_client.expire(hot_search_words_portrait_portrait_key, time=30 * 24 * 60 * 60)
hot_search_words_portrait_portrait_key2 = "user:service_coldstart_tags2"
hot_search_words_portrait_dict = {i["id"]: 0.2 for i in hot_search_words}
redis_client.hmset(hot_search_words_portrait_portrait_key2, hot_search_words_portrait_dict)
hot_search_words_portrait_portrait_key2 = "user:service_coldstart_tags2_name"
hot_search_words_portrait_dict = {i["keywords"]: 0.2 for i in hot_search_words}
redis_client.hmset(hot_search_words_portrait_portrait_key2, hot_search_words_portrait_dict)
hot_search_words = ["明星娱乐", "网红扒一扒", "明星颜值打call", "颜商", "颜值高光时刻", "瘦脸针", "水光针", "光子嫩肤", "热玛吉", "瘦腿针", "超声刀", "瘦肩针", "皮秒", "果酸焕肤",
"热拉提", "微针", "超皮秒", "点阵激光", "小气泡", "玻尿酸丰下巴", "埋线双眼皮", "纹眉", "溶脂针瘦脸", "黄金微针", "点痣", "激光祛斑", "白瓷娃娃",
"除皱针注射", "微针祛痘坑", "玻尿酸", "胶原蛋白", "果酸", "黑脸娃娃", "童颜针", "祛斑", "祛痣", "祛黑头", "祛疤",
"祛痘", "蜂巢皮秒", "美瞳", "孕睫", "少女针", "脱毛", "面部提升", "嫩肤", "镭射净肤", "红蓝光", "清洁",
"补水", "抗衰", "美白", "冷光美白", "网红抗衰", "网红整形", "网红颜值", "网红婚恋", "明星抗衰", "明星整形", "明星婚恋", "明星颜值"]
hot_search_words_portrait_portrait_key3 = "user:service_coldstart_tags3"
hot_search_words_portrait3_dict = {i: 0.2 for i in hot_search_words}
redis_client.hmset(hot_search_words_portrait_portrait_key3, hot_search_words_portrait3_dict)
# 搜索词tag
search_words_synonym_tags_key = "search:words:synonym:tags"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment