Skip to content

Instantly share code, notes, and snippets.

View eugene87222's full-sized avatar
🧊
Genshin GOOD

Eugene Yang eugene87222

🧊
Genshin GOOD
View GitHub Profile
# -*- coding: utf-8 -*-
import sys
import tensorflow as tf
from pathlib import Path
from tensorflow.compat.v1 import Event
def rename_events(input_path, output_path, old_tags, new_tag):
with tf.io.TFRecordWriter(str(output_path)) as writer:
for rec in tf.data.TFRecordDataset([str(input_path)]):
@eugene87222
eugene87222 / CC.ipynb
Last active May 7, 2020 12:51
20200507 ccca 爬蟲社課 Python demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eugene87222
eugene87222 / gen_corpus.py
Created February 23, 2020 15:00
Kaldi data preparation
import os
if __name__ == '__main__':
mode = ['test', 'train']
if not os.path.exists('./data/local'):
os.mkdir('./data/local')
with open('./data/local/corpus.txt', 'w') as file:
for m in mode:
text_path = f'./data/{m}/text'
with open(text_path, 'r') as text_file: