ChatGPT is great for studying.
But did you know you can use it to make mindmaps based on your study material?
Through the combined power of @LangChainAI and @XmindHQ you can.
Let's dive into the workflow and code 🧵
#AI
Before we dive in, this is day 3 of my '7 days of LangChain'.
Every day, I'll introduce you to a simple project that will guide you through the basics of LangChain.
Follow @JorisTechTalk to stay up-to-date.
Let me know what you'd like to see
Let's dive in:
High-level overview:
1️⃣ Load study material
2️⃣ Split into smaller chunks
3️⃣ Generate mindmap in Markdown with @LangChainAI
4️⃣ Import markdown file in @XmindHQ
1. Load study material
Load your data with a Pdf Reader.
Since it splits this into multiple pages, add all text to a single text variable for further use.
2. Split text into chunks
The new OpenAI 16k model is amazing. It lets you have 4 times the input compared to the earlier model.
Larger context window = better understanding and fewer API calls.
3. Create your prompts.
Prompting is key. I specifically instructed the model to only output the text in markdown, with the correct format.
Try it yourself and see what works best.
4. Initialize and run the summary chain
With the use of your custom prompts, the summary chain will create the mindmap based on your study material.
Setting verbose to True will show the model's 'thought process'.
Always play around with structuring your prompts.
5. Save the mindmap to a markdown file
Nothing fancy happening here.
Just saving it to import it to Xmind later.
6. Import the markdown file into @XmindHQ.
Voila. You've just created a mindmap to help you study!
This is still a manual step. Will look into automating this as well.
That's day 3 out of '7 days of Langchain' done.
Follow @JorisTechTalk to stay up to date.
Still looking for a project for tomorrow. What do you want me to cover?
Day 3 of '7 days of @LangChainAI' ✅
Nearly crossing the half-way point.
What else do you want to see?
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
