Nowadays there is a ton of information about each phase involved in creating ai algorithms, and this is great!
This covers data loading/preparation, feature engineering, training, testing, hyperparameterization, validation, explainability, MLOps, and deployment.
<h2 class="wp-block-heading" id="h-overlooking-end-users-in-ai-applications”>Bypassing end users in ai applications
<h5 class="wp-block-heading" id="h-at-the-same-time-i-am-puzzled-to-see-how-little-is-mentioned-about-the-end-user-the-end-user-being-a-business-person-with-no-ai-background-interacting-with-the-software-vincent-gosselin”>At the same time, I am surprised to see how little is mentioned about the “end user”: the end user is a business person without ai experience who interacts with the software. – Vincent Gosselin
<h5 class="wp-block-heading" id="h-even-if-ai-has-led-to-many-automated-ai-applications-for-instance-autonomous-vehicles-trading-bots-etc-most-companies-need-end-users-to-collaborate-interact-with-an-ai-engine-vincent-gosselin”>Even if ai has given rise to many “automated” ai applications (e.g., autonomous vehicles, commercial robots, etc.), most businesses need end users to “collaborate”/interact with an ai engine. – Vincent Gosselin
Let's take two examples:
- QSR Store Sales Forecast
- A two-month cash flow prediction for a large franchise brand.
In example 1, a QSR store manager connects to the new forecasting software. Through an ergonomic GUI, you can generate next week's sales forecast (created by ai engine). Then you just found out 5 minutes ago that a competitor across the street is running a new promotion today. You can then choose to reduce the generated forecast by 10% during peak hours. Here, the end user must modify the output of the forecast engine.
In example 2, The company's treasurer wants to run the cash flow prediction for the next two months. However, he wants to play with different inflation values and evaluate the impact on the forecast. Here, the end user wants to control an input parameter (the inflation rate) to the ai engine.
There are many other examples where end users need to modify the input or output of an ai engine. This is an integral part of the decision process.
<h2 class="wp-block-heading" id="h-taipy-s-capabilities-to-enhance-end-user-interaction-with-ai“>Taipy's capabilities to improve end-user interaction with ai
To address these situations, we define (as part of the Guy open source team) the concept of “scenario” and “data nodes”. A scenario is nothing more than the execution of your algorithm (pipeline) given a set of input information (input data nodes).
We have also implemented three essential capabilities:
1. Data nodesai-picture#1-data-nodes”/>
Ability to model pipelines as a sequence of Python tasks, as well as data nodes (anything that can be an input or output of a Python task). A data node can connect to any data format (SQL, NoSQL, CSV, JSON, etc.) or a parameter (a Python object, i.e. a date entered by the end user via the graphical interface).
2. Scenariosai-picture#2-scenarios”/>
Ability to log each pipeline execution (within a log). We call this execution “scenario”.
3. Comparison of scenariosai-picture#3-scenario-comparison”/>
Ability to retrieve past/recorded scenarios, compare them, track them, etc.
We decided to offer two options to define your pipeline in Guy– Programmatically or using a visual code graph editor.
Let's take an example
1. Create a pipelineai-picture#1-create-a-pipeline”/>
Let's take a simple pipeline case with:
– A single task: “predict”, calling the inference of an ai engine
– 2 input data nodes: 'historical_temperature' and 'forecast_date'.
To create this pipeline, with Guywe have two options:
Option 1: Programmatic Configuration
We can dive into the Python code. This script creates a cfg_scenario object:
from taipy import Config
# Configuration of Data Nodes
historical_temperature_cfg = Config.configure_data_node("historical_temperature")
date_to_forecast_cfg = Config.configure_data_node("date_to_forecast")
predictions_cfg = Config.configure_data_node("predictions")
# Configuration of tasks
predict_cfg = Config.configure_task(id="predict",
function=predict,
input=(historical_temperature_cfg, date_to_forecast_cfg),
output=predictions_cfg)
# Configuration of a scenario configuration
scenario_cfg = Config.configure_scenario(id="my_scenario", task_configs=(predict_cfg))
Option 2: Graphic editor configuration
Or we can use Taipy Studio, the Pipeline/DAG graphical editor that improves pipeline creation. (It's a VS Code Extension)
He cfg_scenario The object is then created by loading the above diagram and saved as a TOML file.
Config.load('config.toml')
# my_scenario is the id of the scenario configured
scenario_cfg = Config.scenarios('my_scenario')
2. Run different scenariosai-picture#2-execute-different-scenarios”/>
Scenarios are just instances of the above pipeline configuration.
Here:
1. We create a scenario (an instance of the above pipeline configuration)
2. We initialize its input data nodes.
3. We execute it (tp.send())
import taipy as tp
# Run of the Taipy Core service
tp.Core().run()
# Creation of the scenario
scenario = tp.create_scenario(scenario_cfg)
# Initialize the 2 input data nodes
scenario.historical_temperature.write(data)
scenario.date_to_forecast.write(dt.datetime.now())
# execution of the scenario
tp.submit(scenario)
print("Publish the predictions", scenario.predictions.read())
Note that behind the screen the execution of a given scenario is recorded, that is, an automatic storage of information related to each data node used at the time of execution.
Benefits
This relatively “simple” scenario management process defined in this article allows:
1. A rich set of user functionalities such as:ai-picture#1-a-rich-set-of-user-functionalities-such-as”/>
- Easy retrieval of all scenarios over a given period and their associated input/output data nodes enables easy data lineage.
- Compare two or more scenarios based on some KPI: the value of a given data node.
- Tracking a given KPI over time
- Rerun a passed scenario with new values (can change the value of a given data node)
2. Complete process versioning: essential for quality project managementai-picture#2-full-pipeline-versioning-essential-for-quality-project-management”/>
General pipeline versioning is very necessary when introducing new nodes/data sources or a new version of a given Python code (avoiding incompatibilities with previously executed scenarios).
3. Reduce the gap between data scientists/developers and end usersai-picture#3-narrowing-the-gap-between-data-scientistsdevelopers–endusers”/>
By providing access to the entire repository of end-user scenarios, data scientists and Python developers can better understand how end users use the software.
and to go further
To assist in this process, we find it useful to provide specific graphical objects to explore past scenarios visually, display their input and output data nodes, modify them, rerun scenarios, etc.
For this we expand Taipy's Graphics library to provide a new set of graphical components for scenario visualization.
Below is an example of such a scenario, “browser”.
Conclusionai-picture#conclusion”/>
This is our interpretation of scenario management. We hope that such an article will generate more interest and discussion on this crucial topic and lead to better ai software and ultimately better decisions.
This article was originally published in ai-picture” target=”_blank” rel=”noreferrer noopener”>Guy.
Thanks to taipy team for the educational/thought leadership article. taipy team has supported us in this content/article.
Vincent Gosselin, co-founder and CEO of Taipy, is a distinguished ai innovator with over three decades of experience, notably at ILOG and IBM. He has mentored numerous data science teams and led innovative ai projects for global giants such as Samsung, McDonald's and Toyota. Vincent's mastery in mathematical modeling, machine learning, and time series prediction has revolutionized operations in manufacturing, retail, and logistics. Student at Paris-Saclay University with a master's degree in Comp. Science & ai, his mission is clear: transform ai from pilot projects to essential tools for end users across industries.