def write_as_tfrecord(train_data, test_data, vocab2id): '''convert the raw data to TFRecord format and write to disk ''' util.write_as_tfrecord(train_data, vocab2id, FLAGS.semeval_train_record, FLAGS.semeval_max_len, _build_sequence_example) util.write_as_tfrecord(test_data, vocab2id, FLAGS.semeval_test_record, FLAGS.semeval_max_len, _build_sequence_example) util._shuf_and_write(FLAGS.semeval_train_record)
def write_as_tfrecord(train_data, test_data, vocab2id): '''convert the raw data to TFRecord format and write to disk ''' train_record_file = os.path.join(OUT_DIR, 'fudan.train.tfrecord') test_record_file = os.path.join(OUT_DIR, 'fudan.test.tfrecord') util.write_as_tfrecord(train_data, vocab2id, train_record_file, MAX_LEN, _build_sequence_example) util.write_as_tfrecord(test_data, vocab2id, test_record_file, MAX_LEN, _build_sequence_example) util._shuf_and_write(train_record_file)
def write_as_tfrecord(train_data, test_data, vocab2id): '''convert the raw data to TFRecord format and write to disk ''' util.write_as_tfrecord(train_data, vocab2id, DBPEDIA_TRAIN_RECORD, _map_tokens_and_pad, _build_sequence_example) util.write_as_tfrecord(test_data, vocab2id, DBPEDIA_TEST_RECORD, _map_tokens_and_pad, _build_sequence_example) util.shuf_and_write(DBPEDIA_TRAIN_RECORD)
def write_as_tfrecord(train_data, test_data, task_id, vocab2id): '''convert the raw data to TFRecord format and write to disk ''' dataset = DATASETS[task_id] train_record_file = os.path.join(data_dir(), dataset + '.train.tfrecord') test_record_file = os.path.join(data_dir(), dataset + '.test.tfrecord') util.write_as_tfrecord(train_data, vocab2id, train_record_file, MAX_LEN, _build_sequence_example) util.write_as_tfrecord(test_data, vocab2id, test_record_file, MAX_LEN, _build_sequence_example) util._shuf_and_write(train_record_file)