Closed TraceIvan closed 2 years ago
Describe the bug 我对DataSet进行copy_field,将'chars'列copy一份为‘words’,然后设定'words'列为input。之后对该DataSet进行切片,发现切片后的结果'words'列丢失,且'chars'列变为input。
To Reproduce
train_dataset.copy_field('chars','words') train_dataset.set_input('words','seq_len','target') train_dataset.set_input('lattice','pos_s','pos_e',flag=False) train_dataset.set_target('target','seq_len') train_dataset.print_field_meta() train_dataset[:1].print_field_meta()
Expected behavior 期望train_dataset切片后结果'words'列仍保留,且作为input的列和切片前相同。
Screenshots
Desktop (please complete the following information):
谢谢您的反馈,我们已经在dev分支解决了这个bug。您可以通过pip uninstall fastNLP先卸载已有的fastNLP,然后再通过pip install git+http://github.com/fastnlp/fastNLP@dev安装最新的fastNLP。
或者现在也可以通过pip install fastNLP -U来升级到最新的fastNLP
感谢~
Describe the bug 我对DataSet进行copy_field,将'chars'列copy一份为‘words’,然后设定'words'列为input。之后对该DataSet进行切片,发现切片后的结果'words'列丢失,且'chars'列变为input。
To Reproduce
Expected behavior 期望train_dataset切片后结果'words'列仍保留,且作为input的列和切片前相同。
Screenshots![微信截图_20211014111809](https://user-images.githubusercontent.com/27859479/137245607-dd6cf98b-8270-4316-8d44-4afc0d91a669.png)
Desktop (please complete the following information):