diff --git a/.gitignore b/.gitignore index 931fddd..7b8d445 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ examples/**/*.png results raw/ abl.egg-info/ +ablkit.egg-info/ examples/**/*.jpg .idea/ build/ diff --git a/README.md b/README.md index 6792daa..3e54cb7 100644 --- a/README.md +++ b/README.md @@ -12,21 +12,21 @@ -# Abductive Learning (ABL) Package +# Abductive Learning (ABL) Kit -**ABL-Package** is an open source library for **Abductive Learning (ABL)**. +**ABL Kit** is an open source toolkit library for **Abductive Learning (ABL)**. ABL is a novel paradigm that integrates machine learning and logical reasoning in a unified framework. It is suitable for tasks where both data and (logical) domain knowledge are available. -Key Features of ABL-Package: +Key Features of ABL Kit: - **Great Flexibility**: Adaptable to various machine learning modules and logical reasoning components. - **User-Friendly**: Provide data, model, and KB, and get started with just a few lines of code. - **High-Performance**: Optimization for high accuracy and fast training speed. -ABL-Package encapsulates advanced ABL techniques, providing users with -an efficient and convenient package to develop dual-driven ABL systems, +ABL Kit encapsulates advanced ABL techniques, providing users with +an efficient and convenient toolkit to develop dual-driven ABL systems, which leverage the power of both data and knowledge. To learn how to use it, please refer to - [document](https://www.lamda.nju.edu.cn/abl_test/docs/build/html/index.html). @@ -35,16 +35,10 @@ To learn how to use it, please refer to - [document](https://www.lamda.nju.edu.c ### Install from PyPI -The easiest way to install ABL-Package is using ``pip``: -```bash -# (TODO) -pip install abl -``` - -For testing purposes, you can install it using: +The easiest way to install ABL Kit is using ``pip``: ```bash -pip install -i https://test.pypi.org/simple/ --extra-index-url https://mirrors.nju.edu.cn/pypi/web/simple/ abl +pip install ablkit ``` ### Install from Source @@ -86,7 +80,7 @@ We use the MNIST Addition task as a quick start example. In this task, pairs of Working with Data
-ABL-Package requires data in the format of `(X, gt_pseudo_label, Y)` where `X` is a list of input examples containing instances, `gt_pseudo_label` is the ground-truth label of each example in `X` and `Y` is the ground-truth reasoning result of each example in `X`. Note that `gt_pseudo_label` is only used to evaluate the machine learning model's performance but not to train it. +ABL Kit requires data in the format of `(X, gt_pseudo_label, Y)` where `X` is a list of input examples containing instances, `gt_pseudo_label` is the ground-truth label of each example in `X` and `Y` is the ground-truth reasoning result of each example in `X`. Note that `gt_pseudo_label` is only used to evaluate the machine learning model's performance but not to train it. In the MNIST Addition task, the data loading looks like: @@ -105,7 +99,7 @@ test_data = get_dataset(train=False) Building the Learning Part
-Learning part is constructed by first defining a base model for machine learning. The ABL-Package offers considerable flexibility, supporting any base model that conforms to the scikit-learn style (which requires the implementation of fit and predict methods), or a PyTorch-based neural network (which has defined the architecture and implemented forward method). In this example, we build a simple LeNet5 network as the base model. +Learning part is constructed by first defining a base model for machine learning. ABL Kit offers considerable flexibility, supporting any base model that conforms to the scikit-learn style (which requires the implementation of fit and predict methods), or a PyTorch-based neural network (which has defined the architecture and implemented forward method). In this example, we build a simple LeNet5 network as the base model. ```python # The 'models' module below is located in 'examples/mnist_add/' @@ -114,7 +108,7 @@ from models.nn import LeNet5 cls = LeNet5(num_classes=10) ``` -To facilitate uniform processing, ABL-Package provides the `BasicNN` class to convert a PyTorch-based neural network into a format compatible with scikit-learn models. To construct a `BasicNN` instance, aside from the network itself, we also need to define a loss function, an optimizer, and the computing device. +To facilitate uniform processing, ABL Kit provides the `BasicNN` class to convert a PyTorch-based neural network into a format compatible with scikit-learn models. To construct a `BasicNN` instance, aside from the network itself, we also need to define a loss function, an optimizer, and the computing device. ```python ​import torch @@ -169,7 +163,7 @@ reasoner = Reasoner(kb) Building Evaluation Metrics
-ABL-Package provides two basic metrics, namely `SymbolAccuracy` and `ReasoningMetric`, which are used to evaluate the accuracy of the machine learning model's predictions and the accuracy of the `logic_forward` results, respectively. +ABL Kit provides two basic metrics, namely `SymbolAccuracy` and `ReasoningMetric`, which are used to evaluate the accuracy of the machine learning model's predictions and the accuracy of the `logic_forward` results, respectively. ```python from abl.data.evaluation import ReasoningMetric, SymbolAccuracy diff --git a/abl/data/data_converter.py b/abl/data/data_converter.py index b4e495d..b87a3b9 100644 --- a/abl/data/data_converter.py +++ b/abl/data/data_converter.py @@ -7,7 +7,7 @@ from lambdaLearn.Base.TabularMixin import TabularMixin class DataConverter: """ - This class provides functionality to convert LambdaLearn data to ABL-Package data. + This class provides functionality to convert LambdaLearn data to ABL Kit data. """ def __init__(self) -> None: diff --git a/abl/data/structures/list_data.py b/abl/data/structures/list_data.py index d9f2cb5..6e0f5d6 100644 --- a/abl/data/structures/list_data.py +++ b/abl/data/structures/list_data.py @@ -19,9 +19,9 @@ IndexType = Union[str, slice, int, list, LongTypeTensor, BoolTypeTensor, np.ndar class ListData(BaseDataElement): """ - Abstract Data Interface used throughout the ABL-Package. + Abstract Data Interface used throughout the ABL Kit. - ``ListData`` is the underlying data structure used in the ABL-Package, + ``ListData`` is the underlying data structure used in the ABL Kit, designed to manage diverse forms of data dynamically generated throughout the Abductive Learning (ABL) framework. This includes handling raw data, predicted pseudo-labels, abduced pseudo-labels, pseudo-label indices, etc. diff --git a/abl/learning/model_converter.py b/abl/learning/model_converter.py index 20f77b9..a9666a3 100644 --- a/abl/learning/model_converter.py +++ b/abl/learning/model_converter.py @@ -9,7 +9,7 @@ from lambdaLearn.Base.DeepModelMixin import DeepModelMixin class ModelConverter: """ - This class provides functionality to convert LambdaLearn models to ABL-Package models. + This class provides functionality to convert LambdaLearn models to ABL Kit models. """ def __init__(self) -> None: diff --git a/docs/Examples/HWF.rst b/docs/Examples/HWF.rst index c6a83e6..e940dce 100644 --- a/docs/Examples/HWF.rst +++ b/docs/Examples/HWF.rst @@ -233,7 +233,7 @@ examples. .. code:: ipython3 from abl.data.structures import ListData - # ListData is a data structure provided by ABL-Package that can be used to organize data examples + # ListData is a data structure provided by ABL Kit that can be used to organize data examples data_examples = ListData() # We use the first 1001st and 3001st data examples in the training set as an illustration data_examples.X = [X_1000, X_3000] diff --git a/docs/Examples/MNISTAdd.rst b/docs/Examples/MNISTAdd.rst index 57f22cd..aef522b 100644 --- a/docs/Examples/MNISTAdd.rst +++ b/docs/Examples/MNISTAdd.rst @@ -203,7 +203,7 @@ examples. .. code:: ipython3 from abl.data.structures import ListData - # ListData is a data structure provided by ABL-Package that can be used to organize data examples + # ListData is a data structure provided by ABL Kit that can be used to organize data examples data_examples = ListData() # We use the first 100 data examples in the training set as an illustration data_examples.X = train_X[:100] diff --git a/docs/Examples/Zoo.rst b/docs/Examples/Zoo.rst index e32a00f..c17c726 100644 --- a/docs/Examples/Zoo.rst +++ b/docs/Examples/Zoo.rst @@ -84,7 +84,7 @@ Out: Next, we transform the tabular data to the format required by -ABL-Package, which is a tuple of (X, gt_pseudo_label, Y). In this task, +ABL Kit, which is a tuple of (X, gt_pseudo_label, Y). In this task, we treat the attributes as X and the targets as gt_pseudo_label (ground truth pseudo-labels). Y (reasoning results) are expected to be 0, indicating no rules are violated. diff --git a/docs/Intro/Basics.rst b/docs/Intro/Basics.rst index 0187729..cdaa6bb 100644 --- a/docs/Intro/Basics.rst +++ b/docs/Intro/Basics.rst @@ -9,16 +9,16 @@ Learn the Basics ================ -Modules in ABL-Package +Modules in ABL Kit ---------------------- -ABL-Package is an efficient implementation of `Abductive Learning <../Overview/Abductive-Learning.html>`_ (ABL), +ABL Kit is an efficient toolkit for `Abductive Learning <../Overview/Abductive-Learning.html>`_ (ABL), a paradigm which integrates machine learning and logical reasoning in a balanced-loop. -The ABL-Package comprises three primary parts: **Data**, **Learning**, and +ABL Kit comprises three primary parts: **Data**, **Learning**, and **Reasoning**, corresponding to the three pivotal components of current -AI: data, models, and knowledge. Below is an overview of the ABL-Package. +AI: data, models, and knowledge. Below is an overview of the ABL Kit. -.. image:: ../_static/img/ABL-Package.png +.. image:: ../_static/img/ABLKit.png **Data** part manages the storage, operation, and evaluation of data efficiently. It includes the ``ListData`` class, which defines the data structures used in @@ -50,7 +50,7 @@ from the ``BaseBridge`` class). The Bridge part synthesizes data, learning, and reasoning, facilitating the training and testing of the entire ABL framework. -Use ABL-Package Step by Step +Use ABL Kit Step by Step ---------------------------- In a typical ABL process, as illustrated below, diff --git a/docs/Intro/Bridge.rst b/docs/Intro/Bridge.rst index 23ac31d..8d6b82e 100644 --- a/docs/Intro/Bridge.rst +++ b/docs/Intro/Bridge.rst @@ -10,7 +10,7 @@ Bridge ====== -In this section, we will look at how to bridge learning and reasoning parts to train the model, which is the fundamental idea of Abductive Learning. ABL-Package implements a set of bridge classes to achieve this. +In this section, we will look at how to bridge learning and reasoning parts to train the model, which is the fundamental idea of Abductive Learning. ABL Kit implements a set of bridge classes to achieve this. .. code:: python @@ -42,7 +42,7 @@ In this section, we will look at how to bridge learning and reasoning parts to t | ``test(test_data)`` | Test the model. | +---------------------------------------+----------------------------------------------------+ -where ``train_data`` and ``test_data`` are both in the form of a tuple or a `ListData <../API/abl.data.html#structures.ListData>`_. Regardless of the form, they all need to include three components: ``X``, ``gt_pseudo_label`` and ``Y``. Since ``ListData`` is the underlying data structure used throughout the ABL-Package, tuple-formed data will be firstly transformed into ``ListData`` in the ``train`` and ``test`` methods, and such ``ListData`` instances are referred to as ``data_examples``. More details can be found in `preparing datasets `_. +where ``train_data`` and ``test_data`` are both in the form of a tuple or a `ListData <../API/abl.data.html#structures.ListData>`_. Regardless of the form, they all need to include three components: ``X``, ``gt_pseudo_label`` and ``Y``. Since ``ListData`` is the underlying data structure used throughout the ABL Kit, tuple-formed data will be firstly transformed into ``ListData`` in the ``train`` and ``test`` methods, and such ``ListData`` instances are referred to as ``data_examples``. More details can be found in `preparing datasets `_. ``SimpleBridge`` inherits from ``BaseBridge`` and provides a basic implementation. Besides the ``model`` and ``reasoner``, ``SimpleBridge`` has an extra initialization argument, ``metric_list``, which will be used to evaluate model performance. Its training process involves several Abductive Learning loops and each loop consists of the following five steps: diff --git a/docs/Intro/Datasets.rst b/docs/Intro/Datasets.rst index 9aadb99..321986c 100644 --- a/docs/Intro/Datasets.rst +++ b/docs/Intro/Datasets.rst @@ -10,7 +10,7 @@ Dataset & Data Structure ======================== -In this section, we will look at the dataset and data structure in ABL-Package. +In this section, we will look at the dataset and data structure in ABL Kit. .. code:: python @@ -20,7 +20,7 @@ In this section, we will look at the dataset and data structure in ABL-Package. Dataset ------- -ABL-Package requires user data to be either structured as a tuple ``(X, gt_pseudo_label, Y)`` or a ``ListData`` (the underlying data structure utilized in ABL-Package, cf. the next section) object with ``X``, ``gt_pseudo_label`` and ``Y`` attributes. Regardless of the chosen format, the data should encompass three essential components: +ABL Kit requires user data to be either structured as a tuple ``(X, gt_pseudo_label, Y)`` or a ``ListData`` (the underlying data structure utilized in ABL Kit, cf. the next section) object with ``X``, ``gt_pseudo_label`` and ``Y`` attributes. Regardless of the chosen format, the data should encompass three essential components: - ``X``: List[List[Any]] @@ -62,11 +62,11 @@ where each sublist in ``X``, e.g., |data_example|, is a data example and each im Data Structure -------------- -Besides the user-provided dataset, various forms of data are utilized and dynamicly generated throughout the training and testing process of ABL framework. Examples include raw data, predicted pseudo-label, abduced pseudo-label, pseudo-label indices, etc. To manage this diversity and ensure a stable, versatile interface, ABL-Package employs `abstract data interfaces <../API/abl.data.html#structure>`_ to encapsulate different forms of data that will be used in the total learning process. +Besides the user-provided dataset, various forms of data are utilized and dynamicly generated throughout the training and testing process of ABL framework. Examples include raw data, predicted pseudo-label, abduced pseudo-label, pseudo-label indices, etc. To manage this diversity and ensure a stable, versatile interface, ABL Kit employs `abstract data interfaces <../API/abl.data.html#structure>`_ to encapsulate different forms of data that will be used in the total learning process. -``ListData`` is the underlying abstract data interface utilized in ABL-Package. As the fundamental data structure, ``ListData`` implements commonly used data manipulation methods and is responsible for transferring data between various components of ABL, ensuring that stages such as prediction, abductive reasoning, and training can utilize ``ListData`` as a unified input format. Before proceeding to other stages, user-provided datasets will be firstly converted into ``ListData``. +``ListData`` is the underlying abstract data interface utilized in ABL Kit. As the fundamental data structure, ``ListData`` implements commonly used data manipulation methods and is responsible for transferring data between various components of ABL, ensuring that stages such as prediction, abductive reasoning, and training can utilize ``ListData`` as a unified input format. Before proceeding to other stages, user-provided datasets will be firstly converted into ``ListData``. -Besides providing a tuple of ``(X, gt_pseudo_label, Y)``, ABL-Package also allows users to directly supply data in ``ListData`` format, which similarly requires the inclusion of these three attributes. The following code shows the basic usage of ``ListData``. More information can be found in the `API documentation <../API/abl.data.html#structure>`_. +Besides providing a tuple of ``(X, gt_pseudo_label, Y)``, ABL Kit also allows users to directly supply data in ``ListData`` format, which similarly requires the inclusion of these three attributes. The following code shows the basic usage of ``ListData``. More information can be found in the `API documentation <../API/abl.data.html#structure>`_. .. code-block:: python diff --git a/docs/Intro/Evaluation.rst b/docs/Intro/Evaluation.rst index b34d908..bc328ac 100644 --- a/docs/Intro/Evaluation.rst +++ b/docs/Intro/Evaluation.rst @@ -16,7 +16,7 @@ In this section, we will look at how to build evaluation metrics. from abl.data.evaluation import BaseMetric, SymbolAccuracy, ReasoningMetric -ABL-Package seperates the evaluation process from model training and testing as an independent class, ``BaseMetric``. The training and testing processes are implemented in the ``BaseBridge`` class, so metrics are used by this class and its sub-classes. After building a ``bridge`` with a list of ``BaseMetric`` instances, these metrics will be used by the ``bridge.valid`` method to evaluate the model performance during training and testing. +ABL Kit seperates the evaluation process from model training and testing as an independent class, ``BaseMetric``. The training and testing processes are implemented in the ``BaseBridge`` class, so metrics are used by this class and its sub-classes. After building a ``bridge`` with a list of ``BaseMetric`` instances, these metrics will be used by the ``bridge.valid`` method to evaluate the model performance during training and testing. To customize our own metrics, we need to inherit from ``BaseMetric`` and implement the ``process`` and ``compute_metrics`` methods. diff --git a/docs/Intro/Learning.rst b/docs/Intro/Learning.rst index dbbea25..7f14346 100644 --- a/docs/Intro/Learning.rst +++ b/docs/Intro/Learning.rst @@ -12,7 +12,7 @@ Learning Part In this section, we will look at how to build the learning part. -In ABL-Package, building the learning part involves two steps: +In ABL Kit, building the learning part involves two steps: 1. Build a machine learning base model used to make predictions on instance-level data. 2. Instantiate an ``ABLModel`` with the base model, which enables the learning part to process example-level data. @@ -26,7 +26,7 @@ In ABL-Package, building the learning part involves two steps: Building a base model --------------------- -ABL package allows the base model to be one of the following forms: +ABL toolkit allows the base model to be one of the following forms: 1. Any machine learning model conforming to the scikit-learn style, i.e., models which has implemented the ``fit`` and ``predict`` methods; @@ -76,7 +76,7 @@ Besides the necessary methods required to instantiate an ``ABLModel``, i.e., ``f Instantiating an ABLModel ------------------------- -Typically, base model is trained to make predictions on instance-level data, and can not directly process example-level data, which is not suitable for most neural-symbolic tasks. ABL-Package provides the ``ABLModel`` to solve this problem. This class serves as a unified wrapper for all base models, which enables the learning part to train, test, and predict on example-level data. +Typically, base model is trained to make predictions on instance-level data, and can not directly process example-level data, which is not suitable for most neural-symbolic tasks. ABL Kit provides the ``ABLModel`` to solve this problem. This class serves as a unified wrapper for all base models, which enables the learning part to train, test, and predict on example-level data. Generally, we can simply instantiate an ``ABLModel`` by: diff --git a/docs/Intro/Quick-Start.rst b/docs/Intro/Quick-Start.rst index 1cd01e9..f721004 100644 --- a/docs/Intro/Quick-Start.rst +++ b/docs/Intro/Quick-Start.rst @@ -14,7 +14,7 @@ We use the MNIST Addition task as a quick start example. In this task, pairs of Working with Data ----------------- -ABL-Package requires data in the format of ``(X, gt_pseudo_label, Y)`` where ``X`` is a list of input examples containing instances, +ABL Kit requires data in the format of ``(X, gt_pseudo_label, Y)`` where ``X`` is a list of input examples containing instances, ``gt_pseudo_label`` is the ground-truth label of each example in ``X`` and ``Y`` is the ground-truth reasoning result of each example in ``X``. Note that ``gt_pseudo_label`` is only used to evaluate the machine learning model's performance but not to train it. In the MNIST Addition task, the data loading looks like @@ -33,7 +33,7 @@ Read more about `preparing datasets `_. Building the Learning Part -------------------------- -Learning part is constructed by first defining a base model for machine learning. The ABL-Package offers considerable flexibility, supporting any base model that conforms to the scikit-learn style (which requires the implementation of ``fit`` and ``predict`` methods), or a PyTorch-based neural network (which has defined the architecture and implemented ``forward`` method). +Learning part is constructed by first defining a base model for machine learning. ABL Kit offers considerable flexibility, supporting any base model that conforms to the scikit-learn style (which requires the implementation of ``fit`` and ``predict`` methods), or a PyTorch-based neural network (which has defined the architecture and implemented ``forward`` method). In this example, we build a simple LeNet5 network as the base model. .. code:: python @@ -43,7 +43,7 @@ In this example, we build a simple LeNet5 network as the base model. cls = LeNet5(num_classes=10) -To facilitate uniform processing, ABL-Package provides the ``BasicNN`` class to convert a PyTorch-based neural network into a format compatible with scikit-learn models. To construct a ``BasicNN`` instance, aside from the network itself, we also need to define a loss function, an optimizer, and the computing device. +To facilitate uniform processing, ABL Kit provides the ``BasicNN`` class to convert a PyTorch-based neural network into a format compatible with scikit-learn models. To construct a ``BasicNN`` instance, aside from the network itself, we also need to define a loss function, an optimizer, and the computing device. .. code:: python @@ -98,7 +98,7 @@ Read more about `building the reasoning part `_. Building Evaluation Metrics --------------------------- -ABL-Package provides two basic metrics, namely ``SymbolAccuracy`` and ``ReasoningMetric``, which are used to evaluate the accuracy of the machine learning model's predictions and the accuracy of the ``logic_forward`` results, respectively. +ABL Kit provides two basic metrics, namely ``SymbolAccuracy`` and ``ReasoningMetric``, which are used to evaluate the accuracy of the machine learning model's predictions and the accuracy of the ``logic_forward`` results, respectively. .. code:: python diff --git a/docs/Intro/Reasoning.rst b/docs/Intro/Reasoning.rst index 2150436..217acb3 100644 --- a/docs/Intro/Reasoning.rst +++ b/docs/Intro/Reasoning.rst @@ -12,7 +12,7 @@ Reasoning part In this section, we will look at how to build the reasoning part, which leverages domain knowledge and performs deductive or abductive reasoning. -In ABL-Package, building the reasoning part involves two steps: +In ABL Kit, building the reasoning part involves two steps: 1. Build a knowledge base by creating a subclass of ``KBBase``, which specifies how to process pseudo-label of an example to the reasoning result. @@ -28,7 +28,7 @@ Building a knowledge base ------------------------- Generally, we can create a subclass derived from ``KBBase`` to build our own -knowledge base. In addition, ABL-Package also offers several predefined +knowledge base. In addition, ABL Kit also offers several predefined subclasses of ``KBBase`` (e.g., ``PrologKB`` and ``GroundKB``), which we can utilize to build our knowledge base more conveniently. diff --git a/docs/Makefile b/docs/Makefile index caeb32e..65fafe4 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -4,7 +4,7 @@ # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build -SPHINXPROJ = ABL-Package +SPHINXPROJ = ABL Kit SOURCEDIR = . BUILDDIR = build diff --git a/docs/Overview/Installation.rst b/docs/Overview/Installation.rst index 8251ca5..a3f28e2 100644 --- a/docs/Overview/Installation.rst +++ b/docs/Overview/Installation.rst @@ -4,18 +4,11 @@ Installation Install from PyPI ^^^^^^^^^^^^^^^^^ -The easiest way to install ABL-Package is using ``pip``: +The easiest way to install ABL Kit is using ``pip``: .. code:: bash - # (TODO) - pip install abl - -For testing purposes, you can install it using: - -.. code:: bash - - pip install -i https://test.pypi.org/simple/ --extra-index-url https://mirrors.nju.edu.cn/pypi/web/simple/ abl + pip install ablkit Install from Source ^^^^^^^^^^^^^^^^^^^ diff --git a/docs/README.rst b/docs/README.rst index 9c0c978..16d954e 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -1,19 +1,19 @@ -ABL-Package -=========== +ABL Kit +======= -**ABL-Package** is an open source library for **Abductive Learning (ABL)**. +**ABL Kit** is an open source toolkit library for **Abductive Learning (ABL)**. ABL is a novel paradigm that integrates machine learning and logical reasoning in a unified framework. It is suitable for tasks where both data and (logical) domain knowledge are available. -Key Features of ABL-Package: +Key Features of ABL Kit: - **Great Flexibility**: Adaptable to various machine learning modules and logical reasoning components. - **User-Friendly**: Provide data, model, and KB, and get started with just a few lines of code. - **High-Performance**: Optimization for high accuracy and fast training speed. -ABL-Package encapsulates advanced ABL techniques, providing users with -an efficient and convenient package to develop dual-driven ABL systems, +ABL Kit encapsulates advanced ABL techniques, providing users with +an efficient and convenient toolkit to develop dual-driven ABL systems, which leverage the power of both data and knowledge. .. image:: _static/img/ABL.png @@ -24,18 +24,11 @@ Installation Install from PyPI ^^^^^^^^^^^^^^^^^ -The easiest way to install ABL-Package is using ``pip``: +The easiest way to install ABL Kit is using ``pip``: .. code:: bash - # (TODO) - pip install abl - -For testing purposes, you can install it using: - -.. code:: bash - - pip install -i https://test.pypi.org/simple/ --extra-index-url https://mirrors.nju.edu.cn/pypi/web/simple/ abl + pip install ablkit Install from Source ^^^^^^^^^^^^^^^^^^^ @@ -66,4 +59,27 @@ References ---------- For more information about ABL, please refer to: `Zhou, 2019 `_ -and `Zhou and Huang, 2022 `_. \ No newline at end of file +and `Zhou and Huang, 2022 `_. + +.. code-block:: latex + + @article{zhou2019abductive, + title = {Abductive learning: towards bridging machine learning and logical reasoning}, + author = {Zhou, Zhi-Hua}, + journal = {Science China Information Sciences}, + volume = {62}, + number = {7}, + pages = {76101}, + year = {2019} + } + + @incollection{zhou2022abductive, + title = {Abductive Learning}, + author = {Zhou, Zhi-Hua and Huang, Yu-Xuan}, + booktitle = {Neuro-Symbolic Artificial Intelligence: The State of the Art}, + editor = {Pascal Hitzler and Md. Kamruzzaman Sarker}, + publisher = {{IOS} Press}, + pages = {353--369}, + address = {Amsterdam}, + year = {2022} + } diff --git a/docs/_static/img/ABL-Package.png b/docs/_static/img/ABLKit.png similarity index 100% rename from docs/_static/img/ABL-Package.png rename to docs/_static/img/ABLKit.png diff --git a/docs/conf.py b/docs/conf.py index dcd522d..4433ae7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,7 +36,7 @@ sys.path.append(os.path.abspath("./ABL/")) project = "ABL" slug = re.sub(r"\W+", "-", project.lower()) -project = "ABL-Package" +project = "ABL Kit" copyright = "LAMDA, 2024" author = "Author" diff --git a/docs/index.rst b/docs/index.rst index 31c9129..f176f7f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,7 +9,7 @@ .. toctree:: :maxdepth: 1 - :caption: Introduction to ABL-Package + :caption: Introduction to ABL Kit Intro/Basics Intro/Quick-Start diff --git a/examples/hwf/hwf.ipynb b/examples/hwf/hwf.ipynb index 4e3838e..aaf15f3 100644 --- a/examples/hwf/hwf.ipynb +++ b/examples/hwf/hwf.ipynb @@ -237,7 +237,7 @@ "source": [ "from abl.data.structures import ListData\n", "\n", - "# ListData is a data structure provided by ABL-Package that can be used to organize data examples\n", + "# ListData is a data structure provided by ABL Kit that can be used to organize data examples\n", "data_examples = ListData()\n", "# We use the first 1001st and 3001st data examples in the training set as an illustration\n", "data_examples.X = [X_1000, X_3000]\n", diff --git a/examples/mnist_add/mnist_add.ipynb b/examples/mnist_add/mnist_add.ipynb index f7a0acc..e178914 100644 --- a/examples/mnist_add/mnist_add.ipynb +++ b/examples/mnist_add/mnist_add.ipynb @@ -282,7 +282,7 @@ "source": [ "from abl.data.structures import ListData\n", "\n", - "# ListData is a data structure provided by ABL-Package that can be used to organize data examples\n", + "# ListData is a data structure provided by ABL Kit that can be used to organize data examples\n", "data_examples = ListData()\n", "# We use the first 100 data examples in the training set as an illustration\n", "data_examples.X = train_X[:100]\n", diff --git a/examples/zoo/zoo.ipynb b/examples/zoo/zoo.ipynb index f118110..e84a89d 100644 --- a/examples/zoo/zoo.ipynb +++ b/examples/zoo/zoo.ipynb @@ -97,7 +97,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Next, we transform the tabular data to the format required by ABL-Package, which is a tuple of (X, gt_pseudo_label, Y). In this task, we treat the attributes as X and the targets as gt_pseudo_label (ground truth pseudo-labels). Y (reasoning results) are expected to be 0, indicating no rules are violated." + "Next, we transform the tabular data to the format required by ABL Kit, which is a tuple of (X, gt_pseudo_label, Y). In this task, we treat the attributes as X and the targets as gt_pseudo_label (ground truth pseudo-labels). Y (reasoning results) are expected to be 0, indicating no rules are violated." ] }, { diff --git a/pyproject.toml b/pyproject.toml index 902095a..6770e50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,12 +3,12 @@ requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] -name = "abl" -version = "0.1.7" +name = "ablkit" +version = "0.1.8" authors = [ { name="LAMDA 2024", email = "abductivelearning@gmail.com" }, ] -description = "Abductive Learning (ABL) package" +description = "Abductive Learning (ABL) toolkit" readme = "README.md" requires-python = ">=3.7.0" license = {text = "MIT LICENSE"}