This component executes the translation from user-defined intents to actionable workflows. The user starts the process by defining, on a high level, the analytical task to be executed. I2W extracts the key features from the description and maps it to a rich knowledge base. From there, it chases the dependencies indicated in the ontology to produce workflows to implement the defined task according to the specified intention. These workflows are intially encoded using RDF, which implies a high flexibility to be translated to other representations, such as the DSL required by the execution engine.
The backbone of the project can be found in the backend/modules folder, where the two modules that implement the main functionalities can be found (belonging to WP3 and WP4). Besides the backend logic, we provide a frontend for an easy and intuitive interaction with the system. The frontend communicates with the backend via a main API (backend/api) that collects the functionalities presented by the two modules.
The intentAnticipation module is in charge of anticipating, capturing and processing the user-defined intent. The user defines this intent by indicating the required parameters (type of task, dataset to use, etc.). Then, the system (i) maps the intent to the concepts defined by our knowledge base and (ii) provides recommendations, extracted from past experiments, to the user regarding the definition of the intent. That is, it indicates which are the additional constraints that are recommended to define in order to optimize the workflow (e.g. which is the best algorithm to use). Optionally, the intent can be defined on an even higher-level via natural language, which is processed by LLMs to extract the required elements.
The IntentSpecification2WorkflowGenerator module generates, once the intent has been captured, the corresponding workflow. This is done in a series of steps:
- Data annotation: the data is annotated following the concepts represented in the knowledge base. This allows us to understand the characteristics of the data and provide the appropiate operations to adequately work with them.
- Abstract plans: the first proposed workflows are very abstract instantions of the pipeline to encode. These include high level tasks that provide a general orientation regarding how to define the workflow. One of these plans is created by each of the algorithms that can be employed for the task. The user has to select at least one of these plans.
- Logical plans: the abstract plans are mapped to specific workflows where all the necessary tasks to execute the intent cna be found. These plans explore all the potential variability points regarding the needs of the intent, pruning those paths that are deemed less relevant (in order not to bombard the user with too many, indistinguishable alternatives). These are divided by algorithms and specific implementations of these algorithms (e.g. neural networks -> LSTM networks, convolutional networks, etc.). The user selects, at least, one of these plans.
- Workflow representation: once the definitive list of workflows has been selected, these can be visualized, stored in the system for later use or exported in RDF format. Alternatively, we offer the possibility of directly converting the workflows to the DSL language required by the experimentation engine.
π Project Root
βββ π backend/ β Backend source code
β βββ π api/ β API-related code
β βββ π modules/ β Backend submodules
β βββ π intentAnticipation/ β Submodule to anticipate, capture and process intents (WP4)
β βββ π IntentSpecification2WorkflowGenerator/ β Submodule to generate the workflows from user's intents (WP3)
βββ π frontend/ β Frontend source code
βββ π .gitignore β Git ignore rules
βββ π .gitattributes β Git rules to handle files
βββ π LICENSE β Project license
βββ π README.md β Project documentation
βββ π start_apis.bat β Script to easily initiate the system (Windows)
βββ π start_apis.sh β Script to easily initiate the system (Linux)
Before you begin, ensure that you have the following prerequisites installed:
- Node.js (version 18.20.6)
- NPM (version >=6.14.12)
- Yarn You can install it using
npm install -g yarn
(or on a macOS install it using Homebrew usingbrew install yarn
) - Quasar (CLI >= 2.0) You can install it using
npm install -g @quasar/cli
Then, clone the repository:
git clone https://github.com/dtim-upc/Intents2Workflows.git
cd Intents2Workflows
Lets ensemble everything to be able to compile and make run the code.
-
Go to
Intents2Workflows/backend/api
. Install all the required libraries with the following command:pip install -r requirements.txt
The intent-generation functionalities are separated into two different modules, which can be found in the backend folder.
-
Go to
Intents2Workflows/modules/IntentSpecification2WorkflowGenerator
. Install all the required libraries with the following command:pip install -r requirements.txt
-
Go to
Intents2Workflows/modules/IntentAnticipation
. Install all the required libraries with the following command:pip install -r requirements.txt
-
Open in the terminal the
Intents2Workflows/frontend
folder. -
Execute
npm install --force
. -
Then, execute
yarn install
(on macOS it is possible you need to runyarn install --ignore-engines
).
The simplest way to deploy the code is to employ Dockerized environments. To do so, you need Docker installed and the Docker daemon running. Then, execute the following command in the root folder of the repository:
docker-compose up --build
This line will both build the containers (which will take around 5 minutes) and the deploy the system. To access the functionalities, open a new browser window in localhost:9000.
For subsequent deployments, you can execute the following line, which will simply deploy the containers (not build them):
docker-compose up
We provide two script to easily deploy the system (start_apis, in the root folder): one for Windows (.bat) and another for Linux (.sh). Simply execute the corresponding file regarding your system and both the frontend and all the necessary APIs will be launched (please note the potential error that can be triggered with Quasar; see below).
Alternatively, you can manually launch all the necessary processes.
-
Go to
Intents2Workflows/backend/api
. Launch the main backend API with the following line:uvicorn main:app --port=9001
-
Go to
Intents2Workflows/modules/IntentSpecification2WorkflowGenerator
. Launch the intent to workflows API with the following line:flask --app api\api_main.py run --port=9002
-
Go to
Intents2Workflows/modules/IntentAnticipation
. Launch the intent capturing APIs (there are two) with the following line:python .\start_apis.py
-
Go to
Intents2Workflows/frontend
. To launch the frontend executequasar dev
(or on a macOS do it from thenode_modules
directory usingnode_modules/@quasar/app-vite/bin/quasar dev
. This will open your browser with the URL http://localhost:9000/#/projects.
Note: that you must have Quasar CLI as it's mentioned in the Prerequisites section. If there's an error like Global Quasar CLI β’ β οΈ Error Unknown command "dev"
, it's because you are not in the correct path, or you don't have Quasar CLI installed.
Current Implementation:
- Analytical Intent Capturing
- Recommendation through Knowledge Graph Embeddings (KGE)
- Workflow generation based on userβs input
Future Implementation:
- Mapping annotated experiments to KG (M28)
- KGE recommendation improvement (KGE dynamic updates) (M30)
- Constraints/Preferences Capturing (M30)
- Considering userβs constraints/preferences when generating the workflows (M30)
The following video showcases a demo of the Intents to Workflows component
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
For any questions or suggestions, feel free to open an issue or contact the maintainers at [ [email protected], [email protected] ]