10 2021 档案

摘要:SquadExample为预处理语音数据的类。 example = SquadExample( qas_id=qas_id, question_text=question_text, context_text=context_text, answer_text=answer_text, start_ 阅读全文
posted @ 2021-10-23 16:12 为红颜 阅读(97) 评论(0) 推荐(0)
摘要:模板类的声明,一般将声明和定义放在一个文件内,后缀为.hpp。 或者,在main函数中,将所包含的头文件后缀.h改为.cpp。 #pragma once #include<iostream> using namespace std; template<class T> class MyArray { 阅读全文
posted @ 2021-10-18 16:06 为红颜 阅读(71) 评论(0) 推荐(0)
摘要:最近在看QA,对dataset不是很了解,所以看了一下pytorch中的squad_convert_example_to_features。 1.squad_convert_example_to_features 以下为pytorch源代码: 其中example数据大致呈现(不完整): def sq 阅读全文
posted @ 2021-10-15 10:50 为红颜 阅读(732) 评论(0) 推荐(0)
摘要:1.encode和encode_plus的区别 区别1. encode仅返回input_ids2. encode_plus返回所有的编码信息,具体如下:’input_ids:是单词在词典中的编码‘token_type_ids’:区分两个句子的编码(上句全为0,下句全为1)‘attention_mas 阅读全文
posted @ 2021-10-14 21:59 为红颜 阅读(6625) 评论(0) 推荐(0)
摘要:遇到报错 经调试,发现错误: filename: 查找stackOverflow:https://stackoverflow.com/questions/67377972/filenotfounderror-could-not-find-module-when-using-jupyter-noteb 阅读全文
posted @ 2021-10-13 23:38 为红颜 阅读(3459) 评论(0) 推荐(0)
摘要:1.BertConfig 类 BertConfigBertForQuestionAnswering BERT 模型的配置类,BERT 的超参配置都在这里。其参数(蓝色)和方法(黄色)总览如下: 参数vocab_size:词汇表大小。hidden_size=768:encoder 层和 pooler 阅读全文
posted @ 2021-10-06 10:23 为红颜 阅读(2002) 评论(0) 推荐(0)