This commit is contained in:
thanhvc3 2024-06-19 00:20:44 +07:00
parent 975a0a77c2
commit 2637f53848

View File

@ -91,6 +91,7 @@ class Main(object):
for line in open('./data/{}/{}'.format(self.p.dataset, "relations.dict")): for line in open('./data/{}/{}'.format(self.p.dataset, "relations.dict")):
id, rel = map(str.lower, line.strip().split('\t')) id, rel = map(str.lower, line.strip().split('\t'))
self.rel2id[rel] = int(id) self.rel2id[rel] = int(id)
rel_set.add(rel)
# self.ent2id = {ent: idx for idx, ent in enumerate(ent_set)} # self.ent2id = {ent: idx for idx, ent in enumerate(ent_set)}
# self.rel2id = {rel: idx for idx, rel in enumerate(rel_set)} # self.rel2id = {rel: idx for idx, rel in enumerate(rel_set)}