Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_mab
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
gm_mab
Commits
2373bcec
Commit
2373bcec
authored
Apr 20, 2020
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试
parent
bb5957b6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
generate_content_user_feature.py
tools/generate_content_user_feature.py
+4
-1
No files found.
tools/generate_content_user_feature.py
View file @
2373bcec
...
...
@@ -155,7 +155,10 @@ class Generate_Feature_Info(object):
if
len
(
user_portrait_dict
)
>
0
:
sorted_user_portrait_list
=
sorted
(
user_portrait_dict
[
"projects"
]
.
items
(),
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)
user_max_score_tag
=
sorted_user_portrait_list
[
0
][
0
]
.
encode
(
"utf-8"
)
try
:
user_tag_label
=
label_encoder
.
transform
([
user_max_score_tag
])[
0
]
except
:
pass
user_feature_list
=
[
user_tag_label
]
redis_client
.
hset
(
redis_name_user_linucb_feature
,
device_id
,
json
.
dumps
(
user_feature_list
))
...
...
@@ -217,7 +220,7 @@ if __name__ == "__main__":
Generate_Feature_Info
.
generate_user_feature_to_redis
(
device_id
,
label_encoder
)
user_feature_list
=
Generate_Feature_Info
.
get_user_feature_by_device_id
(
device_id
)
content_feature_list
=
Generate_Feature_Info
.
get_content_feature
(
diary_
f
d
)
content_feature_list
=
Generate_Feature_Info
.
get_content_feature
(
diary_
i
d
)
print
(
user_feature_list
+
content_feature_list
)
...
...
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