I’m looking to build an ML model that automatically generates GraphViz scripts from a text description of a system.
An example is shown below.
→ Are there any sites, galleries, or examples with GraphViz diagrams paired with text descriptions of them?
Thank you!
Example 1: working towards diagram understanding and generation, like in this paper
Example 2:
INPUT:
Create a graphviz diagram that visually conveys all of the ideas and relationships in the following text. Include and parent and children mentioned. Add complementary soft colors, and make it well-organized:
The branches of science, also referred to as sciences, scientific fields or scientific disciplines, are commonly divided into three major groups:Formal sciences: the study of formal systems, such as those under the branches of logic and mathematics, which use an a priori, as opposed to empirical, methodology.
Natural sciences: the study of natural phenomena (including cosmological, geological, physical, chemical, and biological factors of the universe). Natural science can be divided into two main branches: physical science and life science (or biology).
Social sciences: the study of human behavior in its social and cultural aspects.[1]
I actually came here just now to say that I have been playing with ChatGPT for a few weeks and just started having it generate DOT diagrams for me. Definitely not perfect but still pretty cool.
My prompt:
Create a DOT diagram using the following outline to represent clusters and nodes:
- Presentation
-- Portal
--- BHSMS
- ATOS
-- Load Balancer
--- API
Draw a line connecting the following:
BHSMS -> API
Here is the output:
digraph APSA {
// Define styles
node [style=filled, shape=box];
cluster [style=filled, color=lightgrey, fontname=sans-serif];
// Create the Presentation cluster
subgraph cluster_presentation {
label = "Presentation";
fontname=sans-serif;
// Create the Portal cluster
subgraph cluster_portal {
label = "Portal";
fontname=sans-serif;
// Add the BHSMS node
BHSMS;
}
}
// Create the ATOS cluster
subgraph cluster_atos {
label = "ATOS";
fontname=sans-serif;
// Create the Load Balancer cluster
subgraph cluster_loadbalancer {
label = "Load Balancer";
fontname=sans-serif;
// Add the API node
API;
}
}
// Add a connection between BHSMS and API
BHSMS -> API;
}
I did have to enclose the sans-serif font names in quotes to get gvedit to render it.
While it is interesting and impressive, I will stick to writing my own diagrams. It takes too long for ChatGPT to re-render the output when I give it a new prompt to fix or add anything. In addition, I have to be careful on exactly how I tell it to re-render something. Sometimes it will re-render and just make the change. Other times it completely changes up the formatting and style decisions as well.
Plus, most of my diagram DOT code is rendered from my application from the information in my database. But still cool that ChatGPT knows what Graphviz and DOT are and can give compelling example diagrams.