My PDF Journey: Conversations with ChatGPT and a $7 Debt Lesson

Search for a command to run...

No comments yet. Be the first to comment.
In this series, I will be sharing my progress in learning and perfecting my NLP skills.
I identify as a very ambitious person. However, I am still learning how to combine my interests and actually get them done. Given that I want everything to be perfect, I tend to spend more time analysing and strategising. So rather than clustering al...
Over the years, we have seen amazing products, innovation, record-breaking activities and events, new discoveries, and new levels attained. I think a common fact in all of these events is that someone or some people decided to stick to what they beli...
Large Language Models (LLMs) are a series of AI models that have been trained on a large amount of data. This innovation is a result of years of trial and error, training computers to perform tasks. It started from simple tasks and progressed to more...
With so many new tools out there now (and you can even make your own), please do what you love. When the going gets tough or when it gets to a point that looks like diminishing returns, what would keep you holding on for that period is the love and p...
Artificial Intelligence is going to penetrate every sphere of humanity just like we had electricity. Humans are capable of inventing the next amazing innovation. The interesting fact about this is that, the previous revolution gives rise to the other...
Over the past few days, I have been exploring the idea of allowing ChatGPT to read my PDF documents and answer a few questions from them. Taking inspiration from the numerous ChatWithPDF software available, I decided to embark on a journey of building a small script in Google Colab, simply for the sake of the experience. In less than a few minutes, I discovered how expensive this approach can be, as the tokens used to converse with these documents kept increasing, meaning I was accumulating more debt each time I ran the script.
Below is a screenshot of the expenses I incurred after chatting with several PDFs. Spending so much on conversing with my PDFs ๐ฎ, I could have just read them myself ๐.

For this experiment, I employed a simple pre-processing technique in NLP, removing stopwords from the corpus of each PDF to reduce the length of the prompts I would be passing to GPT. Of course, this is not the only option for this kind of task; I chose it as a mini-project to reflect on my newly acquired NLP power ๐ช The image below displays the sum of all the tokens used, the original length of the PDFs, and the final length after the removal of stopwords.

I also need to mention that I could only pass 5-8 pages at most for each PDF, as the context window limit applies to some PDFs for documents with lengthy pages. In essence, I could only chat with a few of the documents I have.
With these results and my $7 debt, I conclude that using existing ChatWithPDF sites can be helpful, as I don't want to keep accumulating so much debt. Simultaneously, taking a closer look at this problem and my newfound superpower in NLP (due to a growing interest in machine learning, hence the reason for the mini-project), I challenge myself to figure out all the available and suitable techniques in NLP (RAG ๐ ?) I could employ it to reduce the cost of chatting with my PDFs.
In this series of blogs, I will be sharing my progress, and what I am learning, and hopefully, I won't incur much debt.