Browse Source

Update preprocess.py

tags/v0.1.0
Yige XU GitHub 6 years ago
parent
commit
a422a4e2d6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      fastNLP/loader/preprocess.py

+ 1
- 0
fastNLP/loader/preprocess.py View File

@@ -75,6 +75,7 @@ class POSPreprocess(BasePreprocess):
else:
with open(os.path.join(self.pickle_path, "class2id.pkl"), "wb") as f:
_pickle.dump(self.label2index, f)
#something will be wrong if word2id.pkl is found but class2id.pkl is not found
if not self.pickle_exist("id2word.pkl"):
index2word = self.build_reverse_dict(self.word2index)


Loading…
Cancel
Save