gswycf / Joint-Extraction-of-Entities-and-Relations-Based-on-a-Novel-Tagging-Scheme

Joint Extraction of Entities and Relations Based on cnn+rnn
MIT License
185 stars 54 forks source link

Excuse me, can this model be used to run Chinese data sets #16

Open lalala1020 opened 2 years ago

lalala1020 commented 2 years ago

I converted the dataset to Chinese dataset but there was an error. Traceback (most recent call last): File "E:/PycharmProjects/LSTM_LSTM_Bias/train.py", line 276, in train() File "E:/PycharmProjects/LSTM_LSTM_Bias/train.py", line 168, in train loss = criterion(output, targets) File "D:\Program Files (x86)\anaconda3\envs\bias\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "D:\Program Files (x86)\anaconda3\envs\bias\lib\site-packages\torch\nn\modules\loss.py", line 216, in forward return F.nll_loss(input, target, weight=self.weight, ignore_index=self.ignore_index, reduction=self.reduction) File "D:\Program Files (x86)\anaconda3\envs\bias\lib\site-packages\torch\nn\functional.py", line 2385, in nll_loss ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index) RuntimeError: weight tensor should be defined either for all 193 classes or no classes but got weight tensor of shape: [121] at C:/w/b/windows/pytorch/aten/src\THCUNN/generic/ClassNLLCriterion.cu:44

lalala1020 commented 2 years ago

I want to add one thing. that the number 193 in the number of tags in the model's built-in data, the number 121 is the number of tags after I changed the dataset. Finally, I hope you can help me solve this problem.

gswycf commented 2 years ago

Sorry,this repository is no longer maintained. I really want to help you, but now I am busy with other research and I haven’t updated this repository for several years, and I almost forgot its contents.

lalala1020 commented 2 years ago

Sorry,this repository is no longer maintained. I really want to help you, but now I am busy with other research and I haven’t updated this repository for several years, and I almost forgot its contents.

OK, thank you