Dense embeddings did not make lexical retrieval obsolete: every serious RAG system still runs BM25 or TF-IDF alongside them, because exact tokens like error codes and product SKUs are where embeddings quietly fail.
Implement tfidf(documents) taking a list of strings and returning (matrix, vocabulary):
vocabulary is the sorted list of unique terms across all documentsmatrix has shape (n_documents, n_terms) with cell [i, j] = tf × idfYou have read the opening. The rest is free with a Bezen account, and no card is needed.
Behind the sign-in