This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def counter(q, v, lock): | |
while True: | |
line = q.get() | |
if line is None: | |
return | |
time.sleep(0.5) | |
with lock: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_sequence_record(qid, relevances, features): | |
context_feature = {"qid": _int64_feature(qid)} | |
feature_list = dict() | |
feature_list["relevance"] = tf.train.FeatureList( | |
feature=[tf.train.Feature(float_list=tf.train.FloatList(value=[x])) for x in relevances] | |
) | |
feature_list["feature"] = tf.train.FeatureList( | |
feature=[tf.train.Feature(float_list=tf.train.FloatList(value=feature)) for feature in features] | |
) |