Datasets of text - GraphViz examples? ✏

Hello all,

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?

:left_speech_bubble: :arrow_right: :pencil2: :bar_chart:

Thank you!

Example 1: working towards diagram understanding and generation, like in this paper

Example 2:


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]


The Graphviz gallery is probably what you are looking for.

Thanks - the Graphviz gallery doesn’t have text descriptions that describe the image

(so it’s hard to train an ML model to map text input → GraphViz output).

Any other links come to mind?

I pasted your verbatim Example 2 input into ChatGPT, and it produced the following Graphviz code:

digraph {
  node [shape=rectangle style=filled color="lightblue"];
  sciences [label="Branches of Science"];
  formal [label="Formal Sciences"];
  natural [label="Natural Sciences"];
  physical [label="Physical Science"];
  life [label="Life Science (Biology)"];
  social [label="Social Sciences"];
  sciences -> formal [color="darkblue"];
  sciences -> natural [color="darkblue"];
  sciences -> social [color="darkblue"];
  natural -> physical [color="darkblue"];
  natural -> life [color="darkblue"];

This corresponds to the image,
which is not exactly what you were looking for but is still pretty impressive for an AI.

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
-- Load Balancer
--- API

Draw a line connecting the following:

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";
    // Create the Portal cluster
    subgraph cluster_portal {
      label = "Portal";
      // Add the BHSMS node
  // Create the ATOS cluster
  subgraph cluster_atos {
    label = "ATOS";
    // Create the Load Balancer cluster
    subgraph cluster_loadbalancer {
      label = "Load Balancer";
      // Add the API node
  // Add a connection between BHSMS and 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.