NLPer

Results 18 issues of NLPer

体验Demo 下的标注工具链接失效,可以更新一下吗?

大佬,我想去掉整个CNN层,即三个Embeding层出来后直接接到协预测器模块,在修改过程遇到一些问题,一下没法解决了,希望得到大佬的帮助。 _注释掉送入卷积层的channel_ ``` conv_input_size = config.lstm_hid_size + config.dist_emb_size + config.type_emb_size self.convLayer = ConvolutionLayer(conv_input_size, config.conv_hid_size, config.dilation, config.conv_dropout) self.dropout = nn.Dropout(config.emb_dropout) ``` _并把这里_ ``` conv_inputs = torch.cat([dis_emb, reg_emb, cln], dim=-1) conv_inputs =...

大佬你好,有几个地方还是没明白,我跨专业有点菜,希望大佬不会嫌我烦。首先是loss,论文里面写的是负对数似然损失,代码里面好像用的是交叉熵,这个loss怎么计算呀?协预测器出来处理后得到词对关系分类矩阵,那具体怎么在这个矩阵上计算损失?另外一个就是论文里面说Co-Predictor Layer 出来后得到的是一个关系分数张量,经过softmax后,得到后面这个Word-Word Relation Classification 张量。我看了代码,协预测器出来的outputs[B,L,L,num_class]经过torch.argmax(outputs ,-1)得到词对关系张量[B,L,L],torch.argmax()返回的是最大值索引,怎么得到这里Word-Word Relation Classification ,不是很理解,希望能够得到大佬的解答。

ACE05数据拿来后要咋处理?处理成啥格式?可以提供一份处理后的样例看看嘛? ![图片](https://user-images.githubusercontent.com/82627285/182069925-5118b3b6-84a8-4edb-98fc-5401fb10ef3d.png)

import numpy as np import torch from torch import nn from torch.nn import init class PSA(nn.Module): def __init__(self, channel=512, reduction=4, S=4): super().__init__() self.S = S self.convs = nn.ModuleList( [nn.Conv2d(channel //...

大佬,我在使用`PSA.py`这个模块时,老是报错 `RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same,` 我已经把这个模块`.cuda()`了 ``` input=torch.randn(50,512,7,7).cuda() psa = PSA(channel=512,reduction=8).cuda() output=psa(input) a=output.view(-1).sum() a.backward() print(output.shape) ``` 还是报错,能解决一下吗?

首先感谢大佬一直耐心解答,这里还有一个小白问题。 论文用的损失函数是最小化NLLLoss,输出层进过log_softmax,相当于CE,代码里面用了CE。经过debug在loss计算这里有个细节问题没搞明白,举例来说就是: 对于单个样本 `[{"sentence": ["高", "勇", ":", "男", "."], "ner": [{"index": [0, 1], "type": "NAME"}]}]` ``` self.criterion = nn.CrossEntropyLoss() loss = self.criterion(outputs[grid_mask2d], grid_labels[grid_mask2d]) ``` **这里的outputs:** ``` tensor([[ [[-0.1269, 0.0936, 0.0886],...

大佬,想问一下下面这个mapping是想实现什么呢?没看明白。 ``` token2char_span_mapping = self.tokenizer(text, return_offsets_mapping=True, max_length=max_len, truncation=True)["offset_mapping"] start_mapping = {j[0]: i for i, j in enumerate(token2char_span_mapping) if j != (0, 0)} end_mapping = {j[-1] - 1: i for i,...

按照[Readme](https://github.com/LeePleased/NegSampling-NER/blob/master/README.md#preparation)操作后出现此问题,请问应该怎么解决 ![image](https://user-images.githubusercontent.com/82627285/196097377-2a97829e-bb9e-486b-aa11-3839d68bf042.png) train、dev、test数据用的都是示例提供的数据 ``` [ { "sentence": "['Somerset', '83', 'and', '174', '(', 'P.', 'Simmons', '4-38', ')', ',', 'Leicestershire', '296', '.']", "labeled entities": "[(0, 0, 'ORG'), (5, 6, 'PER'), (10, 10,...

能不能实现个circle loss,大佬