Solving Real-World Data Science Problems with LLMs! (Historical Document Analysis) @KeithGalli
Solving Real-World Data Science Problems with LLMs! (Historical Document Analysis)  @KeithGalli
Uploaded March 2024 | Updated November 2026, 3 hours ago
Learn data skills with hands-on exercises & tutorials at Datacamp!
datacamp.pxf.io/c/3588040/1012793/13294

In this video we walk through the process of analyzing historical documents using Python & Large Language Models. We start by setting up LLMs using both closed-source (OpenAI API) and open-source (Llama 2 via Ollama) options. Next, we walk through how we can leverage the LLMs to parse out entities from text. After this we actually start playing around with our data, loading in a specific subcategory of documents from Kaggle and see how we can connect pages from the same documents together. Once this is completed, we repeat the entity parsing process for our actual data to get pieces of information such as names, ages, and locations from our documents. Finally we analyze these entities to learn some insights from our document database.

Kaggle Dataset: kaggle.com/datasets/keithgalli/freedmens-bureau-historical-documents
GitHub Repo: github.com/keithgalli/historical-docs-analysis
Project Website: freedmensbureau.info

Contributors:
Abdessalem Boukil (NLP Research & Analysis): linkedin.com/in/abdessalem-boukil-37923637
Trent Self (Kaggle Dataset Setup): linkedin.com/in/trentonself

If you enjoyed this project video, make sure to throw it a thumbs up & subscribe! Let me know in the comments if you have any questions. It would also be helpful for people to upvote the Kaggle dataset for visibility!

---------------------------

Video timeline!
0:00 - Video Overview & Reference Material
3:05 - Data & Code Setup
5:04 - Task #0: Configure LLM to use with Python (OpenAI API)
20:10 - Task #0 (continued): LLM Configuration with Open-Source Model (LLama 2 via Ollama)
27:39 - Task #1: Use LLM to Parse Simple Sentence Examples
41:22 - Sub-task #1: Convert string to Python Object
44:29 - Task #1 (continued): Use Open-Source LLM to Parse Sentence Examples w/ LangChain
56:24 - Quick note on a benefit of using LangChain (easily switching between models)
58:06 - Task #2 (warmup): Grab Apprenticeship Agreement rows from Dataframe
1:06:22 - Task #2: Connect Pages that Belong to the Same Documents
1:56:36 - Task #3: Parse out values from merged documents
2:12:44 - Task #4 (setup): Analyze Results
2:17:52 - Fixing up our results from task #3 quickly
2:20:41 - Task #4: Find the average age of apprentices in our merged contract documents
2:30:59 - Other analysis, wlho had the most apprentices?

-------------------------
If you are curious to learn how I make my tutorials, check out this video: youtu.be/LEO4igyXbLs

Practice your Python Pandas data science skills with problems on StrataScratch!
stratascratch.com/?via=keith

Join the Python Army to get access to perks!
YouTube - youtube.com/channel/UCq6XkhO5SZ66N04IcPbqNcw/join
Patreon - patreon.com/keithgalli

*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.
Solving Real-World Data Science Problems with LLMs! (Historical Document Analysis)Learning the Polars DataFrame Library!Learn Python, Programming, & Data Science | Channel TrailerSolving 100 Python NumPy Problems! (From easy to difficult)I wrote a program to automatically post a video if I hit 1000 subscribers!How to Generate Analytics Reports (pdfs) in Python! (Quarto Tutorial)How to make your GitHub more impressive to Employers! (5 simple tips)Why Should you Learn Python? - Simple Installation & Setup for Windows, Mac, & Linux!How to Program Connect 4 in Python! (part 3) - Background GraphicsCreate Time Series Animations in Python with Matplotlib! (Line Graphs)How to win at Othello: Corner & Edge StrategiesFull Python Portfolio Project! Create a smart program to download & transcribe top podcasts.
Keith Galli |

Solving Real-World Data Science Problems with LLMs! (Historical Document Analysis)

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER