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
6c34d57d
Commit
6c34d57d
authored
Aug 20, 2021
by
郭羽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update redis conn
parent
dffe2965
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
9 deletions
+9
-9
dist_update_user_history_order_tags.py
eda/smart_rank/dist_update_user_history_order_tags.py
+2
-2
dist_update_user_portrait_service.py
eda/smart_rank/dist_update_user_portrait_service.py
+2
-2
gm_feed_cold_start.py
eda/smart_rank/gm_feed_cold_start.py
+1
-1
gm_tag_cf.py
eda/smart_rank/gm_tag_cf.py
+1
-1
new_tag3_cold_start.py
eda/smart_rank/new_tag3_cold_start.py
+1
-1
tag3_portrait_to_es.py
eda/smart_rank/tag3_portrait_to_es.py
+1
-1
tool.py
eda/smart_rank/tool.py
+1
-1
No files found.
eda/smart_rank/dist_update_user_history_order_tags.py
View file @
6c34d57d
...
@@ -58,7 +58,7 @@ def get_user_history_order_service_tag(user_id):
...
@@ -58,7 +58,7 @@ def get_user_history_order_service_tag(user_id):
# 写redis
# 写redis
user_history_order_tags_key
=
"user:history_order:tags:user_id:"
+
str
(
user_id
)
user_history_order_tags_key
=
"user:history_order:tags:user_id:"
+
str
(
user_id
)
tags_list_json
=
json
.
dumps
(
tags_list
)
tags_list_json
=
json
.
dumps
(
tags_list
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379'
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379'
)
redis_client
.
set
(
user_history_order_tags_key
,
tags_list_json
)
redis_client
.
set
(
user_history_order_tags_key
,
tags_list_json
)
redis_client
.
expire
(
user_history_order_tags_key
,
time
=
30
*
24
*
60
*
60
)
redis_client
.
expire
(
user_history_order_tags_key
,
time
=
30
*
24
*
60
*
60
)
return
user_id
return
user_id
...
@@ -79,7 +79,7 @@ if __name__ == '__main__':
...
@@ -79,7 +79,7 @@ if __name__ == '__main__':
cur_zhengxing
.
close
()
cur_zhengxing
.
close
()
# 画像冷启动
# 画像冷启动
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379'
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379'
)
hot_search_words
=
get_hot_search_words_tag
()
hot_search_words
=
get_hot_search_words_tag
()
hot_search_words_portrait
=
list
()
hot_search_words_portrait
=
list
()
for
tag_info
in
hot_search_words
:
for
tag_info
in
hot_search_words
:
...
...
eda/smart_rank/dist_update_user_portrait_service.py
View file @
6c34d57d
...
@@ -60,7 +60,7 @@ def get_user_service_portrait(cl_id, all_word_tags, all_tag_tag_type, all_3tag_2
...
@@ -60,7 +60,7 @@ def get_user_service_portrait(cl_id, all_word_tags, all_tag_tag_type, all_3tag_2
gmkv_tag_score2_sum_dict
=
{
i
[
"tag2"
]:
i
[
"tag_score"
]
for
i
in
gmkv_tag_score2_sum
}
gmkv_tag_score2_sum_dict
=
{
i
[
"tag2"
]:
i
[
"tag_score"
]
for
i
in
gmkv_tag_score2_sum
}
# 写redis
# 写redis
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379'
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379'
)
cl_id_portrait_key2
=
"user:service_portrait_tags2:cl_id:"
+
str
(
cl_id
)
cl_id_portrait_key2
=
"user:service_portrait_tags2:cl_id:"
+
str
(
cl_id
)
# 如果画像的tag个数小于5,则补充热搜词
# 如果画像的tag个数小于5,则补充热搜词
if
len
(
gmkv_tag_score2_sum_dict
)
<
5
:
if
len
(
gmkv_tag_score2_sum_dict
)
<
5
:
...
@@ -129,7 +129,7 @@ if __name__ == '__main__':
...
@@ -129,7 +129,7 @@ if __name__ == '__main__':
db_jerry_test
.
close
()
db_jerry_test
.
close
()
cur_jerry_test
.
close
()
cur_jerry_test
.
close
()
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379'
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379'
)
# 获取搜索词及其近义词对应的tag
# 获取搜索词及其近义词对应的tag
all_word_tags
=
get_all_word_tags
()
all_word_tags
=
get_all_word_tags
()
...
...
eda/smart_rank/gm_feed_cold_start.py
View file @
6c34d57d
...
@@ -163,7 +163,7 @@ if __name__ == "__main__":
...
@@ -163,7 +163,7 @@ if __name__ == "__main__":
all_city_tag_id
=
get_all_city_id
()
all_city_tag_id
=
get_all_city_id
()
# 清空历史数据
# 清空历史数据
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379'
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379'
)
# hot_search_word_topic_queue_key = "coldstart:hot:search:word:topic:queue"
# hot_search_word_topic_queue_key = "coldstart:hot:search:word:topic:queue"
# hot_search_word_qa_queue_key = "coldstart:hot:search:word:qa:queue"
# hot_search_word_qa_queue_key = "coldstart:hot:search:word:qa:queue"
# hot_search_word_diary_queue_key = "coldstart:hot:search:word:diary:queue"
# hot_search_word_diary_queue_key = "coldstart:hot:search:word:diary:queue"
...
...
eda/smart_rank/gm_tag_cf.py
View file @
6c34d57d
...
@@ -75,7 +75,7 @@ if __name__ == '__main__':
...
@@ -75,7 +75,7 @@ if __name__ == '__main__':
tag_cf_tags_names
.
remove
(
tag_synonym_name
)
tag_cf_tags_names
.
remove
(
tag_synonym_name
)
all_tags_cf_tags
[
tag_name
]
=
json
.
dumps
(
tag_cf_tags_names
[:
10
])
all_tags_cf_tags
[
tag_name
]
=
json
.
dumps
(
tag_cf_tags_names
[:
10
])
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379'
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379'
)
gm_tag_cf_tags_key
=
"gm:tag:cf:tags"
gm_tag_cf_tags_key
=
"gm:tag:cf:tags"
redis_client
.
hmset
(
gm_tag_cf_tags_key
,
all_tags_cf_tags
)
redis_client
.
hmset
(
gm_tag_cf_tags_key
,
all_tags_cf_tags
)
print
(
"update cf tags count {}"
.
format
(
len
(
all_tags_cf_tags
)))
print
(
"update cf tags count {}"
.
format
(
len
(
all_tags_cf_tags
)))
...
...
eda/smart_rank/new_tag3_cold_start.py
View file @
6c34d57d
...
@@ -295,7 +295,7 @@ if __name__ == "__main__":
...
@@ -295,7 +295,7 @@ if __name__ == "__main__":
# print("tractate: " + str(get_es_tractate(keywords)[:10]) + "\n")
# print("tractate: " + str(get_es_tractate(keywords)[:10]) + "\n")
# print("answer: " + str(get_es_answer(keywords)[:10]) + "\n")
# print("answer: " + str(get_es_answer(keywords)[:10]) + "\n")
redis_client
=
redis
.
StrictRedis
.
from_url
(
"redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379"
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
"redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379"
)
"""
"""
tractate_list = get_es_tractate(keywords)
tractate_list = get_es_tractate(keywords)
...
...
eda/smart_rank/tag3_portrait_to_es.py
View file @
6c34d57d
...
@@ -7,7 +7,7 @@ from es_tool import es_insert_device_info
...
@@ -7,7 +7,7 @@ from es_tool import es_insert_device_info
from
tool
import
(
get_user_portrait_tag3_from_redis
,
get_user_portrait_tag3_with_score
)
from
tool
import
(
get_user_portrait_tag3_from_redis
,
get_user_portrait_tag3_with_score
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
"redis://:ReDis!GmTx*0aN6@172.16.40.133:6379"
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
"redis://:ReDis!GmTx*0aN6@172.16.40.133:6379"
)
redis_client2
=
redis
.
StrictRedis
.
from_url
(
"redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379"
)
redis_client2
=
redis
.
StrictRedis
.
from_url
(
"redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379"
)
redis_client3
=
redis
.
StrictRedis
.
from_url
(
"redis://:ReDis!GmTx*0aN12@172.16.40.164:6379"
)
redis_client3
=
redis
.
StrictRedis
.
from_url
(
"redis://:ReDis!GmTx*0aN12@172.16.40.164:6379"
)
redis_client4
=
redis
.
StrictRedis
.
from_url
(
"redis://:XfkMCCdWDIU
%
ls$h@172.16.50.145:6379"
)
redis_client4
=
redis
.
StrictRedis
.
from_url
(
"redis://:XfkMCCdWDIU
%
ls$h@172.16.50.145:6379"
)
...
...
eda/smart_rank/tool.py
View file @
6c34d57d
...
@@ -604,7 +604,7 @@ def write_user_portrait_by_event(cl_id, first_solutions, second_solutions, first
...
@@ -604,7 +604,7 @@ def write_user_portrait_by_event(cl_id, first_solutions, second_solutions, first
def
get_redis_client
():
def
get_redis_client
():
return
redis
.
StrictRedis
.
from_url
(
"redis://:
ReDis!GmTx*0aN9@172.16.40.173
:6379"
)
return
redis
.
StrictRedis
.
from_url
(
"redis://:
XfkMCCdWDIU
%
ls$h@172.16.50.145
:6379"
)
def
get_user_portrait_tag3_from_redis
(
device_id
,
limit_score
=
0
):
def
get_user_portrait_tag3_from_redis
(
device_id
,
limit_score
=
0
):
...
...
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