Shrike bird logo # Blyx Shrike Combine lexical and semantic search results by rank, then walk the merged list in a deterministic order. A keyword ranker and an embedding ranker return scores on different scales. Reciprocal rank fusion combines each document’s position in the lists. It gives a developer an inspectable baseline before tuning a score calibration or training a reranker. [Cormack, Clarke and Buettcher, Reciprocal Rank Fusion](https://cormack.uwaterloo.ca/cormacksigir09-rrf.pdf) ## Install and run Install the Blyx 0.2.1 compiler and a Rust toolchain with a host linker. Clone the versioned release, then run its small example and regression suite. ```sh cargo install --locked --version 0.2.1 blyxc git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-shrike.git cd blyx-shrike blyxc native-run example.blyx blyxc native-run tests.blyx ``` Expected output from the small example ```text 17 83 ``` ## Merge two help-center searches A literal-word search and a paraphrase search return different article IDs. The example prints the first three fused results. Article 21 wins because both rankers put it near the top. ```sh blyxc native-run project.blyx ``` Project output ```text 1: 21 2: 18 3: 104 ``` [Run the portable example in the browser](https://www.blyx-lang.space/play?example=package-shrike) · [Follow the handbook exercise](https://doc.blyx-lang.space/guide/shrike) · [Download the release](https://github.com/Rahulchaube1/blyx-shrike/releases/tag/v0.1.0) ## Use the framework in your own project From the folder containing your entry file, clone the release into `vendor/shrike`. ```sh git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-shrike.git vendor/shrike ``` ```blyx use vendor::shrike::shrike; fn main() { let lexical = [41, 17, 83]; let semantic = [17, 83, 99]; let first = sh_next(lexical, semantic, 60.0, -1.0); let second = sh_next(lexical, semantic, 60.0, first); println!(first); println!(second); } ``` Run `blyxc native-run main.blyx`. Supply two ranked vectors of nonnegative integer IDs up to 2^53−1 and an offset from 0 to 1,000,000. The first occurrence in each list contributes 1/(offset + one-based position). Missing IDs contribute zero. Equal scores use ascending ID. Start the cursor at −1. Each next-result call can take quadratic time in the combined shortlist length; use this version with small candidate sets. | API | Behavior | | --- | --- | | `sh_valid_inputs(left, right, offset)` | Validate every ID and the smoothing offset. | | `sh_score(left, right, id, offset)` | Get the fused score of one document. Zero means absent and −1 means invalid input. | | `sh_next(left, right, offset, previous)` | Get the next ID after a cursor, or −1 for exhaustion or invalid input. Each ID is returned once. | ## Contribute When opening an issue, include the smallest reproducing Blyx input, the compiler version and the output you expected. [Source and issues](https://github.com/Rahulchaube1/blyx-shrike/issues) · [Blyx community](https://www.blyx-lang.space/community) Dual-licensed under [MIT](LICENSE-MIT) or [Apache-2.0](LICENSE-APACHE). ## Connect with Rahul Chaube [Portfolio](https://www.rahulchaube1.com/) · [GitHub](https://github.com/Rahulchaube1) · [LinkedIn](https://www.linkedin.com/in/rahulchaube1) · [Hugging Face](https://huggingface.co/oncody) · [X](https://x.com/RahulChaube_) · [EverestQ](https://www.everestqai.com/) · [Contact](https://www.rahulchaube1.com/contact) [Blyx website](https://www.blyx-lang.space/) · [BlyxTorch](https://www.blyx-lang.space/packages/blyxtorch) · [Handbook](https://doc.blyx-lang.space/) · [Community](https://www.blyx-lang.space/community) Support Rahul’s open-source work through [GitHub Sponsors](https://github.com/sponsors/Rahulchaube1) or [Buy Me a Coffee](https://buymeacoffee.com/rahulchaube).