From c98e516e43898b0c431c339f62009aa8a63bb701 Mon Sep 17 00:00:00 2001 From: troyyyyy <49091847+troyyyyy@users.noreply.github.com> Date: Mon, 6 Mar 2023 08:47:45 +0000 Subject: [PATCH] change pl_file name for HED --- abl/abducer/abducer_base.py | 2 +- abl/abducer/kb.py | 3 +-- examples/example.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/abl/abducer/abducer_base.py b/abl/abducer/abducer_base.py index cb50ee3..712eb46 100644 --- a/abl/abducer/abducer_base.py +++ b/abl/abducer/abducer_base.py @@ -260,7 +260,7 @@ if __name__ == '__main__': print(res) print() - kb = prolog_KB(pseudo_label_list=[1, 0, '+', '='], pl_file='../examples/datasets/hed/hed.pl') + kb = prolog_KB(pseudo_label_list=[1, 0, '+', '='], pl_file='../examples/datasets/hed/learn_add.pl') abd = AbducerBase(kb, zoopt=True, multiple_predictions=True) consist_exs = [[1, 1, '+', 0, '=', 1, 1], [1, '+', 1, '=', 1, 0], [0, '+', 0, '=', 0]] inconsist_exs = [[1, '+', 0, '=', 0], [1, '=', 1, '=', 0], [0, '=', 0, '=', 1, 1]] diff --git a/abl/abducer/kb.py b/abl/abducer/kb.py index 632bd42..d937dcf 100644 --- a/abl/abducer/kb.py +++ b/abl/abducer/kb.py @@ -24,8 +24,7 @@ from multiprocessing import Pool import pyswip class KBBase(ABC): - # TODO:有些不能是默认参数,必须给定 - def __init__(self, pseudo_label_list=None, len_list=None, GKB_flag=False, max_err=0): + def __init__(self, pseudo_label_list, len_list=None, GKB_flag=False, max_err=0): self.pseudo_label_list = pseudo_label_list self.len_list = len_list self.GKB_flag = GKB_flag diff --git a/examples/example.py b/examples/example.py index a6a5194..c74f1b3 100644 --- a/examples/example.py +++ b/examples/example.py @@ -36,7 +36,7 @@ def run_test(): # kb = HWF_KB(True) # abducer = AbducerBase(kb) - kb = prolog_KB(pseudo_label_list=[1, 0, '+', '='], pl_file='../examples/datasets/hed/hed.pl') + kb = prolog_KB(pseudo_label_list=[1, 0, '+', '='], pl_file='../examples/datasets/hed/learn_add.pl') abducer = AbducerBase(kb, zoopt=True, multiple_predictions=True) recorder = logger()