Skip to main content

An ML classifier model to make predictions from semi-structured data.

Project description

ORiGAMi - Object Representation through Generative Autoregressive Modelling

Overview

ORiGAMi is a transformer-based Machine Learning model for supervised classification from semi-structured data such as MongoDB documents or JSON files.

Typically, when working with semi-structured data in a Machine Learning context, the data needs to be flattened into a tabular format first. This flattening can be lossy, especially in the presence of arrays and nested objects, and often requires domain expertise to extract meaningful higher-order features from the raw data. This feature extraction step is manual, slow and expensive and doesn't scale well.

ORiGAMi circumvents this by directly operating on JSON data. Once a model is trained, it can be used to make predictions on any field in the dataset.

Installation

ORiGAMi requires Python version 3.10 or higher. We recommend using a virtual environment, such as Python's native venv.

To install ORiGAMi with pip, use

pip install origami-ml

You can also clone the repository to your local machine and install the dependencies manually:

git clone https://github.com/mongodb-labs/origami.git
cd origami
pip install -r requirements.txt
pip install -e .

Usage

ORiGAMi comes with a command line interface (CLI) and a Python SDK.

Usage from the Command Line

The CLI allows to train a model and make predictions from a trained model. After installation, run origami from your shell to see an overview of available commands.

Help for specific commands is available with origami <command> --help, where <command> is currently one of train or predict.

Detailed documentation for the CLI and available options can be found in CLI.md.

Usage with Python

To see an example on how to use ORiGAMi from Python, take a look at the provided ./notebooks folder, e.g. the example_origami_dungeons.ipynb notebook.

Experiment Reproduction

This code is released alongside our paper, which can be found on Arxiv: ORIGAMI: A generative transformer architecture for predictions from semi-structured data. To reproduce the experiments in the paper, see the instructions in the ./experiments/ directory.

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

origami_ml-0.1.3.tar.gz (45.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

origami_ml-0.1.3-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

Details for the file origami_ml-0.1.3.tar.gz.

File metadata

  • Download URL: origami_ml-0.1.3.tar.gz
  • Upload date:
  • Size: 45.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for origami_ml-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0a4afed746dc11b1961606628a14a572fddab1e5f9a649d39575c32608fa7d39
MD5 3d9ef69493640faabf2a517e86e2167b
BLAKE2b-256 f8d1ae57bfbebd5450180af5083f1cf9343af16007d5d63bad5f846512e48aea

See more details on using hashes here.

File details

Details for the file origami_ml-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: origami_ml-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 53.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for origami_ml-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cf302c5791c1b4a6554426116b1b6dc1b440b77cce02a4d456f230de6df74561
MD5 892a50b5ddcefecf5a59e0e7d75c9982
BLAKE2b-256 ac74cd205bd6fa1a11f2fc64607186ef279f92e74e380456bfceb43bf956d58d

See more details on using hashes here.

Supported by

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