NLP
lzh_zyy
这个作者很懒,什么都没留下…
展开
-
ConnectionError: Couldn‘t reach https://raw.githubusercontent.com/huggingface/...
@[TOC](运行load_metric(“seqeval”) 报ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.6.2/metrics/seqeval/seqeval.py)对本地代码之直接运行load_metric(“seqeval”)报ConnectionError: Couldn’t reach https://raw.githubusercontent.com/hu原创 2022-03-05 20:42:30 · 4001 阅读 · 1 评论 -
对pytorch官网的bilstm+crf的batch版本的实现+用中文实体识别的数据训练batch版本bilstm+crf
代码的git地址(https://github.com/liaozhihui/MY_MODEL/blob/master/batch_bilstm_crf.py)文章目录前言代码的实现前言对pytorch官网的bilstm+crf的batch版本的实现,和只传入模型一句句子不通,一个batch里句子的长短不一样,需要对句子进行padding,以及要将padding的位置不能加入分数的计算中代码的git地址代码的实现创建一个mask的矩阵,矩阵维度batch_size*max_len,句子的长原创 2020-10-23 17:35:36 · 2970 阅读 · 24 评论 -
对Pytorch Bi-LSTM + CRF 代码详解
对Pytorch Bi-LSTM + CRF 代码中如何计算所有可能的路径分数和作一些解释公式为:log(∑y~∈YXeS(X,y~))log(\sum_{\tilde{y} \in Y_{X}}e^{S(X,\tilde{y})})log(∑y~∈YXeS(X,y~))(后面用logsumexp表示)在此之前可以先看完再看看这位的博客Bi-LSTM-CRF for Sequence Labeling PENG首先是定义S(X,y~)S(X,\tilde{y})S(X,y~)是对于输入序列原创 2020-09-25 19:20:22 · 2501 阅读 · 2 评论