Challenges with semantic search on transcribed audio files
notjoemartinez.com
Challenges with semantic search on transcribed audio files
1–10 of 13 posts
Re: Challenges with semantic search on transcribed audio files
#2Re: Challenges with semantic search on transcribed audio files
#3Re: Challenges with semantic search on transcribed audio files
#4I've been trying to solve a problem with implementing semantic search on my YouTube search engine yt-fts ( https://github.com/NotJoeMartinez/yt-fts ). I've managed to substantially speed up search results by storing subtitle embeddings in Chroma. But a bigger problem has been with how to properly segment the text in a way that accounts for the duration and context of word embeddings while returning precise time stamp…
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.
Re: Challenges with semantic search on transcribed audio files
#5Re: Challenges with semantic search on transcribed audio files
#6For 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.
Re: Challenges with semantic search on transcribed audio files
#7My sense is the general version of this problem is not solved in that chunking/splitting algorithms for processing content into vector dbs need to be made significantly more sophisticated and leverage more traditional NLP algorithms. 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.
Re: Challenges with semantic search on transcribed audio files
#8My sense is the general version of this problem is not solved in that chunking/splitting algorithms for processing content into vector dbs need to be made significantly more sophisticated and leverage more traditional NLP algorithms. 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.
I've found that 512 characters, more or less, is a good length for embeddings. More than that, and a bunch of models will just ignore the text. Less than half that, there isn't always enough context in the text to be able to group the chunks by keyterm or other labels. I do this type of additive context using the first few results from the embedding search. If it's tweets, it makes sense to use shorter chunks. I was…
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.
Re: Challenges with semantic search on transcribed audio files
#90.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.
Re: Challenges with semantic search on transcribed audio files
#10Your 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?