Joris de Jong Profile picture
Jun 14 10 tweets 5 min read Twitter logo Read on Twitter
ChatGPT is great for studying.

But did you know you can use it to help you prepare for specific exams?

With the power of @LangChainAI you can!

Here's a 9-step breakdown including code: 🧵

#AI #study #buildinpublic #indiehacker Image
1/9 A high-level overview:

1. Input: PDF of study material
⬇️
2. Process documents
⬇️
3. Generate questions based on study material and exam guidelines
⬇️
4. Answer the questions based on the study material

You could combine step 3 & 4, but separating them = better results👇
2/9 Let's dive into the code:

First, load and process data for question generation.

I'm using the new gpt-3.5-turbo-16k model for a larger context window.

Result: Less calls to the model and higher context-awareness Image
3/9 Process the data for question answering.

We'll be storing the data in a vector database for easy retrieval and search possibilities later.

Standard gpt-3.5-turbo model for lower cost.

Lower chunk size = lower token usage when retrieving. Image
4/9 The part where you can get creative. Prompting.

Prompting is key to getting great results. Play around with this and get as creative as you want.

You could let it generate multiple-choice questions, in any language you'd like, include your exam criteria and much more. ImageImage
5/9 Generating the actual questions.

Initialize the large language model. You can use the one you like most.

Use the refine summarization chain to move through all the documents and generate questions based on the content provided. Image
6/9 Create the vector database and initialize the retrieval Q&A chain.

Work with the embeddings of your choice. Set up your preferred vector database and initialize the Retrieval chain with the database as the retriever.

We're now all set for answering the questions. Image
7/9 Run the answering chain and print the results.

Tada... You've just created personalized practice questions for your exam!

As I said, prompting determines the quality of your results. Play around with this.

Check out @Luc_AI_Insights for some advanced prompting tips! Image
8/9 How much does this cost?

You can track your OpenAI API costs with this simple function. Just wrap all the code within it and see your token cost.

I just did this for a 30-page document. Total cost? $0.10.

Not bad for some detailed exam prep if you ask me. Image
9/9 Say thanks to @LangChainAI and @hwchase17.

LangChain is such a powerful framework. It gives you instant access to some of the most advanced technology we've seen.

If you have any questions, don't hesitate to ask!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Joris de Jong

Joris de Jong Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @JorisTechTalk

Jun 13
Are you excited about the future of #AI programming?

Meet Mojo🔥, the new programming language optimized for AI, with a 35,000x performance boost over Python

Created by @Modular_AI , led by the great @clattner_llvm. (Google, Tesla, Apple, Swift)

Thread👇

#Mojo #coding Image
Mojo🔥 is a superset of Python

It provides the usability of one of the world's most popular languages, but with the performance of C & C++.

In fact, Mojo code has demonstrated 30k times speedup over Python!
But Mojo🔥 isn't just about speed.

It's about building a universal platform to tackle the complexity of modern AI & hardware systems.

Mojo's commitment to the Python ecosystem makes it unique among programming languages.
Read 12 tweets
Jun 12
Want to get into AI, but don't know where to start?

Here's a list of the 10 best free courses on EdX.

🧵

P.S.: I stole this list from @mashable 🤫

#AI #indiehacker #coding
1. AI Chatbots without programming by @IBM

This course will teach you how to build, analyze, deploy and monetize chatbots - with the help of IBM Watson and the power of AI.

edx.org/course/AI-chat…
2. AI for Everyone: Master the Basics by @IBM

Learn what Artificial Intelligence (AI) is by understanding its applications and key concepts including machine learning, deep learning and neural networks.

edx.org/course/artific…
Read 11 tweets
Jun 3
Strong prompts are key to getting great results from ChatGPT.

But managing 20 different ChatGPT tabs is a hassle.

With @LangChainAI's Multi Prompt Chain, you don't have to. It chooses the right prompt itself.

Example: Marketing vs business expert.

Let's dive in 🧵 Image
First, you have to decide which 'experts' you'd like to include.

I've chosen a marketing and business expert.

Then write the corresponding prompts. Image
Up next, assign the templates to the prompt info.

This list can be as long as you like.

Make sure you make the description of each prompt clear for the large language model. Image
Read 5 tweets
Jun 1
Want to summarize YouTube videos?

With @LangChainAI you can. In < 30 lines of code! 🤯

I've added this to my LangChain Cheat Sheet Github Repo (this name's tooooo long). Link's in the thread.

Here's the breakdown in 6 steps 🧵 Image
1/6 Import the essentials.

Make sure you've installed all basic packages + YouTube Transcript API & PyTube. Image
2/6 Load your OpenAI API key.

Always make sure you're doing this in a secure way! Image
Read 9 tweets
May 31
New colab!

@LangChainAI 🤝 @elastic

LangChain is a cutting-edge library to make large language models (LLMs) more usable and versatile.

In synergy with ElasticSearch, this powerful duo opens new doors in application development and search applications.

Let's dive in 🧵

#AI
LangChain is a toolbox providing a standard interface for LLMs & facilitating their integration with other tools.

It makes developing applications like chatbots, decision-making agents, and more, easier by blending LLMs with other computations & knowledge bases.
Who's it for?

@LangChainAI is perfect for developers looking to harness the potential of LLMs to build transformative applications.

From question-answering apps to intelligent agents, the scope of possibilities with LangChain is immense.
Read 8 tweets
May 30
Windows has just released Dev Home - a centralized control center for developers!👨‍💻👩‍💻

With Dev Home, you can monitor your projects, set up your dev environment, connect to your developer accounts and tools, and create a Dev Drive for storage all in one place!🤯
Use customizable widgets on the dashboard to monitor workflows, track your dev projects, coding tasks, GitHub issues, pull requests, available SSH connections, and system performance!📈📊
Connect your GitHub account to Dev Home and begin creating customized GitHub widgets for your dashboard! Learn more about the Dev Home GitHub extension and how to set up Windows notifications.👨‍💻👩‍💻

Dev Home extensions power the functionality of Dev Home's customizable widgets.
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(