semvec/pypi-packages huggingface dataset:
llm-explain 0.1.1
Tools that use LLM to explain datasets
License: MIT
Requires Python: >=3.9

# Scalable Understanding of Datasets and Models with the Help of Large Language Models

I will make a video tutorial on this topic; stay tuned. This is the library and notebooks to help the audience understand my tutorial. 

## Installation

I recommend creating a conda environment with python >= 3.9 to use this package.

1. Set up your openai key in your environment. i.e. ```export OPENAI_API_KEY="[Your OPENAI API KEY]"```
2. Installation

**Option 1**: clone and install locally (for developers)
- ```git clone git@github.com:ruiqi-zhong/llm_explain.git```
- ```cd llm_explain```
- ```pip install -e .```

**Option 2**: install from github repo

```pip3 install --no-cache-dir -v git+https://github.com/ruiqi-zhong/llm_explain.git```

**Option 3**: install from pypi

```pip3 install llm-explain```

## Usage

This repo supports the bare bone implementation for explaining dataset differences and clusters. 

See the notebooks, ```llm_explain/tests/test_cluster.py```, and ```llm_explain/tests/test_diff.py``` to understand how to use the functions implemented in this repo. 

If you want to build on it, refer to other test files to understand the rest of the repo. 

## A quick example after installation

run python: 
```
>>> from llm_explain.models.diff import explain_diff                                                                                                                           
>>> explain_diff(["cat", "dog", "fish", "carrot", "potato", "apple"], [False, False, False, True, True, True], proposer_num_rounds=2, proposer_num_explanations_per_round=2)
```

You will get outputs similar to the following in fewer than 30 seconds:

```
Printing top 3 explanations:
Explanation: refers to a plant-based item; specifically, the text mentions items that grow from plants, including vegetables and fruits. For example, 'carrot' is a type of root vegetable.
Accuracy: 1.0

Explanation: is a type of food; specifically, the text refers to items commonly recognized as food, typically vegetables or fruits. For example, 'apple' is known to be a fruit consumed as food.
Accuracy: 0.8333333333333333

Explanation: mentions a type of food; specifically, the text refers to something that is commonly eaten by humans. For example, 'This apple is very juicy.'
Accuracy: 0.8333333333333333
```

## Notebooks 

The notebooks illustrate the following sections in the video tutorial.
- 1.1 Core method: the proposer-validator framework
- 1.1 Extension 1: precise explanations.
- 1.1 Extension 2: goal-constrained explanations.
- 1.1 Extension 3: multiple explanations
- 1.2: Explainable clustering

## Related works

```related/references.pdf``` contains the related works mentioned in our presentation. ```related/main.tex``` contains the latex source file and ```references.bib``` contains the bibtex citations.
alarmdecoder 1.13.14
Python interface for the AlarmDecoder (AD2) family of alarm devices which includes the AD2USB, AD2SERIAL and AD2PI.
License: MIT
Keywords: alarmdecoder alarm decoder ad2 ad2usb ad2serial ad2pi security ademco dsc nutech

.. _AlarmDecoder: http://www.alarmdecoder.com
.. _ser2sock: http://github.com/nutechsoftware/ser2sock
.. _pyftdi: https://github.com/eblot/pyftdi
.. _pyusb: http://sourceforge.net/apps/trac/pyusb
.. _pyserial: http://pyserial.sourceforge.net
.. _pyopenssl: https://launchpad.net/pyopenssl
.. _readthedocs: http://alarmdecoder.readthedocs.org
.. _examples: http://github.com/nutechsoftware/alarmdecoder/tree/master/examples

============
AlarmDecoder
============

.. image:: https://img.shields.io/pypi/v/alarmdecoder
    :target: https://pypi.org/project/alarmdecoder/
.. image:: https://img.shields.io/github/actions/workflow/status/nutechsoftware/alarmdecoder/merge.yaml?label=tests
    :target: https://github.com/nutechsoftware/alarmdecoder/actions/workflows/merge.yaml

-------
Summary
-------

This Python library aims to provide a consistent interface for the
`AlarmDecoder`_ product line. (AD2USB, AD2SERIAL and AD2PI).
This also includes devices that have been exposed via `ser2sock`_, which
supports encryption via SSL/TLS.

------------
Installation
------------

AlarmDecoder can be installed through ``pip``::

    pip install alarmdecoder

or from source::

    python setup.py install

* Note: ``python-setuptools`` is required for installation.

------------
Requirements
------------

Required:

* An `AlarmDecoder`_ device
* Python 2.7
* `pyserial`_ >= 2.7

Optional:

* `pyftdi`_ >= 0.9.0
* `pyusb`_ >= 1.0.0b1
* `pyopenssl`_

-------------
Documentation
-------------

API documentation can be found at `readthedocs`_.

--------
Examples
--------

A basic example is included below. Please see the `examples`_ directory for
more.::

    import time
    from alarmdecoder import AlarmDecoder
    from alarmdecoder.devices import SerialDevice

    def main():
        """
        Example application that prints messages from the panel to the terminal.
        """
        try:
            # Retrieve the first USB device
            device = AlarmDecoder(SerialDevice(interface='/dev/ttyUSB0'))

            # Set up an event handler and open the device
            device.on_message += handle_message
            with device.open(baudrate=115200):
                while True:
                    time.sleep(1)

        except Exception as ex:
            print ('Exception:', ex)

    def handle_message(sender, message):
        """
        Handles message events from the AlarmDecoder.
        """
        print sender, message.raw

    if __name__ == '__main__':
        main()
ad-compat-test 1.13.14
Python interface for the AlarmDecoder (AD2) family of alarm devices which includes the AD2USB, AD2SERIAL and AD2PI.
License: MIT
Keywords: alarmdecoder alarm decoder ad2 ad2usb ad2serial ad2pi security ademco dsc nutech

.. _AlarmDecoder: http://www.alarmdecoder.com
.. _ser2sock: http://github.com/nutechsoftware/ser2sock
.. _pyftdi: https://github.com/eblot/pyftdi
.. _pyusb: http://sourceforge.net/apps/trac/pyusb
.. _pyserial: http://pyserial.sourceforge.net
.. _pyopenssl: https://launchpad.net/pyopenssl
.. _readthedocs: http://alarmdecoder.readthedocs.org
.. _examples: http://github.com/nutechsoftware/alarmdecoder/tree/master/examples

============
AlarmDecoder
============

.. image:: https://img.shields.io/pypi/v/alarmdecoder
    :target: https://pypi.org/project/alarmdecoder/
.. image:: https://img.shields.io/github/actions/workflow/status/nutechsoftware/alarmdecoder/merge.yaml?label=tests
    :target: https://github.com/nutechsoftware/alarmdecoder/actions/workflows/merge.yaml

-------
Summary
-------

This Python library aims to provide a consistent interface for the
`AlarmDecoder`_ product line. (AD2USB, AD2SERIAL and AD2PI).
This also includes devices that have been exposed via `ser2sock`_, which
supports encryption via SSL/TLS.

------------
Installation
------------

AlarmDecoder can be installed through ``pip``::

    pip install alarmdecoder

or from source::

    python setup.py install

* Note: ``python-setuptools`` is required for installation.

------------
Requirements
------------

Required:

* An `AlarmDecoder`_ device
* Python 2.7
* `pyserial`_ >= 2.7

Optional:

* `pyftdi`_ >= 0.9.0
* `pyusb`_ >= 1.0.0b1
* `pyopenssl`_

-------------
Documentation
-------------

API documentation can be found at `readthedocs`_.

--------
Examples
--------

A basic example is included below. Please see the `examples`_ directory for
more.::

    import time
    from alarmdecoder import AlarmDecoder
    from alarmdecoder.devices import SerialDevice

    def main():
        """
        Example application that prints messages from the panel to the terminal.
        """
        try:
            # Retrieve the first USB device
            device = AlarmDecoder(SerialDevice(interface='/dev/ttyUSB0'))

            # Set up an event handler and open the device
            device.on_message += handle_message
            with device.open(baudrate=115200):
                while True:
                    time.sleep(1)

        except Exception as ex:
            print ('Exception:', ex)

    def handle_message(sender, message):
        """
        Handles message events from the AlarmDecoder.
        """
        print sender, message.raw

    if __name__ == '__main__':
        main()