semvec/pypi-packages huggingface dataset:
swiftscrub 0.1.2
A framework for anonymizing and scrubbing sensitive data from text.
Requires Python: >=3.9

# SwiftScrub

[![PyPI Latest Release](https://img.shields.io/pypi/v/swiftscrub.svg?logo=python&logoColor=white&color=blue)](https://pypi.org/project/swiftscrub/)
<!-- ![GitHub Page Views Count](https://badges.toozhao.com/badges/01JW9DZB3MAEG11FXQP8EVDRAZ/blue.svg) -->
<!-- [![GitHub Release Date](https://img.shields.io/github/release-date/aether-raid/swiftscrub?logo=github&label=latest%20release&color=blue)](https://github.com/aether-raid/swiftscrub/releases/latest) -->
<!-- ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/aether-raid/swiftscrub/docs.yml?label=PyPI%20Publish&color=blue) -->
genbooster 0.6.8
A fast boosting implementation using Rust and Python
Requires Python: >=3.7

# Genbooster

A gradient boosting and bagging (RandomBagClassifier, similar to RandomForestClassifier) implementation using Rust and Python. Any base learner can be employed. Base learners input features are engineered using a randomized artificial neural network layer.

For more details, see also [https://www.researchgate.net/publication/386212136_Scalable_Gradient_Boosting_using_Randomized_Neural_Networks](https://www.researchgate.net/publication/386212136_Scalable_Gradient_Boosting_using_Randomized_Neural_Networks).

![PyPI](https://img.shields.io/pypi/v/genbooster) 
[![Downloads](https://pepy.tech/badge/genbooster)](https://pepy.tech/project/genbooster) 
[![Documentation](https://img.shields.io/badge/documentation-is_here-green)](https://techtonique.github.io/genbooster/)

## 1 - Installation

From PyPI:
```bash
pip install genbooster
```
From GitHub:
```bash
pip install git+https://github.com/Techtonique/genbooster.git
```

It might be required to install Rust and Cargo first (**normally, it isn't, and you can skip this step**): 

Command line:
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
```

Python:
```python
import os
os.environ['PATH'] = f"/root/.cargo/bin:{os.environ['PATH']}"
```

Command line:
```bash
echo $PATH
rustc --version
cargo --version
```

## 2 - Usage

### 2.1 - Boosting

```python
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.utils.discovery import all_estimators
from sklearn.datasets import load_iris, load_breast_cancer, load_wine
from sklearn.linear_model import Ridge, RidgeCV
from sklearn.tree import ExtraTreeRegressor
from sklearn.model_selection import train_test_split
from genbooster.genboosterclassifier import BoosterClassifier
from genbooster.randombagclassifier import RandomBagClassifier

X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
clf = BoosterClassifier(base_estimator=ExtraTreeRegressor())
clf.fit(X_train, y_train)
preds = clf.predict(X_test)
print(np.mean(preds == y_test))
```

### 2.2 - Bagging (RandomBagClassifier, similar to RandomForestClassifier)

```python
clf = RandomBagClassifier(base_estimator=ExtraTreeRegressor())
clf.fit(X_train, y_train)
preds = clf.predict(X_test)
print(np.mean(preds == y_test))
```
pdf-downloads 0.1.0
A simple library to download pdf files from the web by scraping.
Requires Python: >=3.12

# ai_environment
Configurator for a Python AI environment for SupportVectors AI training labs

1. `git clone` the repo to a folder of your choice
2. For a new uv project that you want to create, follow the below steps:
   
   ```shell
    uv init <my_project> --python=3.12
    cd <my_project>
    cp <my_path>/ai_environment/ensure_config.sh ./
    cp <my_path>/ai_environment/docs.tgz ./
    chmod +x ./ensure_config.sh
    ./ensure_config.sh ## Enter the appropriate path, project, description, url when prompted during the run of ensure_config.sh
   ```
3. Your project setup for `<my_project>` is now complete.
4. Note that these steps are needed only when you create a completely new UV based python project using the best practices recommended by SupportVectors.  If you are downloading an existing code repo uploaded by the SupportVectors team, you would just have to download the code repo and follow the steps as given in the project guide within the repo.
jp-range 0.4.2
Utilities for parsing Japanese numeric ranges.
Requires Python: >=3.12

# jp-range

jp-range is a small library for parsing Japanese numeric range expressions. It returns an `Interval` object implemented with [Pydantic](https://docs.pydantic.dev/) or ``None`` when parsing fails.

## Installation

```bash
pip install jp-range
# or install from GitHub
pip install git+https://github.com/first-automation/jp-range.git
```

Python 3.12 or later is required.

## Features

- Normalizes full width numbers and common punctuation
- Supports inclusive and exclusive bounds (`以上`, `未満`, etc.)
- Parses connectors such as `〜`, `-` and `から`
- Handles single-sided bounds, approximate expressions (`90前後`) and `A±d` notation
- Integrates with pandas via `apply_parse` for `Series` and `DataFrame`

## Usage

### Basic parsing

```python
from jp_range import parse

interval = parse("40以上50未満")
print(interval)               # [40, 50)
print(interval.contains(45))  # True
```

### Pandas integration

```python
from pandas import Series
from jp_range import apply_parse

# Convert Series of textual ranges to pandas.Interval
s = Series(["20～30", "50超", "未満100"])
result = apply_parse(s)
# result:
# 0     [20.0, 30.0]
# 1      (50.0, inf)
# 2    (-inf, 100.0)
# dtype: object

# Expand columns into numeric min/max
df = apply_parse(s.to_frame(name="range"), split_numeric=True)
# df:
#    range_max  range_min
# 0       30.0       20.0
# 1        NaN       50.0
# 2      100.0        NaN
```

### Supported expressions

- `"20から30"` – inclusive 20 to 30
- `"20〜30"` – inclusive 20 to 30 using a tilde connector
- `"30以上40以下"` – inclusive 30 to 40
- `"40以上50未満"` – 40 to under 50
- `"70超90以下"` – greater than 70 and up to 90
- `"50より上"` – greater than 50
- `"60より下"` – less than 60
- `"90前後"` – roughly around 90 (5% margin)
- `"(2,3]"` – standard interval notation

`parse_jp_range` returns ``None`` if the expression cannot be parsed.
NLPX 2.0.6
A tool set for NLP. Text classification. Trainer. Tokenizer
Requires Python: >=3.6
Keywords: NLP, nlp, AI, llm, GPT, Machine learning, Deep learning, tokenize, torch

Usage Sample
''''''''''''

.. code:: python

        import torch
        from sklearn.model_selection import train_test_split
        from nlpx.tokenize import Tokenizer
        from nlpx.model.classifier import TextCNNClassifier
        from nlpx.model.wrapper import ClassifyModelWrapper
        from nlpx.dataset import TokenDataset, PaddingTokenCollator

        if __name__ == '__main__':
            classes = ['class1', 'class2', 'class3'...]
            texts = [[str],]
            labels = [0, 0, 1, 2, 1...]
            tokenizer = Tokenizer.from_texts(texts, min_freq=5)
            sent = 'I love you'
            tokens = tokenizer.encode(sent, max_length=6)
            # [101, 66, 88, 99, 102, 0]
            sent = tokenizer.decode(tokens)
            # ['<BOS>', 'I', 'love', 'you', '<EOS>', '<PAD>']

            tokens = tokenizer.batch_encode(texts, padding=False)
            X_train, X_test, y_train, y_test = train_test_split(tokens, labels, test_size=0.2)
            train_set = TokenDataset(X_train, y_train)
            val_set = TokenDataset(X_test, y_test)

            model = TextCNNClassifier(embed_dim=128, vocab_size=tokenizer.vocab_size, num_classes=len(classes))
            model_wrapper = ClassifyModelWrapper(model, classes=classes)
            model_wrapper.train(train_set, val_set, show_progress=True, collate_fn=PaddingTokenCollator(tokenizer.pad))

            result = model_wrapper.evaluate(val_set, collate_fn=PaddingTokenCollator(tokenizer.pad))
            # 0.953125

            test_inputs = torch.tensor(test_tokens, dtype=torch.long)
            result = model_wrapper.predict(test_inputs)
            # [0, 1]

            result = model_wrapper.predict_classes(test_inputs)
            # ['class1', 'class2']

            result = model_wrapper.predict_proba(test_inputs)
            # ([0, 1], array([0.99439645, 0.99190724], dtype=float32))

            result = model_wrapper.predict_classes_proba(test_inputs)
            # (['class1', 'class2'], array([0.99439645, 0.99190724], dtype=float32))
CVX2 0.6.0
Tools of CV(Computer Vision)
Requires Python: >=3.6
Keywords: CV, Computer Vision, Machine learning, Deep learning, torch

Usage Sample
''''''''''''

.. code:: python

        from torch import nn
        from cvx2 import WidthBlock
        from cvx2.wrapper import ImageClassifyModelWrapper

        model = nn.Sequential(
            WidthBlock(c1=1, c2=32),
            nn.MaxPool2d(kernel_size=2, stride=2),
            WidthBlock(c1=32, c2=64),
            nn.MaxPool2d(kernel_size=2, stride=2),
            nn.Flatten(),
            nn.Linear(in_features=64*49, out_features=1024),
            nn.Dropout(0.2),
            nn.SiLU(inplace=True),
            nn.Linear(in_features=1024, out_features=2),
        )

        data_dir
         |__train
         |   |__class1
         |   |   |__001.jpg
         |   |   |__002.jpg
         |   |__class2
         |      |__001.jpg
         |      |__002.jpg
         |__test
         |   |__class1
         |   |   |__001.jpg
         |   |   |__002.jpg
         |   |__class2
         |      |__001.jpg
         |      |__002.jpg
         |__val
             |__class1
             |   |__001.jpg
             |   |__002.jpg
             |__class2
                |__001.jpg
                |__002.jpg

        model_wrapper = ImageClassifyModelWrapper(model)
        model_wrapper.train(data='data_dir', imgsz=28)
        result = model_wrapper.predict('data_dir/test/class1/001.jpg', imgsz=28)