{"id":6145,"date":"2025-06-23T11:00:02","date_gmt":"2025-06-23T09:00:02","guid":{"rendered":"https:\/\/eurocc-bulgaria.bg\/?p=6145"},"modified":"2025-11-27T10:54:42","modified_gmt":"2025-11-27T08:54:42","slug":"system-for-generative-ai-assisted-generation-of-reports-with-automatic-visual-components-collaboration-with-industrial-end-users","status":"publish","type":"post","link":"https:\/\/eurocc-bulgaria.bg\/?p=6145","title":{"rendered":"System for Generative AI Assisted Generation of Reports with Automatic Visual Components (Collaboration with industrial (end) users)"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"6145\" class=\"elementor elementor-6145\" data-elementor-settings=\"[]\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-3b1fdfd elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3b1fdfd\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-c5be082\" data-id=\"c5be082\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-63ca406 elementor-widget elementor-widget-image\" data-id=\"63ca406\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/eurocc-bulgaria.bg\/wp-content\/uploads\/2022\/11\/EuroCC-Logo_BulgariaV1.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-b56c2e8\" data-id=\"b56c2e8\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-df76921 elementor-widget elementor-widget-text-editor\" data-id=\"df76921\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-313ee6b elementor-widget elementor-widget-image\" data-id=\"313ee6b\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"146\" src=\"https:\/\/eurocc-bulgaria.bg\/wp-content\/uploads\/2021\/03\/law2019-06-117044295.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-a5e1c96 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a5e1c96\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-acff9a0\" data-id=\"acff9a0\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4643f89 elementor-widget elementor-widget-text-editor\" data-id=\"4643f89\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><strong>NCC presenting the success story<\/strong><\/p><p>NCC-Bulgaria has been founded by the Institute of Information and Communication Technologies at<br \/>the Bulgarian Academy of Sciences, Sofia University \u201cSt. Kliment Ohridski\u201d and the University of<br \/>National and World Economy.NCC-Bulgaria is focused on:<\/p><ul><li>Creating a roadmap for successful work in the field of HPC, big data analysis and AI,<\/li><li>Analyzing the existing competencies and facilitating the use of HPC\/HPDA\/AI in Bulgaria<\/li><li>Raising awareness and promoting HPC\/HPDA\/AI use in companies and the public sector.<\/li><\/ul><p><strong>Technical\/scientific Challenge:<\/strong><\/p><p>In the process so far, the following workflow has been built and tested:<\/p><ul><li>Created and improved a prompt initiated through a web interface by the end user.<\/li><li>Dispatched one user prompt to three state-of-the-art LLMs (at the time of implementation \u2013 OpenAI GPT-4o, Anthropic Claude 3.5, Google Gemini 1.5).<\/li><li>Merged their responses pair-wise (EasyPeasy.ai or an LLM reasoning merge) into a single, richer draft.<\/li><li>Ran automatic quality assurance passes for grammar (Trinka) and originality (Copyleaks).<\/li><li>Applied a final LLM polish to unify tone and style.<\/li><li>Exposed the entire process in a web interface where end users could trigger the run, inspect intermediate outputs, and approve or request refinements.<\/li><\/ul><p>This pipeline solves the text-quality problem but it has left the visual storytelling to human analysts, who need to spend time plotting charts, and inserting them into reports manually. Analysts must be able to decide whether visuals are needed, choose chart\/diagram types (bar, line, pie, heat-map, network, sequence), and state any additional preferences. The system infers or synthesizes the minimal dataset that makes each point understandable.<\/p><p>All diagrams are produced by short, self-contained Python scripts generated by the LLM, executed in a locked-down sandbox (for security reasons, since the code might include potential attacks or vulnerabilities). Images appear directly after the paragraphs they illustrate, with captions and alt text for WCAG 2.2 compliance.<\/p><p>Beyond text checking, the platform needs runtime validation (no Python errors, non-empty images, labeled axes, readable fonts).<\/p><p><strong>Solution:\u00a0<\/strong><\/p><p><strong>User-facing Web Interface \u2014 Visual-Aware Prompt Builder<\/strong><\/p><p>The existing front-end is extended with a second section titled \u201cVisual Options\u201d\u00a0<strong>(Fig.1):<\/strong><\/p><ul><li>Chart \/ Diagram Types (multi-select) \u2013 Pick from bar, line, pie, heat-map, radar, network graph, sequence diagram, \u201cother\u201d.<\/li><li>Quantity \u2013 Max number of visuals desired.<\/li><li>Stylistic Hints \u2013 Optional brand colors, font size, aspect ratio.<\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-f5961c3\" data-id=\"f5961c3\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-79c7079 elementor-widget elementor-widget-text-editor\" data-id=\"79c7079\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><strong>Back-end Pipeline<\/strong><\/p><p><strong>Semantic Visual\u00a0<\/strong>Planner \u2013 the Generative AI tool (OpenAI GPT-4o) scans the merged resulting text, detects numeric patterns, ordinal lists, risk taxonomies, and matches user-requested chart types to the most relevant content. It inserts stable placeholders, for example:\u00a0<strong>Fig_2_PIE: RISK_DISTRIBUTION.<\/strong><\/p><p><strong>Python Code Generator<\/strong>\u00a0\u2013 For every placeholder, the Generative AI tool produces a stand &#8211; alone Python script that:<\/p><p>1) builds an in-memory DataFrame (synthetic or extracted numbers);<\/p><p>2) renders the chosen matplotlib \/ graphviz figure with labels, title, legend;<\/p><p>3) writes a PNG to \/tmp\/fig_&lt;hash&gt;.png;<\/p><p>4) prints a JSON payload containing alt text.<\/p><p><strong>Sandbox Execution<\/strong>\u00a0\u2013 Scripts run inside a Docker container with CPU\/memory limits; outbound network disabled.<\/p><p><strong>Runtime Validator<\/strong>\u00a0\u2013 Checks: zero exit code, PNG exists &amp; &gt;1 KB, axes labeled, font size \u22659 pt. Failures trigger regeneration (max 3 attempts) or placeholder flag for manual review.<\/p><p><strong>Quality assurance (QA) Pass 2<\/strong>\u00a0\u2013 the Generative AI tool performs the final polish plus caption refinement (It is the 2-nd pass, since the original workflow already has a quality assurance phase).<\/p><p><strong>Final Assembly<\/strong>\u00a0\u2013 Place images, captions, and alt text at placeholders.<\/p><p>Text merging\/QA (proven in phase 1) remains untouched, ensuring continuity. The new visual branch hooks in after QA Pass 1, so grammatical or factual corrections happen before chart generation.<\/p><p>By inserting IDs like FIG_2_PIE:RISK_DISTRIBUTION, downstream components know exactly which script produces which image and where to place it. This allows storing the Python scripts for human verification and potentially adjustment, if necessary.<\/p><p>Even though the code is LLM-generated, resource limits and mandatory validation guarantee no harmful side effects and visual quality. This is important since potential prompt injections could lead to generating Python code that might cause security issues.<\/p><p><strong><br \/>Scientific impact: <\/strong>\u00a0<\/p><ul class=\"wp-block-list\"><li>Demonstrates that a workflow of Generative AI tools and systems can infer supportive datasets and select the most persuasive visual form.<\/li><li>Provides a reference for running AI-written code for visual component generation inside secure systems and networks.<\/li><li>Combines machine generation with analyst curation, shortening iterations while preserving expert oversight.<\/li><\/ul><p class=\"MsoNormalCxSpFirst\"><b><span lang=\"EN-GB\" style=\"font-size: 12.0pt; line-height: 107%; font-family: 'Times New Roman',serif; mso-fareast-font-family: Calibri; mso-ansi-language: EN-GB;\">Benefits:\u00a0<\/span><\/b><\/p><ul><li>Richer deliverables to the customers of SSI \u2013 incident-trend lines, vulnerability heat-maps, attacker-path graphs and other kinds of charts and diagrams that would be beneficial for better understanding of the reports appear automatically.<\/li><li>Consistent visual standards without extra design steps.<\/li><li>All generated documents pass WCAG 2.2 accessibility checks and internal cyber-security audits.<\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-d16db78 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d16db78\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-4cfd6af\" data-id=\"4cfd6af\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a92b2e6 elementor-widget elementor-widget-text-editor\" data-id=\"a92b2e6\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><strong>Success story # Highlights:<\/strong><\/p><ul><li>Introduces a visual-aware prompt builder and semantic visual planner powered by reasoning-first large language models.<\/li><li>Implements a method to generate and insert charts and diagrams into the context of the generated text.<\/li><li>Implements a secure sandbox and validator so that auto-generated Python charts remain both safe and high quality.<\/li><\/ul><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-54d6616 elementor-widget elementor-widget-text-editor\" data-id=\"54d6616\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><strong>Figure 1: Setting up the visual information requirements alongside the initial prompt building.<\/strong><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7e8a2f0 elementor-widget elementor-widget-image\" data-id=\"7e8a2f0\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"611\" height=\"306\" src=\"https:\/\/eurocc-bulgaria.bg\/wp-content\/uploads\/2025\/07\/geneAIassis2.png\" class=\"attachment-large size-large\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-63f8237 elementor-widget elementor-widget-text-editor\" data-id=\"63f8237\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><strong>Figure 2: Structured prompt and results from the three tools by OpenAI, Anthropic, and Google<\/strong><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3eea3e9 elementor-widget elementor-widget-image\" data-id=\"3eea3e9\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"332\" src=\"https:\/\/eurocc-bulgaria.bg\/wp-content\/uploads\/2025\/07\/geneAIassis3.png\" class=\"attachment-large size-large\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-37b6023\" data-id=\"37b6023\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a3d365d elementor-widget elementor-widget-text-editor\" data-id=\"a3d365d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><strong>Figure 3<\/strong>: <strong>Final report containing multiple charts related to the content and in line with the requirements provided in the starting screen.<\/strong><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-34d9c94 elementor-widget elementor-widget-image\" data-id=\"34d9c94\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"354\" src=\"https:\/\/eurocc-bulgaria.bg\/wp-content\/uploads\/2025\/07\/geneAIassis4.png\" class=\"attachment-large size-large\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-885e637 elementor-widget elementor-widget-text-editor\" data-id=\"885e637\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><strong>Figure 4<\/strong>: <strong>Evaluation of Protection Solution <\/strong><\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4959122 elementor-widget elementor-widget-image\" data-id=\"4959122\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"367\" src=\"https:\/\/eurocc-bulgaria.bg\/wp-content\/uploads\/2025\/07\/geneAIassis5.png\" class=\"attachment-large size-large\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-763fd1c elementor-widget elementor-widget-text-editor\" data-id=\"763fd1c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\"><p><strong>Contact:<\/strong><\/p><ul class=\"wp-block-list\"><li><em>Venko Andonov,\u00a0<\/em><em>vandonov at unwe.bg<\/em><em>, University of National and World Economy, Sofia<\/em><\/li><li><em>Prof. Valentin Kisimov, <\/em><em>vkisimov at unwe.bg<\/em><em>, University of National and World Economy, Sofia<\/em><\/li><\/ul><p>University of National and World Economy, Bulgaria<\/p><\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>NCC presenting the success story NCC-Bulgaria has been founded by the Institute of Information and Communication Technologies atthe Bulgarian Academy of Sciences, Sofia University \u201cSt. Kliment Ohridski\u201d and the University [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6146,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129],"tags":[],"_links":{"self":[{"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=\/wp\/v2\/posts\/6145"}],"collection":[{"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6145"}],"version-history":[{"count":10,"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=\/wp\/v2\/posts\/6145\/revisions"}],"predecessor-version":[{"id":6706,"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=\/wp\/v2\/posts\/6145\/revisions\/6706"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=\/wp\/v2\/media\/6146"}],"wp:attachment":[{"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eurocc-bulgaria.bg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}