From 0a33546aa9bbf7e19c8b2a074ade0584da749ac5 Mon Sep 17 00:00:00 2001
From: Santi Adavani
- Train and deploy models to make online predictions using only SQL, with an open source extension for Postgres. Manage your projects and visualize datasets using the built-in dashboard. -
- +## Table of contents +- [Introduction](#introduction) +- [Installation](#installation) +- [Getting started](#getting-started) +- [Natural Language Processing](#nlp-tasks) +- [Regression](#regression) +- [Classification](#classification) -The dashboard makes it easy to compare different algorithms or hyperparameters across models and datasets. +## Introduction +PostgresML is a PostgreSQL extension that enables you to perform ML training and inference on text and tabular data using SQL queries. With PostgresML, you can seamlessly integrate machine learning models into your PostgreSQL database and harness the power of cutting-edge algorithms to process text and tabular data efficiently. -[](https://cloud.postgresml.org/) +### Text Data +- Perform natural language processing (NLP) tasks like sentiment analysis, question and answering, translation, summarization and text generation +- Access 1000s of state-of-the-art language models like GPT-2, GPT-J, GPT-Neo from :hugging_face: HuggingFace model hub +- Fine tune large language models (LLMs) on your own text data for different tasks -| SQL Query | +Result | +
| + +```sql +SELECT pgml.transform( + 'translation_en_to_fr', + inputs => ARRAY[ + 'Welcome to the future!', + 'Where have you been all this time?' + ] +) AS french; +``` + | ++ +```sql + french +------------------------------------------------------------ + +[ + {"translation_text": "Bienvenue à l'avenir!"}, + {"translation_text": "Où êtes-vous allé tout ce temps?"} +] +``` + | +
| SQL Query | +Result | +
| + +```sql +SELECT pgml.transform( + + '{"model": "roberta-large-mnli"}'::JSONB, + inputs => ARRAY + [ + 'I love how amazingly simple ML has become!', + 'I hate doing mundane and thankless tasks. ☹️' + ] + +) AS positivity; +``` + | ++ +```sql + positivity +------------------------------------------------------ +[ + {"label": "NEUTRAL", "score": 0.8143417835235596}, + {"label": "NEUTRAL", "score": 0.7637073993682861} +] +``` + | +
| Training | +Inference | +
| + + +```sql +SELECT * FROM pgml.train( + 'Handwritten Digit Image Classifier', + algorithm => 'xgboost', + 'classification', + 'pgml.digits', + 'target' +); +``` + + | ++ +```sql +SELECT pgml.predict( + 'My Classification Project', + ARRAY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