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