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
68af57e1
Commit
68af57e1
authored
Dec 22, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get online ids
parent
e6a57b8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
es.py
utils/es.py
+1
-1
answer.py
word_vector/answer.py
+4
-4
No files found.
utils/es.py
View file @
68af57e1
...
...
@@ -156,7 +156,7 @@ def get_diary_info_from_es(fields=["id"]):
return
results
def
get_o
ff
line_ids
(
content_type
):
def
get_o
n
line_ids
(
content_type
):
q
=
{
"query"
:
{
"bool"
:
{
"must"
:
[{
"term"
:
{
"is_online"
:
False
}}]}}}
results
=
es_scan
(
content_type
,
q
)
return
results
word_vector/answer.py
View file @
68af57e1
...
...
@@ -8,7 +8,7 @@ sys.path.append(os.path.realpath("."))
from
gensim.models
import
Word2Vec
,
word2vec
from
utils.date
import
get_ndays_before_no_minus
,
get_ndays_before_with_format
from
utils.es
import
get_o
ff
line_ids
from
utils.es
import
get_o
n
line_ids
from
utils.files
import
DATA_PATH
,
MODEL_PATH
from
utils.spark
import
get_spark
...
...
@@ -124,10 +124,10 @@ def get_answer_click_data(spark, start, end):
return
df
def
get_o
ff
line_answer_ids
():
def
get_o
n
line_answer_ids
():
count
=
0
res_set
=
set
([])
for
item
in
get_o
ff
line_ids
(
"answer"
):
for
item
in
get_o
n
line_ids
(
"answer"
):
count
+=
1
try
:
print
(
count
)
...
...
@@ -170,7 +170,7 @@ def save_clicked_answer_ids_item2vec():
if
__name__
==
"__main__"
:
begin_time
=
time
.
time
()
res_set
=
get_o
ff
line_answer_ids
()
res_set
=
get_o
n
line_answer_ids
()
print
(
len
(
res_set
))
# spark = get_spark("answer_click_ids")
...
...
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