Browse Source

change pl_file name for HED

pull/3/head
troyyyyy 3 years ago
parent
commit
c98e516e43
3 changed files with 3 additions and 4 deletions
  1. +1
    -1
      abl/abducer/abducer_base.py
  2. +1
    -2
      abl/abducer/kb.py
  3. +1
    -1
      examples/example.py

+ 1
- 1
abl/abducer/abducer_base.py View File

@@ -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]]


+ 1
- 2
abl/abducer/kb.py View File

@@ -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


+ 1
- 1
examples/example.py View File

@@ -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()


Loading…
Cancel
Save