Challenges with semantic search on transcribed audio files
notjoemartinez.com
notjoemartinez.com
I wonder if a similar idea would work here, where you could search at various “zoom levels” - first search for an entire video that’s nearby in terms of embedding, then search within 50%-overlapped 60-second chunks, then within 50%-overlapped 1-second chunks.
0.4ms per embedding is far longer than I’d have expected. I haven’t worked in this space just yet, so I lack knowledge and am curious: how big is each embedding? A few hundred numbers? The bottleneck here is Python, right? How fast is it with Chroma?
—⁂—
Search difficulties in the presence of intermingled metadata and data is not a new problem. I detest issue templates on GitHub because they’re putting everything into one freeform text field, and any keyword that’s part of the template becomes completely unsearchable, because every issue matches the query. This has bitten me more than a few times.
Your fundamental problem is that short snippets don’t have a lot of semantic meaning, but long snippets lose specificity. So one way of dealing with that would be to include staggered snippets, like bricks in a wall. This is ultimately a hack though, and for a lot of queries it doesn’t even make sense. If it’s a semantic match and not a direct text match, what does it even mean to give people a short segment?
For example:
https://freeling-user-manual.readthedocs.io/en/v4.2/modules/...
or similar from spaCy or NLTK. and then somehow get to content driven paragraph type splitting.
If it's tweets, it makes sense to use shorter chunks.
I was dissatisfied with the results of chunks "broken off" from sentences, so I use nltk to find sentence boundaries and then approximate the lengths of chunks. I also built a custom splitter function for Jinja2 that will chunk by length, page offset, and also does overlaps, where bits of the beginning and ends of a chunk will run into the previous and next chunk.
I have a pipeline for this particular type of use, running on an Open Source thing I built to handle indexing texts: https://mitta.ai. The RAG pipeline is under cookbooks.
Do you also use nltk to extract keyterm then? I was looking at Qdrant labels and thinking about how vectors could be labeled with location metadata but also perhaps with named entity information from the chunk.
I imagine it how I might flip though a book using the index and also table of contents and then perhaps skim the intro paragraphs etc. Eventually the RAG systems need to replicate a more sophisticated human like retrieval of relevant information.
One issue would be that the prompt for keyterm extraction might miss crucial keyterms, but a subsequent access of those might update them...