Metadata-Version: 2.4
Name: aks-shannon-entropy
Version: 0.1.0
Summary: Compute shannon entropy from LLM responses to detect hallucinations
Author: Semantic Uncertainty Authors
License: MIT
Project-URL: Homepage, https://github.com/your-org/shannon-entropy
Project-URL: Repository, https://github.com/your-org/shannon-entropy
Project-URL: Issues, https://github.com/your-org/shannon-entropy/issues
Keywords: llm,uncertainty,shannon-entropy,hallucination,natural-language-generation,nlp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.0
Requires-Dist: transformers>=4.31
Requires-Dist: numpy
Requires-Dist: sentencepiece
Requires-Dist: tiktoken
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == "openai"
Requires-Dist: tenacity; extra == "openai"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# Shannon Entropy

Compute Shannon entropy from LLM responses to detect hallucinations and measure uncertainty in natural language generation.

## Installation

```bash
pip install aks-shannon-entropy
```

## Features

- **Shannon Entropy Computation**: Calculate entropy from LLM response distributions
- **Hallucination Detection**: Identify unreliable or hallucinated model outputs
- **Uncertainty Quantification**: Measure model confidence and uncertainty
- **LLM Integration**: Works with HuggingFace transformers and other LLM frameworks

## Usage

```python
from shannon_entropy import compute_entropy

responses = ["response1", "response2", "response3"]
entropy = compute_entropy(responses)
print(f"Entropy: {entropy}")
```

## Dependencies

See pyproject.toml for full dependencies.

## License

MIT - See LICENSE file for details.

