Live data from Hacker News

Show HN: Semantic Grep – A Word2Vec-powered search tool

github.com

21–30 of 58 posts

Re: Show HN: Semantic Grep – A Word2Vec-powered search tool

#21

Earlier quoted context omitted.

I wanna meet the person who greps die, kick the bucket and buy the farm lol Are models like mistral there yet in terms of token per second generation to run a grep over millions of files?

Mistral has published large language models, not embedding models? sgrep uses Google's Word2Vec to generate embeddings of the corpus and perform similarity searches on it, given a user query.

No I got that I asked because wouldn’t embedding generated by fine tuned transformer based LLMs be more context aware? Idk much about the internals so apologies if this was a dumb thing to say

Re: Show HN: Semantic Grep – A Word2Vec-powered search tool

#23

This is a good idea. I'm going to offer some unsolicited feedback here: The configuration thing is unclear to me. I think that "current directory" means "same directory as the binary", but it could mean pwd. Neither of those is good: configuration doesn't belong where the binaries go, and it's obviously wrong to look for configs in the working directory. I suggest checking $XDG_CONFIG_HOME, and defaulting to `~/.conf…

I take a Show HN to be a solicitation for feedback.

It took me a few tries to get this to run. I tried passing -model_path, but it complained that it couldn't find config.json. I then made a config.json in the pwd (which contained the executable), but it couldn't expand "~". I then tried searching *.txt, but it couldn't find anything unless I specified just one file.

In terms of offering an experience similar to grep, it's a lot slower. It's not quite as slow with the SLIM file, but I wonder if there's some low-hanging fruit for optimization. Perhaps caching similarity for input tokens?

Re: Show HN: Semantic Grep – A Word2Vec-powered search tool

#27
post #26
post #25

Fyi, there is already a widely used tool along with a company called semgrep, which stems from semantic grep: https://semgrep.dev/ .

The similarities between semgrep and the linked tool start and end with the name.

Yes, you are right.

Re: Show HN: Semantic Grep – A Word2Vec-powered search tool

#30
I wonder if it would be possible to easily add support for multiple CPUs? It seems to be taking at most 150% CPU, so on my workstation it could be (assuming high parallellism) 10 times as fast.

Alas the word2vec repository has reached its quota:

    fetch: Fetching reference refs/heads/master
    batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
    error: failed to fetch some objects from 'https://github.com/mmihaltz/word2vec-GoogleNews-vectors.git/info/lfs'

So here are another sources I found for it: https://stackoverflow.com/a/43423646

I also found https://huggingface.co/fse/word2vec-google-news-300/tree/mai... but I'm unsure if that's the correct format for this tool. The first source from Google Drive seems to work and there's little chance of being malicious..

Post reply on HN