Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
1fe6455c
Commit
1fe6455c
authored
Nov 05, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a3446a7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
35 deletions
+29
-35
dist_update_user_history_order_tags.py
eda/smart_rank/dist_update_user_history_order_tags.py
+29
-0
dist_update_user_portrait_service.py
eda/smart_rank/dist_update_user_portrait_service.py
+0
-35
No files found.
eda/smart_rank/dist_update_user_history_order_tags.py
View file @
1fe6455c
...
@@ -108,6 +108,35 @@ if __name__ == '__main__':
...
@@ -108,6 +108,35 @@ if __name__ == '__main__':
db_zhengxing
.
close
()
db_zhengxing
.
close
()
cur_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
# rdd
sparkConf
=
SparkConf
()
.
set
(
"spark.hive.mapred.supports.subdirectories"
,
"true"
)
\
sparkConf
=
SparkConf
()
.
set
(
"spark.hive.mapred.supports.subdirectories"
,
"true"
)
\
.
set
(
"spark.hadoop.mapreduce.input.fileinputformat.input.dir.recursive"
,
"true"
)
\
.
set
(
"spark.hadoop.mapreduce.input.fileinputformat.input.dir.recursive"
,
"true"
)
\
...
...
eda/smart_rank/dist_update_user_portrait_service.py
View file @
1fe6455c
...
@@ -152,41 +152,6 @@ if __name__ == '__main__':
...
@@ -152,41 +152,6 @@ if __name__ == '__main__':
# 标签id对应的中文名称
# 标签id对应的中文名称
all_tags_name
=
get_all_tags_name
()
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
# 搜索词tag
search_words_synonym_tags_key
=
"search:words:synonym:tags"
search_words_synonym_tags_key
=
"search:words:synonym:tags"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment