d97188ee62bc0627235578485c5df7d3245fa1ed,example6.py,,,#,14
Before Change
316, 245, 232, 175, 149, 263, 387, 283, 391, 211, 396, 352, 345, 258, 253, 163, 140, 293, 194, 342, 161, 358,
271, 156, 260, 384, 153, 277, 214]
laws_str = [str(x) for x in laws]
def get_encodes(x):
After Change
tf.logging.set_verbosity(tf.logging.INFO)
with open("README.md") as fp:
data = [v for v in fp if v.strip()]
bc = BertClient()
list_vec = bc.encode(data)
list_label = [0 for _ in data] // a dummy list of all-zero labels
// write tfrecords
with tf.python_io.TFRecordWriter("tmp.tfrecord") as writer:
def create_float_feature(values):
return tf.train.Feature(float_list=tf.train.FloatList(value=values))
def create_int_feature(values):
return tf.train.Feature(int64_list=tf.train.Int64List(value=list(values)))
for (vec, label) in zip(list_vec, list_label):
features = {"features": create_float_feature(vec), "labels": create_int_feature([label])}
tf_example = tf.train.Example(features=tf.train.Features(feature=features))
writer.write(tf_example.SerializeToString())
// read tfrecords and build dataset from it
num_hidden_unit = 768
def _decode_record(record):
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 5
Instances
Project Name: hanxiao/bert-as-service
Commit Name: d97188ee62bc0627235578485c5df7d3245fa1ed
Time: 2018-12-02
Author: hanhxiao@tencent.com
File Name: example6.py
Class Name:
Method Name:
Project Name: DexterInd/GoPiGo3
Commit Name: f8d97b8a228504adc12a2286c62f0fd7827a3a3c
Time: 2017-07-20
Author: robert.lucian.chiriac@gmail.com
File Name: Projects/BasicRobotControl/runnable.py
Class Name:
Method Name: Main
Project Name: pantsbuild/pants
Commit Name: 7205bc1806bbc085c01e40fa04fce68dcff0ae71
Time: 2018-10-10
Author: 1305167+cosmicexplorer@users.noreply.github.com
File Name: tests/python/pants_test/base/test_exception_sink.py
Class Name: TestExceptionSink
Method Name: test_log_exception
Project Name: pandas-dev/pandas
Commit Name: 0435d914d8cf8be2147af722e39310487f03ce8c
Time: 2020-10-10
Author: 41443370+ivanovmg@users.noreply.github.com
File Name: pandas/tests/plotting/test_frame.py
Class Name: TestDataFramePlots
Method Name: test_mpl2_color_cycle_str
Project Name: DexterInd/GoPiGo3
Commit Name: 1fb289b0de21ec00d28046eff88d6da8f4c15319
Time: 2017-07-21
Author: robert.lucian.chiriac@gmail.com
File Name: Projects/BasicRobotControl/runnable.py
Class Name:
Method Name: Main