plm-nlp-code
plm-nlp-code copied to clipboard
文件`finetune_bert_mrc.py`加载数据时,会报如下错误 `ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.10.2/datasets/squad/squad.py` 原因是国内无法连接
4.2.2 一行代码 outputs_pool2 = pool1(outputs2) , pool1 改为pool2 也许git clone 的代码是对的 , 只是印刷错误 我没有核实 4.5.1 公式没有完全体现 伯努利 “更本质地讲,交叉熵损失函数公式右侧是对多类输出结果的分布(伯努利分布)求极大似然中的对数似然函数(Log-Likelihood)。”  在y_(i)j = 0 的时候 应该是 - (1- y_(i)j ) log (1...
调用函数 一直报错 查看了opencc github后发现 https://github.com/BYVoid/OpenCC 首页的众多示例代码在没有xxx.json 文件的情况下直接可以跑通 , 文件夹内有json反而出错 请务必删除文件夹内的json配置文件
安装问题比较多 (https://dumps.wikimedia.org/zhwiki/latest/ 语料库) 1) 如果遇到err 就像下面 ’”aise source.error('global flags not at the start ' re.error: global flags not at the start of the expression at position 4 “ 请务必将python 退到py3.10...
from ltp import StnSplit from ltp import LTP ltp = LTP() sents2 = StnSplit().batch_split(["南京市长江大桥。", "汤姆生病了。他去了医院。"]) sents2 ['南京市长江大桥。', '汤姆生病了。', '他去了医院。'] segment = ltp.pipeline(sents2,tasks=['cws'], return_dict=False) segment ([['南京市', '长江', '大桥', '。'], ['汤姆', '生病',...
load_dict 函数 不是 fopen(XXX,'rb') 这样只能分的一个个汉字 应该是 fopen(XXX, 'r' , encoding='UTF-8') 
第七章中四个bert代码都有from datasets import load_dataset, load_metric这句导包,想请问老师,是编者自己写的datasets,还是直接自己pip install datasets?
``` from lip import LTP ltp = LTP() # segment, hidden = ltp.seg(['南京市长江大桥。']) 报错 # 修改为 segment = ltp.pipeline(['南京市长江大桥。'], tasks=['cws'], return_dict=False) print(segment) ```
根据书上的章节内容,第五章的ffnnlm.py的第一行注释应该改为# Defined in Section 5.1.3.2