Metadata-Version: 2.1
Name: akali
Version: 0.3.1b0
Summary: AKALI library for language model augmentation and interfaces
Home-page: https://github.com/alierenak/akali
Author: Ali Eren Ak
Author-email: akali@sabanciuniv.edu
License: Proprietary
Keywords: NLP,language models,data augmentation,AI
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: fastapi
Requires-Dist: uvicorn
Requires-Dist: pydantic
Requires-Dist: transformers<5.0.0,>=4.43.1
Requires-Dist: torch
Requires-Dist: accelerate
Requires-Dist: bitsandbytes>=0.39.0
Requires-Dist: nest-asyncio
Requires-Dist: click
Requires-Dist: pandas
Requires-Dist: matplotlib
Provides-Extra: dev
Requires-Dist: pytest<7.0.0,>=6.2.5; extra == "dev"
Requires-Dist: pytest-cov<3.0.0,>=2.12.1; extra == "dev"
Requires-Dist: mypy<1.0.0,>=0.910; extra == "dev"

# AKALI: Aggressive Knowledge Augmenter and Language Interface

<p align="center">
  <img src="assets/logo.jpg" alt="AKALI Logo" width="512"/>
</p>

AKALI is a powerful library for language model augmentation and interfaces, designed to enhance the capabilities of AI models through strategic data augmentation and efficient task management.

## Features

- **Language Interface**: Easily integrate and interact with various language models.
- **Knowledge Augmentation**: Improve model performance through intelligent data augmentation strategies.
- **Task Management**: Flexible system for handling different NLP tasks.
- **CLI Tool**: Command-line interface for easy usage and integration.
- **Customizable**: Extend functionality with custom tasks and augmentation strategies.

## Installation

```bash
pip install akali
```

## Quick Start
Using the CLI tool
Run a language interface service directly
```bash
akali run --model alierenak/gemma-7b-akali --task EntitySentimentReasoner --host 0.0.0.0 --port 8000
```

Make a prediction
```bash
akali predict --model alierenak/gemma-7b-akali --task EntitySentimentReasoner --user-message "Turkcell hiç güzel çeken bir hat değil o yüzden Vodofone'u tercih ediyorum hem de daha ucuz"
```

Using as a Python Library
```python
from akali import LanguageInterface
li = LanguageInterface.load_model("alierenak/gemma-7b-akali")

# Set the task
li.set_task("EntitySentimentReasoner")

# Make a prediction
result = li.predict(system_text=None, user_message="Turkcell hiç güzel çeken bir hat değil o yüzden Vodofone'u tercih ediyorum hem de daha ucuz")
print(result)
```
# Advanced Usage

## Custom Task Creation
```python
from akali import LanguageInterface
from pydantic import BaseModel
from typing import List, Dict, Any

class CustomOutput(BaseModel):
    entity_list: List[str]
    results: List[Dict[str, str]]

def custom_processor(result: str) -> Dict[str, Any]:
    # Your custom processing logic here
    pass

li = LanguageInterface.load_model("your_model_id")
li.set_custom_task("CustomTask", custom_processor, CustomOutput)
```
## Knowledge Augmentation

```python
from akali import LanguageInterface, AggressiveKnowledgeAugmenter, AugmenterConfig

mentee = LanguageInterface.load_model("mentee_model_path")
mentor = LanguageInterface.load_model("mentor_model_path")

config = AugmenterConfig(
    # Configure your augmentation settings
)

augmenter = AggressiveKnowledgeAugmenter(mentee, mentor, "EntitySentimentReasoner", config)

# Evaluate current performance
augmenter.evaluate(test_data)

# Propose augmentation strategies
strategies = augmenter.propose()

# Augment the data
augmented_data = augmenter.augment(train_data)
```

## Project Structure

```
akali/
│
├── src/
│   └── akali/
│       ├── __init__.py
│       ├── aka.py
│       ├── li.py
│       ├── utils.py
│       ├── task_manager.py
│       ├── models/
│       ├── processors/
│       └── ...
│
├── examples/
├── tests/
├── .gitignore
├── pyproject.toml
├── README.md
├── requirements.txt
└── setup.py
```
## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is proprietary and confidential. Unauthorized copying, transferring or reproduction of this project, via any medium, is strictly prohibited.

## Contact

For licensing inquiries, support or anything, here is my contact mail: akali@sabanciuniv.edu.





