semvec/pypi-packages huggingface dataset:
Lazy-k 0.1.4
A C++ implementation of the Lazy-k algorithm (A* with partial expansion)
Requires Python: >=3.8

![main](https://github.com/ahemmershift/lazyk/actions/workflows/python.yml/badge.svg)
# lazyk
A C++/Python library for efficiently iterating over high-probability label-assignments.

## Installation
You know the drill
```bash
pip install lazy-k
```

## Usage
The library can be used to iterate over the high-probability label-assignments of a given probability matrix. The following example shows how to use the library to iterate over the high-probability label-assignments of a 3x3 probability matrix.

```python
from lazyk import lazyk
import numpy as np

probs = np.arange(1, 10).reshape(3, -1)
probs = probs / probs.sum(axis=1, keepdims=True)

for seq in lazyk(probs, cache_assignments=True): # cache_assignments is true by default, but can be turned off for lower memory usage but might be slower
    print(seq)
```

The `cache_assignments` parameter indicates whether the algorithm should cache the intermediate label-assignments. This will improve the running speed of the algorithm but also require more memory. The default value is `True` but can be turned off if memory is a concern.

More information can be found in the [paper](https://aclanthology.org/2023.emnlp-main.416/) "Lazy-k Decoding: Constrained Decoding for Information Extraction".
cpelib 0.2.0
A Python package for parsing, representing, and filtering the NVD CPE Dictionary.
Requires Python: >=3.9
Keywords: package, nvd, cpe

# cpelib
A Python package for parsing, representing, and filtering the NVD CPE Dictionary.


## Installation
```bash
pip install cpelib
```

## Setup
Before using the package, you need to download the NVD CPE Dictionary V2.3.
You can download the latest version from the NVD website: https://nvd.nist.gov/products/cpe

After downloading the file (e.g., `official-cpe-dictionary_v2.3.xml`), you can use the `cpelib` package to parse the 
file.

By default, the package looks for the file in the `~/.cpelib` directory.

```bash
mkdir ~/.cpelib
mv official-cpe-dictionary_v2.3.xml ~/.cpelib
```

Or, you can programmatically change the path by providing the path to the file in the `CPEDictionaryLoader` class.

```python
from cpelib.core.loader import CPEDictionaryLoader

loader = CPEDictionaryLoader(xml_file="path/to/official-cpe-dictionary_v2.3.xml")
```

## Usage
 
> [NOTE] It will take around 2 minutes to parse the entire XML file which contains over 1,341,950 CPE items.
> Also, makes sure you have enough memory to load the entire dictionary (16GB should be safe).

Use class CPEDictionaryLoader to define and initialize the loader, then call the loader to parse the XML file.
The loader will return a dictionary with the cpe-item entries.

```python
from cpelib.core.loader import CPEDictionaryLoader

loader = CPEDictionaryLoader()
cpe_dict = loader()
```

Additionally, you can explore the examples in the `examples` directory and run them using the following command:

```bash
python3 -m examples.load_cpe_dict
```