Google put out several OpenStax textbooks in NotebookLM format.
One of our faculty was interested in how that’d work in physics but that was not one of the options currently available. Looking at what was happening, it just looked like they chopped up the PDF into chapters and pre-generated some of the NotebookLM studio options. I figured I could to that.
I downloaded the OpenStax University Physics book. It ended up being a fairly large file at ~75MB and it comes in as one big PDF.
After hand creating a separate chapter using Mac’s preview, I became very interested in automating that process. I got Claude to do it based on the PDF chapter markers with a smaller file but Claude won’t handle files that big. ChatGPT choked.
Seeing that both systems were doing it via Python, I opted to just generate the code and do it on my own computer. In this case I used Thonny as my Python IDE. Middlebury’s computer science department uses Thonny in some intro courses.
from PyPDF2 import PdfReader, PdfWriter
def split_by_bookmarks(input_path):
reader = PdfReader(input_path)
outlines = reader.outline
# Get top-level bookmarks (chapters)
chapters = []
for item in outlines:
if isinstance(item, dict): # Top-level bookmark
page_num = reader.get_destination_page_number(item)
chapters.append((item['/Title'], page_num))
# Split into separate PDFs
for i, (title, start) in enumerate(chapters):
end = chapters[i + 1][1] if i + 1 < len(chapters) else len(reader.pages)
writer = PdfWriter()
for page_num in range(start, end):
writer.add_page(reader.pages[page_num])
# Clean filename from title
filename = f"{title}.pdf".replace('/', '-')
with open(filename, 'wb') as output:
writer.write(output)
print(f"Created: {filename}")
split_by_bookmarks('University_Physics_Volume_1_-_WEB.pdf')
I put the script and the source file in the same directory and then ran it. Worked like a charm.
After running that, I had all the PDF in chapters and uploaded them to NotebookLM. I selected just chapter 1 and pre-generated some flashcards, an audio overview, etc. Given the creation limits, you’ll need to think through pacing if you want to create similar options for each chapter. Another path would be to create smaller notebooks with chapter groupings.
I need to adjust the script to add leading zeroes to the chapters and think through a few other things but it’s a decent start.
If you want to explore it here’s a link to copy I made on my personal Google account.
Interesting that when ChatGPT chokes on some of my much simpler requesters its like here is the python code you can run locally, and I am like really? Is this all that heaven allows? 🙂
As the final resident of Non-Programmistan I feel we need to be even stricter. The promise of AI is encroaching on my freedom from coding.
Yeah, it’s clearly not quite as clean as advertised. It’s still really handy to know some programming and random crap like Thonny.
In my head, they should be able to work this out. I imagine you could make it so that the AI could spin up little Docker containers rather than the relatively limited sandboxes it does now. I don’t know that would cost and I don’t really know aht I’m talking about but the words seems really great!
I don’t know about OpenStax PDF structures, but I did a project for BCcampus prepping their Pressbooks PDF content into smaller chunks for Kolibri. The $ Adobe acrobat did a clean split on chapter structure.
On some quick spins one can feel like the NotebookLLM approach can make for a more curious mind approach to learning Physics. But the thing is you don’t know for sure if students will get a dynamic experience or served info not correct or missing key elements. It’s a crapshot.
There’s also a laden assumption that ifs spinning off of a fixed piece of content it won’t stray from its bounds I see no reason to be assured it won’t deliver faulty reasoning, wrong info, it will just sound like a confident know it all,
I just see NotebookLM as a rich search with some bells and whistles. It is designed so you can click through to the source for validation. You have to do that though. It requires both the interest and the time. I also just see it as a piece of a lot of other pieces. I’m sure someone will sell this as a self-contained MOOC magic education system but that’s not where I see it fitting.
I don’t think it’s necessary to trust any of the technology/information (rather I encourage the opposite). I see how problems can/do occur. I don’t know if those problems are greater than the problems I see with interactions with other types of media (or people for that matter). They feel very much the same, only mechanical. This paper on media coverage of scientific research has a pretty parallel set of issues.
On my end, I just see LLMs as a layer over the Internet and a bunch of books and other stuff. I don’t expect it to be right all the time. I don’t expect it not to tell me how to make some dangerous thing. Why would I? That’s not how the Internet works. I expect bias, nonsense, etc. I also expect good and useful things and a better ratio there if I know what I’m doing.
I want people to be interested in verifying information and who have the right skills to do that kind of investigation. I always wanted to teach a course as an unreliable narrator. I feel like that’s how I treated my relatives, instructors, friends, and teachers. I’m not entirely reliable. My kids should investigate things I say, even when I’m pretty confident.
It looks like with Google Enterprise, I could automate this whole thing . . . upload PDF here, chop to chapters, generate notebook, upload chapters, generate audio overview . . .
https://docs.cloud.google.com/gemini/enterprise/notebooklm-enterprise/docs/api-notebooks