Metadata-Version: 2.4
Name: boostedprob
Version: 0.1.0
Summary: Utilities to compute boosted probabilities and identify dominant tokens.
Author-email: Tu Anh Dinh <dinhtuanh23@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/TuAnh23/BoostedProb
Project-URL: Repository, https://github.com/TuAnh23/BoostedProb
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.0.1
Dynamic: license-file

# boostedprob

Utilities to compute "dominant tokens" and derive boosted probabilities from model log-probabilities.

## Install

- Locally (development editable install):

```bash
python -m pip install -e .
````

* From GitHub (example):

```bash
python -m pip install "git+https://github.com/yourusername/boostedprob.git"
```

## Example

```python
import torch
import boostedprob

# log_probs: shape [batch, seq_len, vocab]
# target: shape [batch, seq_len]
# (fill with your model outputs)

log_probs = torch.log_softmax(torch.randn(2, 4, 1000), dim=-1)
target = torch.randint(0, 1000, (2, 4))

scores = boostedprob.calculate_boostedprob(log_probs, target)
print(scores.shape)  # -> (2, 4)
```

## Build & publish

```bash
python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*
```

Or test first on TestPyPI (recommended).
