d97188ee62bc0627235578485c5df7d3245fa1ed,example6.py,,,#,14

Before Change


tf.logging.set_verbosity(tf.logging.INFO)

train_fp = ["/data/cips/data/lab/data/dataset/final_all_data/exercise_contest/data_train.json"]
eval_fp = ["/data/cips/data/lab/data/dataset/final_all_data/exercise_contest/data_test.json"]
batch_size = 64
num_parallel_calls = 4
num_concurrent_clients = num_parallel_calls * 2  // should be at least greater than `num_parallel_calls`

After Change



// 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):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

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: pantsbuild/pants
Commit Name: fcbcb3c73892ee31df710fcd6b48d06a3efdc143
Time: 2020-04-06
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/engine/target_test.py
Class Name:
Method Name: test_string_sequence_field


Project Name: pantsbuild/pants
Commit Name: fcbcb3c73892ee31df710fcd6b48d06a3efdc143
Time: 2020-04-06
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/engine/target_test.py
Class Name:
Method Name: test_string_or_string_sequence_field