This library includes an extensible system for building various trajectory operations.
Project description
KafyTraj [KAFY] Library
The KafyTraj, KAFY for short, library provides an extensible system for various trajectory operations and includes a versatile command-line interface (CLI) for managing these operations using SQL-like commands. It functions as a toolkit for researchers, facilitating the construction, management, and execution of diverse trajectory operations.
The Meaning Behind the Name “KAFYTraj”
- KAFY: means sufficient in Arabic.
- Traj: Short for “Trajectory,” emphasizing the library’s focus on trajectory data processing and analysis.
Features
- Extensible System: Designed to accommodate various trajectory operations with flexibility and ease.
- User-Friendly: Simplifies the construction and management of trajectory operations, making it accessible to researchers.
- SQL-like Command Interface: Allows users to execute trajectory operations through intuitive, SQL-like commands.
Installation
You can install the KAFY library using pip:
$pip install KAFYTraj --upgrade
Starting A New Project
Before starting, you need to start a new project and define the project location where all project-related data will be saved. This includes directories like modelsRepo, TrajectoryStore, etc. By default, the project location is set to /home/KafyProject/
If you wish to change the project location permanently, follow these steps:
Step-by-Step Guide to Setting Project Location in bash
-
Open your terminal.
-
Execute the following command:
$ kafy start new project `location`
where location is the desired location of the project. A new project will be created at this location, and required project files/directories will be initialized. If a project already exists at this place, nothing will happen.
If no project location is specified, the project will deafault to /home/KafyProject/.
SQL-like Command Interface [CLI Based]
To use the SQL-like command interface, you can execute commands directly from the terminal. The CLI allows you to perform operations such as pretraining, fine-tuning, and summarizing data.
The librarys is pre-installed into your terminal when you run pip install KAFYTraj for the first time.
There are three main stages of using KAFY.
- PreTraining
- FineTuning
- Excution
Pretraining:
In this stage the researcher can: Note: All commands are case insensitive.
- Add a New Dataset for Pretraining.
You can add a new dataset to the TrajectoryStore to be used for pretraining with all current and future models.
```bash
$kafy ADD DATA FROM data_source.csv
```
Example:
```
$kafy ADD DATA FROM 'pretraining_data.csv'
```
- Add a New Model or Modify Model Configurations
Use available models from HuggingFace’s (HF) Transformers repository by specifying custom configurations.
```bash
$kafy ADD MODEL transformer_family FROM HF USING model_config_file.json AS model_name_to_be_saved_as
```
Example:
To add a bert-large model using its configurations:
```bash
$kafy ADD MODEL bert FROM HF USING bert_large_configs.json AS bert_large
```
The bert_large model will be added to the TransformersPlugin and will be pretrained on all available pretraining datasets in the TrajectoryStore.
- Add a Custom Model [Not Implemented For Now]
If the model is not available in HuggingFace, you can define your own. Important Note: Custom models should follow the same structure as HuggingFace models. Refer to the examples in the repository for guidance.
```bash
$kafy ADD MODEL transformer_family FROM model_source USING model_config_file.json AS model_name_to_be_saved_as
```
Example:
To add a model from a custom model definition:
```bash
$kafy ADD MODEL new_family FROM new_model.py USING new_model_configs.json AS new_model
```
The new_model model will be added to the TransformersPlugin and will be pretrained on all available pretraining datasets in the TrajectoryStore.
Fine-Tune a Model [Not Implemented For Now]:
```bash
$kafy FINETUNE bert FOR summarization USING my_pretrained_model.pkl WITH finetune_config.json AS my_finetuned_model.pkl
```
Summarize Data [Not Implemented For Now]:
```bash
$kafy SUMMARIZE FROM requested_data_to_summarize.csv USING my_finetuned_model.pkl
```
Extended Usage
To use the library, import the TrajectoryPipeline class from KAFY:
from KAFY import TrajectoryPipeline
# Initialize the pipeline
my_pipeline = TrajectoryPipeline(
mode="pretraining",
operation_type="generation",
use_tokenization=True,
use_detokenization=True,
use_spatial_constraints=True,
modify_spatial_constraints=True,
use_predefined_spatial_constraints=True,
project_path="/content/"
)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any questions or support, please contact husse408@umn.edu.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file KAFYTraj-0.2.5-py3-none-any.whl.
File metadata
- Download URL: KAFYTraj-0.2.5-py3-none-any.whl
- Upload date:
- Size: 15.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
122523bb9e820fc1c64b00ff9e63cd7cb177a4489c3bcd2ee29a6401a23a743e
|
|
| MD5 |
e9830cc2bc9dcbab1dca6109a1e4797a
|
|
| BLAKE2b-256 |
6a1c8e7796db2e1c0d0d8ebd5512873c53695e1277d89d998a3786f0a372e563
|