Browse Source

sst loader中增加一列raw_words

tags/v0.4.10
yh 5 years ago
parent
commit
d401bd2208
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      fastNLP/io/data_loader/sst.py

+ 1
- 0
fastNLP/io/data_loader/sst.py View File

@@ -134,6 +134,7 @@ class SST2Loader(CSVLoader):
info = DataBundle() info = DataBundle()
for name, path in paths.items(): for name, path in paths.items():
dataset = self.load(path) dataset = self.load(path)
dataset.apply_field(lambda words:words.copy(), field_name='words', new_field_name='raw_words')
datasets[name] = dataset datasets[name] = dataset


def wordtochar(words): def wordtochar(words):


Loading…
Cancel
Save