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
52d1ba5c
Commit
52d1ba5c
authored
Nov 17, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test api
parent
4361ceba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
api.py
personas_vector/api.py
+6
-2
No files found.
personas_vector/api.py
View file @
52d1ba5c
...
...
@@ -4,7 +4,6 @@ import traceback
import
faiss
import
numpy
as
np
import
pandas
as
pd
from
gm_rpcd.all
import
bind
from
utils.cache
import
redis_client_db
from
utils.message
import
send_msg_to_dingtalk
...
...
@@ -17,11 +16,16 @@ FAISS_TAGS_INDEX = faiss.read_index(INDEX_PATH)
TAG_EMBEDDING_DICT
=
redis_client_db
.
hgetall
(
"personas_tags_embedding"
)
@bind
(
"strategy_embedding/personas_vector/hello"
)
def
hello
():
return
[
"hello"
,
"world"
]
@bind
(
"strategy_embedding/personas_vector/match"
)
def
match_tractate_by_device
(
device_id
,
n
=
10
):
try
:
business_tags
=
get_user_portrait_tag3_from_redis
(
device_id
,
tags_num
=
5
)
.
get
(
"business_tags"
,
[])
business_tags
=
[
"假体下巴"
,
"你好"
,
"假体隆胸"
]
#
business_tags = ["假体下巴", "你好", "假体隆胸"]
res
=
[]
vectors
=
[]
for
tag
in
business_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