Here is a diagram derivation (mind-map) for a certain cat joke:
In[81]:=
txt="A policeman in the big city stops a man in a car with a Siberian Lynx in the front seat. “What are you doing with that Siberian Lynx?” He exclaimed, “You should take it to the zoo.” The following week, the same policeman sees the same man with the cat again in the front seat, with both of them wearing sunglasses. The policeman pulls him over. “I thought you were going to take that cat to the zoo!” The man replied, “I did. We had such a good time we are going to the beach this weekend!”";LLMResourceFunction["MindMapper"][txt]
Out[82]=
```mermaidgraph LRA[Policeman stops man with Siberian Lynx in car]B["Policeman: 'Take it to the zoo!'"]C[Same man with cat in car again]D["Policeman: 'I thought you were going to the zoo!'"]E["Man: 'We had such a good time, going to the beach!'"]A --> BC --> DD --> E```
Here is a plot corresponding to the obtained Mermaid-JS spec (some tweaking was applied):
In[83]:=
ResourceFunction["MermaidInk"][%]
Out[83]=
Scope (2)
Scope
(2)
The second argument can be used to specify the type of diagram:
In[27]:=
gr=LLMResourceFunction["MindMapper"][ExampleData[{"Text","Hamlet"}],"characters relationships mind-map"]
Out[27]=
```mermaidgraph TD A[Claudius] -->|King of| B[Denmark] A -->|Uncle to| C[Hamlet] A -->|Husband to| D[Gertrude] C -->|Son of| E[Ghost of Hamlet's Father] C -->|Nephew to| A C -->|Friend to| F[Horatio] D -->|Mother of| C D -->|Queen of| B D -->|Wife to| A G[Polonius] -->|Father of| H[Ophelia] G -->|Father of| I[Laertes] H -->|Daughter to| G I -->|Son to| G F -->|Friend to| C```
Here is the corresponding plot:
In[56]:=
ResourceFunction["MermaidInk"][gr]
Out[56]=
———
Here with the third argument we invoke the generation of a more detailed diagram:
In[59]:=
gr2=LLMResourceFunction["MindMapper"][txt,"mind-map","between the relationships of the concepts in"]
Out[59]=
```mermaidgraph TB A[Policeman] -- stops --> B[Man with Siberian Lynx] B -- in --> C[Car] C -- in --> D[Big City] A -- exclaims --> E["Take Lynx to the zoo"] F[Following Week] -- sees --> A F -- sees --> B B -- with --> G[Lynx in sunglasses] B -- with --> H[Man in sunglasses] A -- pulls over --> B A -- says --> I["Thought you were going to take Lynx to zoo"] B -- replies --> J["Did take Lynx to zoo"] B -- plans --> K["Going to beach with Lynx"]```
In[60]:=
ResourceFunction["MermaidInk"][gr2]
Out[60]=
Possible Issues
Possible Issues
Different models produce fairly different outcomes.