摘要: 翻译自 :https://www.modeldifferently.com/en/2021/12/generaci%C3%B3n-de-fake-news-con-gpt-2/ (注:未去联系取得翻译授权,纯学习自用) 在这篇文章中,我们将看到如何使用基于Transformers架构的模型生成文本, 阅读全文
posted @ 2023-03-14 10:42 地球美好不 阅读(1406) 评论(0) 推荐(0) 编辑
摘要: 用pandas读一个txt文件, data = pd.read_table(os.path.join(project_path, 'src/data/corpus.txt'), sep='\n') 出现如下错误: 'utf-8' codec can't decode bytes in positio 阅读全文
posted @ 2023-03-13 14:08 地球美好不 阅读(925) 评论(0) 推荐(0) 编辑
摘要: fit_transform和transform这两个函数是类sklearn.preprocessing.StandardScaler()的方法,用来标准化训练和测试数据,意思就是StandardScaler类会对数据的每一个特征做单独的centering和scaling。 具体操作 对于训练数据,用 阅读全文
posted @ 2023-03-11 15:29 地球美好不 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 2023-3-10 update: 我在huggingface的模型介绍里面看到一句话 Note that the only difference between autoregressive models and autoencoding models is in the way the mode 阅读全文
posted @ 2023-03-10 11:22 地球美好不 阅读(930) 评论(0) 推荐(0) 编辑
摘要: 有一个分布式假设distributional hypothesis: Linguistic items with similar distributions have similar meanings。 如果两个词的上下文相似,那么这两个词的语义就相似。 所有用这种假设学习到的向量都叫做distri 阅读全文
posted @ 2023-03-09 16:25 地球美好不 阅读(108) 评论(0) 推荐(0) 编辑
摘要: | 模型 | 发布方 |参数 |语料| 特点| | | | | | | |BERT-base | 谷歌|12层,768层隐层,12个头,110M参数| 16GB BERT Data(Books Corpus + Wikipedia), 3.3m words|多语言| | BERT-base-chin 阅读全文
posted @ 2023-03-07 15:53 地球美好不 阅读(27) 评论(0) 推荐(0) 编辑
摘要: Whole Word Masking 翻译成全词Mask,是一种预训练阶段的训练样本生成策略。最原始的分词方式是基于WordPiece子词,它会把完整的一个词切分成若干个子词,在生成训练样本时,这些被分开的子词会随机被Mask。在全词Mask中,如果一个完整的词的部分WordPiece子词被mask 阅读全文
posted @ 2023-03-07 11:14 地球美好不 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 首先搞清楚预训练模型一般会有的文件: vocab.txt config.json pytorch_model.bin 这三个分别对应tokenizer,config和model。 添加huggingface hub里面的模型 只要有模型名就可以导入tokenizer和model 无需导入config 阅读全文
posted @ 2023-03-06 19:39 地球美好不 阅读(525) 评论(0) 推荐(0) 编辑
摘要: A model checkpoint is a saved copy of the trained weights and biases of a neural network model at a specific point in time during the training process 阅读全文
posted @ 2023-03-01 14:40 地球美好不 阅读(30) 评论(0) 推荐(0) 编辑