Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
strategy_embedding
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
strategy_embedding
Commits
a5098c13
Commit
a5098c13
authored
Dec 22, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add printer
parent
6e43d520
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
answer.py
word_vector/answer.py
+3
-1
No files found.
word_vector/answer.py
View file @
a5098c13
...
...
@@ -35,7 +35,7 @@ def get_answer_click_data(spark, start, end):
where action = 'page_view'
AND partition_date BETWEEN '{}' AND '{}'
AND page_name='answer_detail'
AND page_stay>=
0.5
AND page_stay>=
1
AND cl_id is not null
AND cl_id != ''
AND business_id is not null
...
...
@@ -145,11 +145,13 @@ def get_online_answer_ids():
def
get_device_click_answer_ids_dict
(
click_df
):
online_ids
=
get_online_answer_ids
()
print
(
"online ids: {}"
.
format
(
len
(
online_ids
)))
res
=
defaultdict
(
list
)
cols
=
click_df
.
orderBy
(
"partition_date"
,
ascending
=
False
)
.
collect
()
for
i
in
cols
:
card_id
=
i
[
"card_id"
]
session_id
=
i
[
"app_session_id"
]
print
(
"card_id: {} {}"
.
format
(
int
(
card_id
),
int
(
card_id
)
in
online_ids
)))
if
(
card_id
not
in
res
[
session_id
])
and
int
(
card_id
)
in
online_ids
:
res
[
session_id
]
.
append
(
card_id
)
return
res
...
...
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