BERT
乐清sss
立志成为大师的萌妹子!
展开
-
BERT模型返回值
bert的输出是tuple类型的,包括4个:Return: :obj:`tuple(torch.FloatTensor)` comprising various elements depending on the configuration (:class:`~transformers.BertConfig`) and inputs: last_hidden_st...原创 2020-03-28 11:43:21 · 16877 阅读 · 12 评论 -
BertForQuestionAnswering的使用中遇到的一些函数
1. logging的用法配置:import logginglogging.basicConfig(format = '%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt = '%m/%d/%Y %H:%M:%S', level = l...原创 2019-12-25 16:05:37 · 4139 阅读 · 0 评论 -
使用pytorch_pretrained_bert将tensorflow模型转化为pytorch模型
BERT仓库里的模型是TensorFlow版本的,需要进行相应的转换才能在pytorch中使用在Google BERT仓库里下载需要的模型,这里使用的是中文预训练模型(chinese_L-12_H-768_A_12)下载chinese_L-12_H-768_A-12.zip后解压,里面有5个文件bert_config.jsonbert_model.ckpt.data-00000-of-0...原创 2019-12-09 15:28:48 · 5985 阅读 · 7 评论