vruksha
Four problems, and none of them needs a model.
| problem | how it is solved |
|---|---|
| what the entities are | AST symbols for code, yake keyphrases for prose |
| which mentions are the same thing | embeddings propose, a lexical guard decides |
| what connects to what | PMI over co-occurrence windows |
| what to do with the graph | personalised PageRank, fused as a third search leg |
from litesearch import database
from vruksha import build_graph, resolve_entities
db = database('corpus.db')
build_graph(db, rows, emb_fn=enc) # entities and co-occurrence edges
resolve_entities(db) # `hnsw` and `HNSW index` become one node
db.graph_search('how does resolution work', qemb, graph_w=0.5)
The lexical guard
Embedding similarity alone merges python 3.11 into python 3.12. _lex_ok requires token
overlap, matching digits and a matching acronym before a merge goes through.
from vruksha.entities import _lex_ok
_lex_ok('usearch', 'usearch index'), _lex_ok('python 3.11', 'python 3.12')
When to turn the search leg on
Measured against plain hybrid search:
- Regulation and legal text: a loss. p_mrr 0.8170 for plain hybrid against 0.7395, 0.6859 and
0.6463 at
graph_w0.25, 0.5 and 1.0, at two to four times the latency. - Papers and prose: a win. Better in seven of nine paired-bootstrap comparisons, +0.0387
target MRR on arXiv at
graph_w=1.0.
So graph_search is opt-in by name and off by default. Turn it on for a corpus whose entities
carry meaning, and raise graph_w towards 1.0 when you do.
Install
pip install vruksha
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vruksha-0.0.2.tar.gz.
File metadata
- Download URL: vruksha-0.0.2.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e4cd1fe352883d6d65be57f6d93495b6e88861f24df1eff31c189d9d1508cc6
|
|
| MD5 |
c2f8d3db7e4198d661d56ff0795e454e
|
|
| BLAKE2b-256 |
00b195ca8628b9354bda44d6bc6708ce455f962e855e45f24234205c4f6d46b3
|
File details
Details for the file vruksha-0.0.2-py3-none-any.whl.
File metadata
- Download URL: vruksha-0.0.2-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be2c2cc1acc3c563ca9de50b1d07e47e715402f0537f76138acae68d4aa2a3f9
|
|
| MD5 |
bc63d834c689394b95518a2e278ed4dd
|
|
| BLAKE2b-256 |
04796bd4d62b02070cd3b9d0d5f73fbdfb0c9456de10c4e28bdbdbb8c57402c5
|