Hello lainons. I've been collecting PDFs. I have a lot of papers and books.
I did not read all of them, they are there, ready to be consumed if needed.
They are mostly good books and papers, cherry-picked by me or other people I esteem.
Around 2019, after seeing one of the book threads, I wanted to create something that could help me, my friends and other lainons sharing our own personal book collection. Back then I was thinking about a protocol to sync catalogs.
Time passed and I recently realized I can't organize a catalog. I can't find a suitable way to split my catalog in categories or sort it by topic. Maybe you found a way. But I may also be able to find a counter example that wouldn't fit my needs, more or less like one finds irrational numbers in the rational field.
Aside me digressing, I started building a simple search engine. It turns out to be a good solution for my arrangement problem. I will discuss about this later on.
What do you lainon use to solve this?
Is there already a solution I don't know?
How do you lookup for papers you don't know about?
I'm aware of Google dorks, Google Scholar, Arxiv, eprint.iacr and if you want to suggest something else you are welcome.
I always find crap in betweens or even duplicates, how do you remove those from your search results?
Going back to the original idea, I think there are two really important things in this system.
We already share documents and files, somehow. We already have ways to update each other, whether it is irc or a simple rss feed. So we don't need that.
The key elements are two: a list of books and an index of those books.
The latter is enough to lookup in someone else's library for some book we don't have on a specific topic we are researching.
The former will allow us to find such book either buying a copy or by other means. The former will also allow us to insert tags to extend the information about a book.
In this system I can search in someone else's index. I may even download the index for offline search, mirroring or even merging.
Up here you are already seeing a data structure where we have two tables, one for the list and another for the index.
So how do you search? There are simple and yet effective methods: tfidf (term frequency-inverse document frequency) and vsm (vector space model). You compare the documents vectors with the query vector to find the most similar (I won't explain here how this works, but you can search the cosine theorem).
I find this method to be the most effective in terms of size and time. I must admit that creating the index is rather slow for now and maybe using tries (special trees) or DAFSAs (deterministic acyclic finite state automatons) could help me counting the frequencies faster.
Do you think there are better ways of counting and comparing? Would caching intermediate results be efficient?
Now that we saw the engine underneath, we shall discuss about the two vehicles. Yes, two. We should have a personal tractor for editing such database and a car for getting where we want really fast. I wish to call the former corpus and the latter eureka.
Corpus will take care or importing documents, adding and removing tags and other information like multiple ISBN and links, and even merging and exporting databases. It will also be able to perform searches, but it is meant for back office only.
Eureka will be the front facing service so you and other can easily search. I don't know how complicated this can become. It can be as simple as a command line tool, up to a web page with users and whatever users find useful. But it must allow for both searching and downloading the index.
I already have implemented a version of corpus. It uses S-expression as index, just because it works. I tried SQLite but I wasn't able to get the desired performance. After some tweaks I can search five terms in less than one second in 114 documents. The total pool of documents is 706MB and the index is 9.7MB.
I have not refined the data structure enough to be extensible and I don't have a good tool to do it yet, so for now I can only incrementally import documents.
Here you can find the current public state of my code: https://github.com/1dotd4/corpus
To get a stream of words out of a PDF I chose pdftotext.
In the end, what I hope it will happen is that anybody having a curated list of papers and books will actually index such list and share it so everybody can search.