当前位置:   article > 正文

[语音识别] 文本加标点--训练BLSTM_java语音识别加标点符号

java语音识别加标点符号

文本加标点--训练BLSTM

bert4keras==0.5.9

  1. # -*- coding:utf-8 -*-
  2. import os
  3. import re
  4. import sys
  5. import time
  6. import jieba
  7. import gensim
  8. import logging
  9. import numpy as np
  10. import pandas as pd
  11. from tqdm import tqdm
  12. import multiprocessing
  13. from bert4keras.snippets import sequence_padding, DataGenerator
  14. from bert4keras.optimizers import Adam
  15. import warnings
  16. warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim')# 忽略警告
  17. np.random.seed(2019)
  18. import keras
  19. from keras.models import *
  20. from keras.layers import *
  21. from keras.optimizers import *
  22. from keras.regularizers import l2
  23. from keras.callbacks import *
  24. from keras.optimizers import *
  25. from keras.callbacks import *
  26. from keras import backend as K
  27. # 超参数
  28. batch_size = 32
  29. learning_rate = 0.001
  30. epochs = 50
  31. def load_data(filename1, filename2):
  32. xlist = np.load('./wikiw2v.npy')
  33. ylist = np.load('./wikipunc.npy
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/366533
推荐阅读
相关标签
  

闽ICP备14008679号