diff --git a/README.md b/README.md
index 9adfbe5bd..5afd973e4 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,7 @@
@@ -212,6 +227,9 @@ EvaDB enables software developers to build AI apps in a few lines of code. Its p
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
- [Quick Links](#quick-links)
- [Documentation](#documentation)
- [Why EvaDB](#why-evadb)
@@ -225,6 +243,7 @@ EvaDB enables software developers to build AI apps in a few lines of code. Its p
- [Star History](#star-history)
- [License](#license)
=======
+<<<<<<< HEAD
=======
- [Quick Links](#quick-links)
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
@@ -239,6 +258,14 @@ EvaDB enables software developers to build AI apps in a few lines of code. Its p
- [Contributing](#contributing)
- [Star History](#star-history)
- [License](#license)
+=======
+- [Documentation](#documentation)
+- [Why EvaDB](#why-evadb)
+- [How does EvaDB work](#how-does-evadb-work)
+- [Community and Support](#community-and-support)
+- [Illustrative Queries](#illustrative-queries)
+- [Illustrative Apps](#illustrative-apps)
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
## Documentation
@@ -379,6 +406,73 @@ SELECT name FROM reddit_dataset ORDER BY
## Illustrative Apps
+Here are some illustrative AI apps built using EvaDB (each notebook can be opened on Google Colab):
+
+ * 🔮 PrivateGPT
+ * 🔮 ChatGPT-based Video Question Answering
+ * 🔮 Querying PDF Documents
+ * 🔮 Analysing Traffic Flow with YOLO
+ * 🔮 Examining Emotions of Movie
+ * 🔮 Image Segmentation with Hugging Face
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+
+
+<<<<<<< HEAD
+You can find the complete documentation of EvaDB at [evadb.ai/docs](https://evadb.ai/docs/) 📚✨🚀
+
+## Why EvaDB
+
+In the world of AI, we've reached a stage where many AI tasks that were traditionally handled by AI or ML engineers can now be automated. EvaDB enables software developers with the ability to perform advanced AI tasks without needing to delve into the intricate details.
+
+EvaDB covers many AI applications, including regression, classification, image recognition, question answering, and many other generative AI applications. EvaDB targets 99% of AI problems that are often repetitive and can be automated with a simple function call in an SQL query. Until now, there is no comprehensive open-source framework for bringing AI into an existing SQL database system with a principled AI optimization framework, and that's where EvaDB comes in.
+
+Our target audience is software developers who may not necessarily have a background in AI but require AI capabilities to solve specific problems. We target programmers who write simple SQL queries inside their CRUD apps. With EvaDB, it is possible to easily add AI features to these apps by calling built-in AI functions in the queries.
+
+## How does EvaDB work
+
+
+
+
Connect EvaDB to your database system with the `CREATE DATABASE` statement.
+
Write SQL queries with AI functions to get inference results:
+
+
Pick a pre-trained AI model from Hugging Face, Open AI, Ultralytics, PyTorch, and built-in AI frameworks for generative AI, NLP, and vision applications;
+
or pick from a variety of state-of-the-art ML engines for classic ML use-cases (classification, regression, etc.);
+
or bring your custom model built with any AI/ML framework using `CREATE FUNCTION`.
+
+
+
+Follow the [getting started](https://evadb.readthedocs.io/en/stable/source/overview/getting-started.html) guide to get on-boarded as fast as possible.
+
+
+## Illustrative Queries
+
+* Run the MNIST Image Classification model to obtain digit labels for each frame in the video.
+
+```sql
+SELECT MnistImageClassifier(data).label FROM mnist_video;
+```
+
+* Build a vector index on the feature embeddings returned by the SIFT Feature Extractor on a collection of Reddit images.
+
+```sql
+CREATE INDEX reddit_sift_image_index
+ ON reddit_dataset (SiftFeatureExtractor(data))
+ USING FAISS
+```
+
+* Retrieve the top-5 most similar images for the given image using the index.
+
+```sql
+SELECT name FROM reddit_dataset ORDER BY
+ Similarity(
+ SiftFeatureExtractor(Open('reddit-images/g1074_d4mxztt.jpg')),
+ SiftFeatureExtractor(data)
+ )
+ LIMIT 5
+```
+
+## Illustrative Apps
+
Here are some illustrative AI apps built using EvaDB (each notebook can be opened on Google Colab):
* 🔮 Sentiment Analysis using LLM within PostgreSQL
@@ -427,15 +521,28 @@ EvaDB's AI-centric query optimizer takes a query as input and generates a query
+<<<<<<< HEAD
* Get a transcript from a video stored in a table using a Speech Recognition model. Then, ask questions on the extracted transcript using ChatGPT.
+=======
+* Store the text returned by a Speech Recognition model on the audio component of a video in a table.
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
```sql
CREATE TABLE text_summary AS
SELECT SpeechRecognizer(audio) FROM ukraine_video;
+<<<<<<< HEAD
+=======
+```
+
+* Run ChatGPT on the `text` column in a table.
+
+```sql
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
SELECT ChatGPT('Is this video summary related to Ukraine russia war', text)
FROM text_summary;
```
+<<<<<<< HEAD
* Train a classic ML model for prediction using the Ludwig AI engine.
```sql
@@ -444,6 +551,16 @@ CREATE FUNCTION IF NOT EXISTS PredictHouseRent FROM
TYPE Ludwig
PREDICT 'rental_price'
TIME_LIMIT 120;
+=======
+* Train an ML model using the Ludwig AI engine to predict a column in a table.
+
+```sql
+CREATE UDF IF NOT EXISTS PredictHouseRent FROM
+( SELECT * FROM HomeRentals )
+TYPE Ludwig
+'predict' 'rental_price'
+'time_limit' 120;
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
```
@@ -453,7 +570,11 @@ TIME_LIMIT 120;
EvaDB's AI-centric query optimizer takes a query as input and generates a query plan. The query engine takes the query plan and hits the relevant backends to efficiently process the query:
1. SQL Database Systems (Structured Data)
+<<<<<<< HEAD
2. AI Frameworks (Transform Unstructured Data to Structured Data; Unstructured data includes PDFs, text, images, etc. stored locally or on the cloud)
+=======
+2. AI Frameworks (Transform Unstructured Data to Structured Data, Unstructured data includes PDFs, images, podcasts, etc. stored on cloud buckets or local filesystem)
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
3. Vector Database Systems (Feature Embeddings)
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
diff --git a/docs/_toc.yml b/docs/_toc.yml
index 252e3282b..974bad27b 100644
--- a/docs/_toc.yml
+++ b/docs/_toc.yml
@@ -39,6 +39,7 @@ parts:
=======
- file: source/overview/connect-to-database
title: Connect to Database
+<<<<<<< HEAD
- file: source/overview/model-inference
title: Model inference
- file: source/overview/concepts
@@ -46,10 +47,15 @@ parts:
sections:
- file: source/overview/concepts/data-sources
title: Data Sources
+=======
+ - file: source/overview/concepts
+ title: Concepts
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
#- file: source/overview/faq
- caption: Use Cases
chapters:
+<<<<<<< HEAD
- file: source/usecases/sentiment-analysis.rst
title: Sentiment Analysis
- file: source/usecases/question-answering.rst
@@ -75,7 +81,32 @@ parts:
title: Home Rental Prediction
# - file: source/usecases/privategpt.rst
# title: PrivateGPT
+<<<<<<< HEAD
>>>>>>> 40a10ce1 (Bump v0.3.4+ dev)
+=======
+=======
+ - file: source/usecases/food-review.rst
+ title: Sentiment Analysis
+ - file: source/usecases/image-classification.rst
+ title: Image Classification
+ - file: source/usecases/similar-image-search.rst
+ title: Image Search
+ - file: source/usecases/qa-video.rst
+ title: Video Question Answering
+ - file: source/usecases/08-chatgpt.ipynb
+ title: ChatGPT-based Video Question Answering
+ - file: source/usecases/12-query-pdf.ipynb
+ title: PDF Question Answering
+ - file: source/usecases/02-object-detection.ipynb
+ title: Object Detection
+ - file: source/usecases/03-emotion-analysis.ipynb
+ title: Emotions Analysis
+ - file: source/usecases/07-object-segmentation-huggingface.ipynb
+ title: Image Segmentation
+ - file: source/usecases/13-privategpt.ipynb
+ title: PrivateGPT
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
- caption: User Reference
chapters:
@@ -121,6 +152,16 @@ parts:
- file: source/reference/evaql/delete
- file: source/reference/evaql/rename
- file: source/reference/evaql/use
+<<<<<<< HEAD
+=======
+
+ - file: source/reference/databases/index
+ title: Data Sources
+ sections:
+ - file: source/reference/databases/postgres
+ - file: source/reference/databases/sqlite
+ - file: source/reference/databases/mysql
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
<<<<<<< HEAD
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
diff --git a/docs/conf.py b/docs/conf.py
index d3823a1c8..4a2fb30f6 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -96,10 +96,15 @@
# directories to ignore when looking for source files.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "README.md", "images/reference/README.md"]
<<<<<<< HEAD
+<<<<<<< HEAD
=======
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
+=======
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "github-dark"
@@ -178,6 +183,25 @@
nitpick_ignore_regex = [('py:class', r'.*')]
<<<<<<< HEAD
=======
+<<<<<<< HEAD
+=======
+
+
+for i in os.listdir("../tutorials"):
+ if i in [
+ "13-privategpt.ipynb",
+ "08-chatgpt.ipynb",
+ "12-query-pdf.ipynb",
+ "02-object-detection.ipynb",
+ "03-emotion-analysis.ipynb",
+ "07-object-segmentation-huggingface.ipynb",
+ "chatgpt.png",
+ ]:
+ shutil.copy(f"../tutorials/{i}", "./source/usecases/")
+
+nb_execution_mode = "off"
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
<<<<<<< HEAD
@@ -209,11 +233,17 @@ def setup(app):
app.add_js_file("js/top-navigation.js", defer="defer")
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
app.add_js_file("https://cdn.jsdelivr.net/npm/@docsearch/js@3.3.3/dist/umd/index.js",defer="defer")
app.add_js_file("js/algolia.js",defer="defer")
=======
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
app.add_js_file("https://cdn.jsdelivr.net/npm/@docsearch/js@3.3.3/dist/umd/index.js",defer="defer")
app.add_js_file("js/algolia.js",defer="defer")
>>>>>>> 40a10ce1 (Bump v0.3.4+ dev)
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
diff --git a/docs/source/benchmarks/text_summarization.rst b/docs/source/benchmarks/text_summarization.rst
index 052afdacf..1cf1bc223 100644
--- a/docs/source/benchmarks/text_summarization.rst
+++ b/docs/source/benchmarks/text_summarization.rst
@@ -1,5 +1,8 @@
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Text Summarization Benchmark
============================
@@ -13,6 +16,7 @@ Prepare dataset
---------------
=======
Text summarization benchmark
+<<<<<<< HEAD
=======
Text Summarization Benchmark
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
@@ -32,6 +36,14 @@ All the relevant files are located in the `text summarization benchmark folder o
Prepare dataset
---------------
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+============================
+In this benchmark, we compare the performance of text summarization between EvaDB and MindsDB on `CNN-DailyMail News `_.
+
+1. Prepare dataset
+------------------
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
.. code-block:: bash
@@ -40,16 +52,22 @@ Prepare dataset
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Use EvaDB for Text Summarization
--------------------------------
=======
2. Using EvaDB to summarize the CNN DailyMail News
--------------------------------------------------
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
Use EvaDB for Text Summarization
--------------------------------
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
.. note::
@@ -62,6 +80,7 @@ Use EvaDB for Text Summarization
python text_summarization_with_evadb.py
+<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
Loading Data Into EvaDB
@@ -119,6 +138,8 @@ Prepare sqlite database for MindsDB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
=======
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Loading Data Into EvaDB
~~~~~~~~~~~~~~~~~~~~~~~
@@ -166,7 +187,17 @@ Use MindsDB for Text Summarization
Setup SQLite Database
~~~~~~~~~~~~~~~~~~~~~~
+<<<<<<< HEAD
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+=======
+3. Using MindsDB to summarize the CNN DailyMail News
+----------------------------------------------------
+
+Prepare sqlite database for MindsDB
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
.. code-block:: bash
@@ -179,6 +210,7 @@ Setup SQLite Database
Install MindsDB
~~~~~~~~~~~~~~~
+<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
Follow the `MindsDB installation guide `_ to install it via ``pip``.
@@ -194,12 +226,24 @@ Follow the `Setup for Source Code via pip >>>>>> 8c5b63dc (release: merge staging into master (#1032))
=======
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Follow the `MindsDB nstallation guide `_ to install it via ``pip``.
.. note::
You will need to manually run ``pip install evaluate`` for the ``HuggingFace`` model to work in MindsDB.
+<<<<<<< HEAD
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+=======
+Follow the `Setup for Source Code via pip `_ to install mindsdb.
+
+.. note::
+
+ At the time of this documentation, we need to manually ``pip install evaluate`` for huggingface model to work in MindsDB.
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
After installation, use the ``MySQL`` client for connecting to ``MindsDB``. Update the port number if needed.
@@ -209,16 +253,22 @@ After installation, use the ``MySQL`` client for connecting to ``MindsDB``. Upda
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Benchmark MindsDB
~~~~~~~~~~~~~~~~~
=======
Run Experiment
~~~~~~~~~~~~~~
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
Benchmark MindsDB
~~~~~~~~~~~~~~~~~
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Connect ``MindsDB`` to the ``sqlite`` database we created before:
@@ -259,6 +309,9 @@ Use the ``text summarization`` model to summarize the CNN news dataset:
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Benchmarking Results
--------------------
=======
@@ -266,10 +319,13 @@ Benchmarking Results
---------------------
Below are numbers from a server with 56 Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz and two Quadro P6000 GPU.
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
Benchmarking Results
--------------------
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Here are the key runtime metrics for the ``Text Summarization`` benchmark.
diff --git a/docs/source/dev-guide/release/pypi-account.rst b/docs/source/dev-guide/release/pypi-account.rst
index 929a6d2b9..c0cc71171 100644
--- a/docs/source/dev-guide/release/pypi-account.rst
+++ b/docs/source/dev-guide/release/pypi-account.rst
@@ -19,10 +19,16 @@ Create a .pypirc in your home directory. It should look like this:
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Then run ``chmod 600 ~/.pypirc`` so that only you can read/write the file.
=======
Then run ``chmod 600 ./.pypirc`` so that only you can read/write the file.
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
Then run ``chmod 600 ~/.pypirc`` so that only you can read/write the file.
>>>>>>> 40a10ce1 (Bump v0.3.4+ dev)
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
diff --git a/docs/source/dev-guide/release/release-steps.rst b/docs/source/dev-guide/release/release-steps.rst
index d97d858c7..330509037 100644
--- a/docs/source/dev-guide/release/release-steps.rst
+++ b/docs/source/dev-guide/release/release-steps.rst
@@ -44,6 +44,9 @@ Build Wheel and Release
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
python script/releasing/releaser.py -n minor -u
=======
git tag -a v0.0.6 -m "v0.0.6 release"
@@ -115,6 +118,9 @@ Build Wheel and Release
Credits: `Snorkel `_
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
python script/releasing/releaser.py -n minor -u
>>>>>>> 40a10ce1 (Bump v0.3.4+ dev)
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
diff --git a/docs/source/overview/concepts.rst b/docs/source/overview/concepts.rst
index 87f7004e1..bf4356f20 100644
--- a/docs/source/overview/concepts.rst
+++ b/docs/source/overview/concepts.rst
@@ -155,6 +155,7 @@ After registering ``MnistImageClassifier`` function, you can call the function i
FROM MnistVideo
WHERE id = 30;
+<<<<<<< HEAD
--- Use the 'MnistImageClassifier' function's output to filter frames
--- This query returns the frame ids of the frames with digit 6
--- We limit to the first five frames containing digit 6
@@ -163,6 +164,7 @@ After registering ``MnistImageClassifier`` function, you can call the function i
WHERE MnistImageClassifier(data).label = '6'
LIMIT 5;
<<<<<<< HEAD
+<<<<<<< HEAD
AI-Centric Query Optimization
-----------------------------
@@ -172,6 +174,57 @@ EvaDB optimizes the AI queries to save money spent on running models and reduce
<<<<<<< HEAD
Query optimization has powered SQL database systems for several decades. It is the bridge that connects the declarative query language to efficient query execution on hardware. EvaDB accelerates AI queries using a collection of optimizations detailed in the :ref:`optimizations` page.
=======
+=======
+=======
+Save time and money
+----------------------
+
+EvaDB automatically optimizes the queries to save inference cost and query execution time using its Cascades-style extensible query optimizer. EvaDB's optimizer is tailored for AI pipelines. The Cascades query optimization framework has worked well in SQL database systems for several decades. Query optimization in EvaDB is the bridge that connects the declarative query language to efficient execution.
+
+EvaDB accelerates AI pipelines using a collection of optimizations inspired by SQL database systems including function caching, sampling, and cost-based operator reordering.
+
+EvaDB supports an AI-oriented query language for analyzing both structured and unstructured data. Here are some illustrative apps:
+
+
+The :ref:`Getting Started` page shows how you can use EvaDB for different AI tasks and how you can easily extend EvaDB to support your custom deep learning model through user-defined functions.
+
+The :ref:`User Guides` section contains Jupyter Notebooks that demonstrate how to use various features of EvaDB. Each notebook includes a link to Google Colab, where you can run the code yourself.
+
+
+
+
+User-Defined Function (UDF) or Function
+------------------------------------------
+
+User-defined functions are thin wrappers around deep learning models. They
+allow us to use deep learning models in AI queries.
+
+Here is an illustrative UDF for classifying MNIST images.
+
+.. code-block:: bash
+
+ !wget -nc https://raw.githubusercontent.com/georgia-tech-db/evadb/master/evadb/udfs/mnist_image_classifier.py
+
+.. code-block:: python
+
+ cursor.create_function("MnistImageClassifier", True, 'mnist_image_classifier.py')
+ response = cursor.df()
+ print(response)
+
+That's it! You can now use the newly registered UDF anywhere in the query -- in the ``select`` or ``filter`` calls.
+
+.. code-block:: python
+
+ query = cursor.table("MNISTVideo")
+ query = query.filter("id = 30 OR id = 50 OR id = 70")
+
+ # Here, we are selecting the output of the function
+ query = query.select("data, MnistImageClassifier(data).label")
+ response = query.df()
+
+.. code-block:: python
+
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
query2 = cursor.table("MNISTVideo")
# Here, we are also filtering based on the output of the function
@@ -179,5 +232,8 @@ Query optimization has powered SQL database systems for several decades. It is t
query2 = query2.select("data, MnistImageClassifier(data).label")
response = query2.df()
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
diff --git a/docs/source/overview/connect-to-database.rst b/docs/source/overview/connect-to-database.rst
index 45a27d96c..fd00f694e 100644
--- a/docs/source/overview/connect-to-database.rst
+++ b/docs/source/overview/connect-to-database.rst
@@ -6,6 +6,7 @@ EvaDB supports an extensive range of data sources for structured and unstructure
Connect to a SQL Database System
--------------------------------
+<<<<<<< HEAD
1. Use the ``CREATE DATABASE`` statement to connect to an existing SQL database.
.. code-block::
@@ -19,11 +20,28 @@ Connect to a SQL Database System
"port": "5432",
"database": "restaurant_reviews"
};
+=======
+1. Use the `CREATE DATABASE` statement to connect to an existing SQL database.
+
+.. code-block:: python
+
+ cursor.query("""
+ CREATE DATABASE restaurant_reviews
+ WITH ENGINE = 'postgres',
+ PARAMETERS = {
+ "user": "eva",
+ "password": "password",
+ "host": "localhost",
+ "port": "5432",
+ "database": "restaurant_reviews"
+ };""").df()
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
.. note::
Go over the :ref:`CREATE DATABASE` statement for more details. The :ref:`Databases` page lists all the database systems that EvaDB currently supports.
+<<<<<<< HEAD
2. Preview the Available Data Using ``SELECT``
You can now preview the available data in the ``restaurant_reviews`` database with a standard :ref:`SELECT` statement.
@@ -45,6 +63,35 @@ You can also run native queries directly in the connected database system by the
'I ordered fried rice but it is too salty.'
)
};
+=======
+2. Preview the Available Data Using `SELECT`
+
+You can now preview the available data in the `restaurant_reviews` database with a standard :ref:`SELECT` statement.
+
+.. code-block:: python
+
+ cursor.query("""
+ SELECT *
+ FROM restaurant_reviews.food_review;
+ """).df()
+
+3. Run Native Queries in the Connected Database With `USE`
+
+You can also run native queries directly in the connected database system by the :ref:`USE` statement.
+
+.. code-block:: python
+
+ cursor.query(
+ """
+ USE restaurant_reviews {
+ INSERT INTO food_review (name, review)
+ VALUES (
+ 'Customer 1',
+ 'I ordered fried rice but it is too salty.'
+ )
+ };
+ """).df()
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
Load Unstructured Data
@@ -56,17 +103,35 @@ EvaDB supports diverse types of unstructured data. Here are some examples:
You can load a collection of images obtained from Reddit from the local filesystem into EvaDB using the :ref:`LOAD` statement.
+<<<<<<< HEAD
.. code-block:: sql
LOAD IMAGE 'reddit-images/*.jpg' INTO reddit_dataset;
+=======
+.. code-block:: python
+
+ cursor.query("""
+ LOAD IMAGE 'reddit-images/*.jpg'
+ INTO reddit_dataset;
+ """).df()
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
2. Load Video from Cloud Bucket
You can load a video from an S3 cloud bucket into EvaDB using the :ref:`LOAD` statement.
+<<<<<<< HEAD
.. code-block:: sql
LOAD VIDEO 's3://bucket/eva_videos/mnist.mp4' INTO MNISTVid;
+=======
+.. code-block:: python
+
+ cursor.query("""
+ LOAD VIDEO 's3://bucket/eva_videos/mnist.mp4'
+ INTO MNISTVid;
+ """).df()
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
.. note::
diff --git a/docs/source/overview/getting-started.rst b/docs/source/overview/getting-started.rst
index 3d7bcd076..1699a7d8d 100644
--- a/docs/source/overview/getting-started.rst
+++ b/docs/source/overview/getting-started.rst
@@ -1,12 +1,18 @@
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
.. _getting-started:
=======
.. _Getting Started:
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
.. _getting-started:
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Getting Started
=================
@@ -26,6 +32,8 @@ To install EvaDB, we recommend using the `pip` package manager.
.. code-block:: bash
python -m venv evadb-venv
+<<<<<<< HEAD
+=======
<<<<<<< HEAD
.. warning::
@@ -123,17 +131,120 @@ The program runs a SQL query for listing all the built-in functions in EvaDB. It
# Connect to EvaDB and get a database cursor for running queries
cursor = evadb.connect().cursor()
+ # List all the built-in functions in EvaDB
+ print(cursor.query("SHOW UDFS;").df())
+
+Now, run the Python program:
+
+.. code-block:: bash
+
+ python -m run_evadb.py
+
+You should see a list of built-in functions including but not limited to the following:
+
+.. code-block:: bash
+
+ name inputs ... impl metadata
+ 0 ArrayCount [Input_Array NDARRAY ANYTYPE (), Search_Key ANY] ... /home/jarulraj3/evadb/evadb/udfs/ndarray/array... []
+ 1 Crop [Frame_Array NDARRAY UINT8 (3, None, None), bb... ... /home/jarulraj3/evadb/evadb/udfs/ndarray/crop.py []
+ 2 ChatGPT [query NDARRAY STR (1,), content NDARRAY STR (... ... /home/jarulraj3/evadb/evadb/udfs/chatgpt.py []
+
+ [3 rows x 6 columns]
+
+.. note::
+ Go over the :ref:`Python API` to learn more about `connect()` and `cursor`.
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+
+Now, activate the virtual environment:
+
+<<<<<<< HEAD
+.. code-block:: bash
+
+ source evadb-venv/bin/activate
+
+2. Once inside the virtual environment, run the command below to mitigate the dependency issues.
+
+.. code-block:: bash
+
+ pip install --upgrade pip setuptools wheel
+
+3. Install EvaDB
+
+.. code-block:: bash
+
+ pip install evadb
+
+4. Verify EvaDB installation
+
+.. code-block:: bash
+
+ pip freeze
+
+You should see a list of installed packages including but not limited to the following:
+
+.. code-block:: bash
+
+ Package Version
+ ----------------- -------
+ aenum 3.1.15
+ decorator 5.1.1
+ diskcache 5.6.3
+ evadb 0.3.3
+ greenlet 2.0.2
+ lark 1.1.7
+ numpy 1.25.2
+ pandas 2.1.0
+ ...
+
+5. Run EvaDB
+
+Copy the following Python program to a file called `run_evadb.py`.
+
+The program runs a SQL query for listing all the built-in functions in EvaDB. It consists of importing and connecting to EvaDB, and then running the query. The query's result is returned as a Dataframe.
+=======
+ EvaDB supports additional installation options for extending its functionality. Go over the :doc:`Installation Options ` for all the available options.
+
+Illustrative AI App
+-------------------
+
+Here is a simple, illustrative `MNIST image classification `_ AI app in EvaDB.
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+
+.. code-block:: python
+
+ # Import the EvaDB package
+ import evadb
+
+<<<<<<< HEAD
+ # Connect to EvaDB and get a database cursor for running queries
+ cursor = evadb.connect().cursor()
+
# List all the built-in functions in EvaDB
print(cursor.query("SHOW FUNCTIONS;").df())
+=======
+ # Load the MNIST video into EvaDB
+ # Each frame in the loaded MNIST video contains a digit
+ cursor.load("mnist.mp4", "MNISTVid", format="video").df()
+
+ # We now construct an AI pipeline to run the image classifier
+ # over all the digit images in the video
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
Now, run the Python program:
+<<<<<<< HEAD
.. code-block:: bash
+=======
+ # Run the model on a subset of frames
+ # Here, id refers to the frame id
+ query = query.filter("id = 30 OR id = 50 OR id = 70 OR id = 0 OR id = 140")
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
python -m run_evadb.py
You should see a list of built-in functions including but not limited to the following:
+<<<<<<< HEAD
.. code-block:: bash
name inputs ... impl metadata
@@ -254,4 +365,15 @@ Try out EvaDB by experimenting with the introductory `MNIST notebook on Colab `_.
Try out EvaDB by experimenting with this introductory notebook.
+<<<<<<< HEAD
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+=======
+Try out EvaDB by experimenting with the introductory `MNIST notebook on Colab `_.
+
+.. image:: ../../images/reference/mnist.png
+
+.. note::
+ Go over the :ref:`Python API` to learn more about the functions used in this app.
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
diff --git a/docs/source/overview/getting-started/installation-options.rst b/docs/source/overview/getting-started/installation-options.rst
index 5d16956f0..712948455 100644
--- a/docs/source/overview/getting-started/installation-options.rst
+++ b/docs/source/overview/getting-started/installation-options.rst
@@ -68,9 +68,13 @@ EvaDB provides the following additional installation options for extending its f
* ``pip install evadb[qdrant]`` for installing the Qdrant vector database system. It enables use-cases related to similarity search based on feature vectors.
+<<<<<<< HEAD
* ``pip install evadb[ludwig]`` for installing the Ludwig model training framework. It enables use-cases related to training and fine-tuning AI models.
* ``pip install evadb[forecasting]`` for installing the statsforecast forecasting framework. It enables use-cases related to time series forecasting.
+=======
+* ``pip install evadb[ludwig]`` for installing the Ludwig model training framework. It enables use-cases related to training and fine-tunining AI models.
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
* ``pip install evadb[ray]`` for installing the Ray compute engine. It enables EvaDB to do more efficient query execution on CPUs and GPUs.
diff --git a/docs/source/reference/api.rst b/docs/source/reference/api.rst
index 4bf99029f..28282f67f 100644
--- a/docs/source/reference/api.rst
+++ b/docs/source/reference/api.rst
@@ -2,13 +2,19 @@
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Python API
=======
Basic API
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
Python API
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
==========
To begin a querying session in EvaDB, obtain a connection with a cursor using ``connect`` and ``cursor`` functions. After getting the cursor, you can run queries with the ``query`` function in this manner:
@@ -99,4 +105,51 @@ EvaDBQuery Interface
``cursor.query("...")`` only construct the query and not run the query. ``cursor.query("...").df()`` will both construct and run the query.
+<<<<<<< HEAD
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+<<<<<<< HEAD
+=======
+EvaDBCursor Interface
+---------------------
+
+Using the cursor, you can refer to a table, load documents, create functions, create vector index, and several other tasks.
+
+After connecting to a table using ``table``, you can construct a complex query using the ``EvaDBQuery`` interface.
+
+.. autosummary::
+ :toctree: ./doc
+
+ ~evadb.EvaDBCursor.table
+ ~evadb.EvaDBCursor.load
+ ~evadb.EvaDBCursor.query
+ ~evadb.EvaDBCursor.create_function
+ ~evadb.EvaDBCursor.create_table
+ ~evadb.EvaDBCursor.create_vector_index
+ ~evadb.EvaDBCursor.drop_table
+ ~evadb.EvaDBCursor.drop_function
+ ~evadb.EvaDBCursor.drop_index
+ ~evadb.EvaDBCursor.df
+ ~evadb.EvaDBCursor.show
+ ~evadb.EvaDBCursor.insert
+ ~evadb.EvaDBCursor.explain
+ ~evadb.EvaDBCursor.rename
+
+EvaDBQuery Interface
+---------------------
+
+.. autosummary::
+ :toctree: ./doc
+
+ ~evadb.EvaDBQuery.select
+ ~evadb.EvaDBQuery.cross_apply
+ ~evadb.EvaDBQuery.filter
+ ~evadb.EvaDBQuery.df
+ ~evadb.EvaDBQuery.alias
+ ~evadb.EvaDBQuery.limit
+ ~evadb.EvaDBQuery.order
+ ~evadb.EvaDBQuery.show
+ ~evadb.EvaDBQuery.sql_query
+ ~evadb.EvaDBQuery.execute
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
diff --git a/docs/source/reference/evaql/create.rst b/docs/source/reference/evaql/create.rst
index 1783977ef..28d29c352 100644
--- a/docs/source/reference/evaql/create.rst
+++ b/docs/source/reference/evaql/create.rst
@@ -49,8 +49,13 @@ To create a table, specify the schema of the table.
object_id INTEGER
);
+<<<<<<< HEAD
CREATE INDEX
------------
+=======
+CREATE UDF
+----------
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
The CREATE INDEX statement allows us to construct an EvaDB based index to accelerate semantic based searching.
The index can be created on either a column of a table directly or outputs from a function running on a column of a table.
@@ -99,8 +104,17 @@ To register an user-defined function, specify the implementation details of the
TYPE Classification
IMPL 'evadb/functions/fastrcnn_object_detector.py';
+<<<<<<< HEAD
CREATE FUNCTION via Type
----------------------------
+=======
+.. _create-udf-train:
+
+CREATE UDF via Training
+-----------------------
+
+To register an user-defined function by training a predication model.
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
.. code-block:: sql
diff --git a/docs/source/reference/evaql/drop.rst b/docs/source/reference/evaql/drop.rst
index 8a84525df..7bf67fca8 100644
--- a/docs/source/reference/evaql/drop.rst
+++ b/docs/source/reference/evaql/drop.rst
@@ -9,8 +9,13 @@ DROP TABLE
DROP TABLE DETRACVideo;
+<<<<<<< HEAD
DROP FUNCTION
-------------
+=======
+DROP UDF
+--------
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
.. code:: mysql
diff --git a/docs/source/reference/evaql/select.rst b/docs/source/reference/evaql/select.rst
index e63a2bbac..3e3be6144 100644
--- a/docs/source/reference/evaql/select.rst
+++ b/docs/source/reference/evaql/select.rst
@@ -37,6 +37,7 @@ Search for frames containing greater than 3 cars
WHERE ArrayCount(FastRCNNObjectDetector(data).label, 'car') > 3
ORDER BY id;
+<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
SELECT TUPLES WITH MULTIPLE PREDICATES
@@ -49,6 +50,14 @@ SELECT WITH MULTIPLE UDFS
SELECT WITH MULTIPLE FUNCTIONS
------------------------------
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+SELECT WITH MULTIPLE FUNCTIONS
+------------------------------
+=======
+SELECT WITH MULTIPLE UDFS
+-------------------------
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
Compose multiple user-defined functions in a single query to construct semantically complex queries.
diff --git a/docs/source/reference/evaql/show.rst b/docs/source/reference/evaql/show.rst
index 41a46e17d..4352f3abb 100644
--- a/docs/source/reference/evaql/show.rst
+++ b/docs/source/reference/evaql/show.rst
@@ -1,8 +1,13 @@
SHOW
====
+<<<<<<< HEAD
SHOW FUNCTIONS
--------------
+=======
+SHOW UDFS
+---------
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
List the registered user-defined functions
diff --git a/docs/source/reference/evaql/udf.rst b/docs/source/reference/evaql/udf.rst
index 883c0e7e8..e27cef510 100644
--- a/docs/source/reference/evaql/udf.rst
+++ b/docs/source/reference/evaql/udf.rst
@@ -1,10 +1,19 @@
:orphan:
+<<<<<<< HEAD
Functions
=========
SHOW FUNCTIONS
--------------
+=======
+
+UDF
+===
+
+SHOW UDFS
+---------
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
Here is a list of built-in user-defined functions in EvaDB.
@@ -23,8 +32,13 @@ FastRCNNObjectDetector is a model for detecting objects. MVITActionRecognition i
ArrayCount and Crop are utility functions for counting the number of objects in an array and cropping a bounding box from an image, respectively.
+<<<<<<< HEAD
SELECT WITH MULTIPLE FUNCTIONS
------------------------------
+=======
+SELECT WITH MULTIPLE UDFS
+-------------------------
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
Here is a query that illustrates how to use multiple functions in a single query.
diff --git a/docs/source/reference/evaql/use.rst b/docs/source/reference/evaql/use.rst
index ec98c6aef..84e585c04 100644
--- a/docs/source/reference/evaql/use.rst
+++ b/docs/source/reference/evaql/use.rst
@@ -11,12 +11,19 @@ The USE statement allows us to run arbitrary native queries in the connected dat
USE
===
+<<<<<<< HEAD
<<<<<<< HEAD
The USE statement allows us to run arbitary native queries in the connected database.
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
=======
The USE statement allows us to run arbitrary native queries in the connected database.
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+The USE statement allows us to run arbitrary native queries in the connected database.
+=======
+The USE statement allows us to run arbitary native queries in the connected database.
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
.. code:: text
@@ -25,13 +32,19 @@ The USE statement allows us to run arbitrary native queries in the connected dat
* [database_connection] is an external database connection instanced by the `CREATE DATABASE statement`.
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
* [native_query] is an arbitrary SQL query supported by the [database_connection].
=======
* [native_query] is an arbitary SQL query supprted by the [database_connection].
>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
+<<<<<<< HEAD
=======
* [native_query] is an arbitrary SQL query supported by the [database_connection].
>>>>>>> 2dacff69 (feat: sync master staging (#1050))
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
.. warning::
diff --git a/docs/source/reference/udfs/model-train.rst b/docs/source/reference/udfs/model-train.rst
new file mode 100644
index 000000000..de6e84eee
--- /dev/null
+++ b/docs/source/reference/udfs/model-train.rst
@@ -0,0 +1,48 @@
+Training and Finetuning
+========================
+
+1. You can train a predication model easily in EvaDB
+
+.. note::
+
+ Install Ludwig in your EvaDB virtual environment: ``pip install evadb[ludwig]``.
+
+.. code-block:: sql
+
+ CREATE UDF IF NOT EXISTS PredictHouseRent FROM
+ ( SELECT sqft, location, rental_price FROM HomeRentals )
+ TYPE Ludwig
+ 'predict' 'rental_price'
+ 'time_limit' 120;
+
+In the above query, you are creating a new customized UDF by automatically training a model from the `HomeRentals` table. The `rental_price` column will be the target column for predication, while `sqft` and `location` are the inputs.
+
+You can also simply give all other columns in `HomeRentals` as inputs and let the underlying automl framework to figure it out. Below is an example query:
+
+.. code-block:: sql
+
+ CREATE UDF IF NOT EXISTS PredictHouseRent FROM
+ ( SELECT * FROM HomeRentals )
+ TYPE Ludwig
+ 'predict' 'rental_price'
+ 'time_limit' 120;
+
+.. note::
+
+ Check :ref:`create-udf-train` for available configurations for training models.
+
+2. After training completes, you can use the `PredictHouseRent` like all other UDFs in EvaDB
+
+.. code-block:: sql
+
+ CREATE PredictHouseRent(sqft, location) FROM HomeRentals;
+
+You can also simply give all columns in `HomeRentals` as inputs for inference. The customized UDF with the underlying model can figure out the proper inference columns via the training columns.
+
+.. code-block:: sql
+
+ CREATE PredictHouseRent(*) FROM HomeRentals;
+
+Check out our `Integration Tests `_ for working example.
+
+
diff --git a/docs/source/reference/udfs/openai.rst b/docs/source/reference/udfs/openai.rst
new file mode 100644
index 000000000..d229eff44
--- /dev/null
+++ b/docs/source/reference/udfs/openai.rst
@@ -0,0 +1,27 @@
+OpenAI Models
+=====================
+
+This section provides an overview of how you can use OpenAI models in EvaDB.
+
+
+Chat Completion UDFs
+--------------------
+
+To create a chat completion UDF in EvaDB, use the following SQL command:
+
+.. code-block:: sql
+
+ CREATE UDF IF NOT EXISTS OpenAIChatCompletion
+ IMPL 'evadb/udfs/openai_chat_completion_udf.py'
+ 'model' 'gpt-3.5-turbo'
+
+EvaDB supports the following models for chat completion task:
+
+- "gpt-4"
+- "gpt-4-0314"
+- "gpt-4-32k"
+- "gpt-4-32k-0314"
+- "gpt-3.5-turbo"
+- "gpt-3.5-turbo-0301"
+
+The chat completion UDF can be composed in interesting ways with other UDFs. Please check the `Google Colab `_ for an example of combining chat completion task with caption extraction and video summarization models from Hugging Face and feeding it to chat completion to ask questions about the results.
diff --git a/docs/source/usecases/food-review.rst b/docs/source/usecases/food-review.rst
new file mode 100644
index 000000000..8f688b0e8
--- /dev/null
+++ b/docs/source/usecases/food-review.rst
@@ -0,0 +1,147 @@
+ChatGPT + Postgres Tutorial
+===========================
+
+.. raw:: html
+
+
+
+In this tutorial, we demonstrate how to use EvaDB + ChatGPT to analyze the tone of food reviews stored in PostgreSQL. Then, based on the analysis, we further use
+EvaDB + ChatGPT to address negative reviews by proposing a solution to the customer.
+
+For this use case, we assume user has a Postgres server running locally. You can also check our notebook above to skip Postgres setup.
+
+1. Connect to EvaDB
+---------------------
+
+.. code-block:: python
+
+ import evadb
+ cursor = evadb.connect().cursor()
+
+2. Connect to an Existing Postgres Database
+---------------------------------------------
+
+.. tab-set::
+
+ .. tab-item:: Python
+
+ .. code-block:: python
+
+ params = {
+ "user": "eva",
+ "password": "password",
+ "host": "localhost",
+ "port": "5432",
+ "database": "evadb",
+ }
+ query = f"CREATE DATABASE postgres_data WITH ENGINE = 'postgres', PARAMETERS = {params};"
+ cursor.query(query).df()
+
+ .. tab-item:: SQL
+
+ .. code-block:: text
+
+ CREATE DATABASE postgres_data WITH ENGINE = 'postgres', PARAMETERS = {
+ "user": "eva",
+ "password": "password",
+ "host": "localhost",
+ "port": "5432",
+ "database": "evadb"
+ }
+
+3. Sentiment Analysis of Food Review using ChatGPT
+---------------------------------------------------
+
+We then use EvaDB + ChatGPT to analyze whether the review is "positive" or "negative" with customized ChatGPT prompt. For this use case,
+we assume reviews have been already loaded into the table inside PostgreSQL.
+You can check our `Jupyter Notebook `__ for how to load data.
+
+.. tab-set::
+
+ .. tab-item:: Python
+
+ .. code-block:: python
+
+ cursor.query("""
+ SELECT ChatGPT(
+ "Is the review positive or negative. Only reply 'positive' or 'negative'. Here are examples. The food is very bad: negative. The food is very good: postive.",
+ review)
+ FROM postgres_data.review_table;
+ """).df()
+
+ .. tab-item:: SQL
+
+ .. code-block:: sql
+
+ SELECT ChatGPT(
+ "Is the review positive or negative. Only reply 'positive' or 'negative'. Here are examples. The food is very bad: negative. The food is very good: postive.",
+ review)
+ FROM postgres_data.review_table;
+
+This will return tone analysis results for existing reviews.
+
+.. code-block::
+
+ +------------------------------+
+ | chatgpt.response |
+ |------------------------------|
+ | negative |
+ | positive |
+ | negative |
+ +------------------------------+
+
+4. Response to Negative Reviews using ChatGPT
+---------------------------------------------
+
+.. tab-set::
+
+ .. tab-item:: Python
+
+ .. code-block:: python
+
+ cursor.query("""
+ SELECT ChatGPT(
+ "Respond the the review with solution to address the review's concern",
+ review)
+ FROM postgres_data.review_table
+ WHERE ChatGPT(
+ "Is the review positive or negative. Only reply 'positive' or 'negative'. Here are examples. The food is very bad: negative. The food is very good: postive.",
+ review) = "negative";
+ """).df()
+
+ .. tab-item:: SQL
+
+ .. code-block:: sql
+
+ SELECT ChatGPT(
+ "Respond the the review with solution to address the review's concern",
+ review)
+ FROM postgres_data.review_table
+ WHERE ChatGPT(
+ "Is the review positive or negative. Only reply 'positive' or 'negative'. Here are examples. The food is very bad: negative. The food is very good: postive.",
+ review) = "negative";
+
+This query will first filter out positive reviews and then apply ChatGPT again to create response to negative reviews. This will give results.
+
+.. code-block::
+
+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | chatgpt.response |
+ |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+ | Dear valued customer, Thank you for bringing this matter to our attention. We apologize for the inconvenience caused by the excessive saltiness of your fried rice. We understand how important it is to have a satisfying dining experience, and we would like to make it right for you ... |
+ | Dear [Customer's Name], Thank you for bringing this issue to our attention. We apologize for the inconvenience caused by the missing chicken sandwich in your takeout order. We understand how frustrating it can be when an item is missing from your meal. To address this concern, we ... |
+ +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+
+Check out our `Jupyter Notebook `__ for working example.
\ No newline at end of file
diff --git a/docs/source/usecases/image-classification.rst b/docs/source/usecases/image-classification.rst
index 78f1e3588..2351b5d0c 100644
--- a/docs/source/usecases/image-classification.rst
+++ b/docs/source/usecases/image-classification.rst
@@ -1,5 +1,6 @@
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
.. _image-classification:
=======
.. _image classification:
@@ -79,12 +80,25 @@ In the following query, we call the classifier on every image in the video. The
FROM mnist_video;
=======
+=======
+>>>>>>> c63abee7 (release: merge staging into master (#1032))
.. _image-classification:
+=======
+.. _image classification:
+
+Image Classification Pipeline using EvaDB
+=========================================
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))
Image Classification
====================
+<<<<<<< HEAD
.. raw:: html
+=======
+1. Connect to EvaDB
+-------------------
+>>>>>>> 8c5b63dc (release: merge staging into master (#1032))