Skip to main content

AKALI library for language model augmentation and interfaces

Project description

AKALI: Aggressive Knowledge Augmenter and Language Interface

AKALI Logo

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

pip install akali

Quick Start

Using the CLI tool Run a language interface service directly

akali run --model alierenak/gemma-7b-akali --task EntitySentimentReasoner --host 0.0.0.0 --port 8000

Make a prediction

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

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

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

akali-0.3.1b0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

akali-0.3.1b0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file akali-0.3.1b0.tar.gz.

File metadata

  • Download URL: akali-0.3.1b0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for akali-0.3.1b0.tar.gz
Algorithm Hash digest
SHA256 c961fdb501aba8bf95659b446c1a483c8145d8ed56d38a5a64dfeb99699dd36c
MD5 595c4c0d9dc2300d3fe009c574aba522
BLAKE2b-256 836dd2b316fecf620d58247474c7e0a782387e096d9a42d5a98db5e33b4abb80

See more details on using hashes here.

File details

Details for the file akali-0.3.1b0-py3-none-any.whl.

File metadata

  • Download URL: akali-0.3.1b0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for akali-0.3.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 69e5b125d51b219910141f805f85d169e8156cde946173d5b40ebd0e509c6305
MD5 65344298147ee9027bf8b386cede931f
BLAKE2b-256 a77258708d1a5f2e869e3e641082305e3635b8358835caa2863ed2cd46d63c01

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page