DeepNLP-models-Pytorch icon indicating copy to clipboard operation
DeepNLP-models-Pytorch copied to clipboard

Input sequences contain part of the outputs in CNN-for-Text-Classification

Open ducalpha opened this issue 7 years ago • 0 comments

Step [54] "data = [[d.split(':')[1][:-1], d.split(':')[0]] for d in data]" seems to include the sub-category output into the input sequence. For example, for data line "DESC:def What is ethology ?", data will be ["def What is ethology ?", "DESC"] so the "def" sub-category is included into the input sequence.

I suggest a fix:

# Remove the sub-category (first word) and the '?' at the end.
data = [[d.split(':')[1].split(' ', 1)[1][:-2], d.split(':')[0]] for d in data]

ducalpha avatar May 30 '18 15:05 ducalpha