From f8e7ed42b3b795a0bb787e3a550abe379d4cc377 Mon Sep 17 00:00:00 2001 From: monoid Date: Mon, 14 Feb 2022 22:23:35 +0900 Subject: [PATCH] refactor: remove useless if --- read_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/read_data.py b/read_data.py index 3cec2b4..1cd04d9 100644 --- a/read_data.py +++ b/read_data.py @@ -165,8 +165,7 @@ if __name__ == "__main__": def getTags(lst: List[Sentence]): for s in tqdm(lst): for e in s.detail: - if not e in vocab: - vocab.add(e) + vocab.add(e) print("get tags from train...") getTags(train) print("get tags from dev...") @@ -183,6 +182,7 @@ if __name__ == "__main__": v:str = "-".join(s) if not v in vocab: print("could not found pair " ,v) + vocab.add(v) tags = [{"name":"[PAD]","index":0}] i = 1