From 2bf57673a9045bc8970b9a9436df988691370a2b Mon Sep 17 00:00:00 2001 From: troyyyyy Date: Thu, 21 Dec 2023 15:59:16 +0800 Subject: [PATCH] [FIX] resolve some comments --- docs/Intro/Basics.rst | 20 ++++++++++---------- docs/Overview/Abductive-Learning.rst | 16 +++++++++------- docs/Overview/Installation.rst | 9 ++++++++- docs/README.rst | 16 ++++++++-------- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/docs/Intro/Basics.rst b/docs/Intro/Basics.rst index b479c6d..bac8708 100644 --- a/docs/Intro/Basics.rst +++ b/docs/Intro/Basics.rst @@ -15,13 +15,13 @@ Modules in ABL-Package ABL-Package is an implementation of `Abductive Learning <../Overview/Abductive-Learning.html>`_, designed to harmoniously integrate and balance the use of machine learning and logical reasoning within a unified model. As depicted below, the -ABL-Package comprises three primary modules: **Data**, **Learning**, and +ABL-Package comprises three primary parts: **Data**, **Learning**, and **Reasoning**, corresponding to the three pivotal components in current AI: data, models, and knowledge. .. image:: ../img/ABL-Package.png -**Data** module manages the storage, operation, and evaluation of data. +**Data** part manages the storage, operation, and evaluation of data. It first features class ``ListData`` (derived from base class ``BaseDataElement``), which defines the data structures used in Abductive Learning, and comprises common data operations like insertion, @@ -30,24 +30,24 @@ Metrics, including class ``SymbolMetric`` and ``ReasoningMetric`` (both specialized metrics derived from base class ``BaseMetric``), outline methods for evaluating model quality from a data perspective. -**Learning** module is responsible for the construction, deployment, and -training of machine learning models. In this module, the class +**Learning** part is responsible for the construction, deployment, and +training of machine learning models. In this part, the class ``ABLModel`` is the central class that encapsulates the machine learning model, which may incorporate models such as those based on Scikit-learn or a neural network framework using constructed by class ``BasicNN``. -**Reasoning** module consists of the reasoning part of the Abductive -learning. The class ``KBBase`` allows users to define domain -knowledge base. For diverse types of knowledge, we also offer +**Reasoning** part is responsible for the construction of domain knowledge +and performing reasoning. In this part, the class ``KBBase`` allows users to +define domain knowledge base. For diverse types of knowledge, we also offer implementations like ``GroundKB`` and ``PrologKB``, e.g., the latter enables knowledge base to be imported in the form of a Prolog files. Upon building the knowledge base, the class ``Reasoner`` is responsible for minimizing the inconsistency between the knowledge base and learning models. -Finally, the integration of these three modules occurs through -**Bridge** module, which features class ``SimpleBridge`` (derived from base -class ``BaseBridge``). Bridge module synthesize data, learning, and +Finally, the integration of these three parts occurs through +**Bridge** part, which features class ``SimpleBridge`` (derived from base +class ``BaseBridge``). Bridge part synthesize data, learning, and reasoning, and facilitate the training and testing of the entire Abductive Learning framework. diff --git a/docs/Overview/Abductive-Learning.rst b/docs/Overview/Abductive-Learning.rst index a4e90d1..c395c00 100644 --- a/docs/Overview/Abductive-Learning.rst +++ b/docs/Overview/Abductive-Learning.rst @@ -16,7 +16,7 @@ In **Abductive Learning (ABL)**, we assume that, in addition to data, there is also a knowledge base :math:`\mathcal{KB}` containing domain knowledge at our disposal. We aim for the classifier :math:`f` to make correct predictions on data instances :math:`\{x_1,\dots,x_m\}`, -and meanwhile, the logical facts grounded by the prediction +and meanwhile, the pseudo-groundings grounded by the prediction :math:`\left\{f(\boldsymbol{x}_1), \ldots, f(\boldsymbol{x}_m)\right\}` should be compatible with :math:`\mathcal{KB}`. @@ -26,22 +26,22 @@ The process of ABL is as follows: pseudo-labels :math:`\left\{f(\boldsymbol{x}_1), \ldots, f(\boldsymbol{x}_m)\right\}` are predicted by a data-driven classifier model. -2. These pseudo-labels are then converted into logical facts +2. These pseudo-labels are then converted into pseudo-groundings :math:`\mathcal{O}` that are acceptable for logical reasoning. 3. Conduct joint reasoning with :math:`\mathcal{KB}` to find any - inconsistencies. If found, the logical facts that lead to minimal + inconsistencies. If found, the pseudo-groundings that lead to minimal inconsistency can be identified. 4. Modify the identified facts through **abductive reasoning** (or, **abduction**), - returning revised logical facts :math:`\Delta(\mathcal{O})` which are + returning revised pseudo-groundings :math:`\Delta(\mathcal{O})` which are compatible with :math:`\mathcal{KB}`. -5. These revised logical facts are converted back to the form of +5. These revised pseudo-groundings are converted back to the form of pseudo-labels, and used like ground-truth labels in conventional supervised learning to train a new classifier. 6. The new classifier will then be adopted to replace the previous one in the next iteration. This above process repeats until the classifier is no longer updated, or -the logical facts :math:`\mathcal{O}` are compatible with the knowledge +the pseudo-groundings :math:`\mathcal{O}` are compatible with the knowledge base. The following figure illustrates this process: @@ -57,6 +57,8 @@ is dual-driven by both data and domain knowledge, integrating and balancing the use of machine learning and logical reasoning in a unified model. +For more information about ABL, please refer to: [Zhou, 2019](https://link.springer.com/epdf/10.1007/s11432-018-9801-4?author_access_token=jgJe1Ox3Mk-K7ORSnX7jtfe4RwlQNchNByi7wbcMAY7_PxTx-xNLP7Lp0mIZ04ORp3VG4wioIBHSCIAO3B_TBJkj87YzapmdnYVSQvgBIO3aEpQWppxZG25KolINetygc2W_Cj2gtoBdiG_J1hU3pA==) and [Zhou and Huang, 2022](https://www.lamda.nju.edu.cn/publication/chap_ABL.pdf). + .. _abd: .. admonition:: What is Abductive Reasoning? @@ -68,7 +70,7 @@ model. reasoning may arrive at conclusions that are plausible but not conclusively proven. - In Abductive Learning, given :math:`\mathcal{KB}` (typically expressed + In ABL, given :math:`\mathcal{KB}` (typically expressed in first-order logic clauses), one can perform both deductive and abductive reasoning. Deductive reasoning allows deriving :math:`b` from :math:`a`, while abductive reasoning allows inferring diff --git a/docs/Overview/Installation.rst b/docs/Overview/Installation.rst index 1cea0a1..ae6ed1c 100644 --- a/docs/Overview/Installation.rst +++ b/docs/Overview/Installation.rst @@ -5,7 +5,14 @@ ABL is distributed on `PyPI `__ and can be installed with ``p .. code:: console - $ pip install abl + # (TODO) + $ pip install abl + +For testing purposes, you can install it using: + +.. code:: console + + $ pip install -i https://test.pypi.org/simple/ abl Alternatively, to install ABL by source code, sequentially run following commands in your terminal/command line. diff --git a/docs/README.rst b/docs/README.rst index 3d25b23..40e230d 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -17,7 +17,14 @@ ABL is distributed on `PyPI `__ and can be installed with ``p .. code:: console - $ pip install abl + # (TODO) + $ pip install abl + +For testing purposes, you can install it using: + +.. code:: console + + $ pip install -i https://test.pypi.org/simple/ abl Alternatively, to install ABL by source code, sequentially run following commands in your terminal/command line. @@ -27,10 +34,3 @@ sequentially run following commands in your terminal/command line. $ git clone https://github.com/AbductiveLearning/ABL-Package.git $ cd ABL-Package $ pip install -v -e . - - -Releases --------- -`release 0.1`_ - -.. _release 0.1: https://github.com/AbductiveLearning/ABL-Package/releases/tag/v0.1 \ No newline at end of file