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
341be451
Commit
341be451
authored
Nov 26, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add timer
parent
232519b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
match_api.py
personas_vector/match_api.py
+3
-0
No files found.
personas_vector/match_api.py
View file @
341be451
...
...
@@ -22,7 +22,9 @@ def match_tractate_by_device(device_id, n=10):
try
:
if
device_id
not
in
[
"0"
,
"unknown"
,
"87654"
,
""
]:
time_begin
=
time
.
time
()
portrait_time_begin
=
time
.
time
()
business_tags
=
get_user_portrait_tag3_business_tags
(
device_id
,
tags_num
=
3
)
portrait_time_end
=
time
.
time
()
-
portrait_time_begin
res
=
[]
if
business_tags
:
vectors
=
[]
...
...
@@ -48,6 +50,7 @@ def match_tractate_by_device(device_id, n=10):
"api"
:
"strategy_embedding/personas_vector/match"
,
"device_id"
:
device_id
,
"n"
:
n
,
"get_business_tags"
:
"{:.3f}ms"
.
format
(
portrait_time_end
*
1000
),
"search"
:
"{:.3f}ms"
.
format
(
search_time_end
*
1000
),
"total_time"
:
"{:.3f}ms"
.
format
(
time_end
*
1000
)
}
...
...
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