https://github.com/bigbuildbench/mixedbread-ai_baguetter
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.7%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: BigBuildBench
- License: apache-2.0
- Language: Python
- Default Branch: master
- Size: 94.7 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Baguetter
Baguetter is a flexible, efficient, and hackable search engine library implemented in Python. It's designed for quickly benchmarking, implementing, and testing new search methods. Baguetter supports sparse (traditional), dense (semantic), and hybrid retrieval methods.
Note: Baguetter is not built for production use-cases or scale. For such use-cases, please check out other search engine projects.
Paper: https://arxiv.org/abs/2408.06643
Features
- Sparse retrieval using BM25 and BMX algorithms
- Dense retrieval using embeddings
- Hybrid retrieval combining sparse and dense methods
- Customizable text preprocessing pipeline
- Multi-threaded indexing and searching
- Evaluation tools for benchmarking
- Easy integration with HuggingFace datasets and models for sharing
- Hackable interface to quickly implement new methods
Installation
bash
pip install baguetter
Quick Start
```python from baguetter.indices import BMXSparseIndex
Create an index
idx = BMXSparseIndex()
Add documents
docs = [ "We all love baguette and cheese", "Baguette is a great bread", "Cheese is a great source of protein", "Baguette is a great source of carbs", ] doc_ids = ["1", "2", "3", "4"]
idx.addmany(docids, docs, show_progress=True)
Search
results = idx.search("quick fox") print(results)
Search many
results = idx.search_many(["quick fox", "baguette is great"]) print(results) ```
Evaluation
Baguetter includes tools for evaluating search performance on standard benchmarks:
```python from baguetter.evaluation import datasets, evaluate_retrievers from baguetter.indices import BM25SparseIndex, BMXSparseIndex
results = evaluateretrievers(datasets.mtebdatasetssmall, {"bm25": BM25SparseIndex, "bmx": BMXSparseIndex}) results.save("evalresults") ```
Documentation
For more detailed usage instructions and API documentation, please refer to the full documentation.
Contributing
Contributions are welcome! We are using the GitHub Pull Request workflow. Either open an issue first and create a PR or include a comprehensive commit message when opening a PR.
To get started, please create a clone of the repo (or a fork). We recommend working in a virtual environment.
```sh python -m pip install -e ".[dev]"
pre-commit install ```
To test your changes, run:
sh
pytest
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Acknowledgements
Baguetter builds upon the work of several open-source projects:
retriv by AmenRa: Baguetter is a fork of retriv, adjusting it to our needs.
bm25s by xhluca: Our BM25 implementation is based on this project, which provides an efficient and effective implementation of the BM25 algorithm with different scoring functions.
USearch by unum-cloud and Faiss by facebook research for dense retrieval.
Please check out the respective repositories and show some appreciation to the authors.
Citing
@article{li2024bmx,
title={BMX: Entropy-weighted Similarity and Semantic-enhanced Lexical Search},
author={Xianming Li and Julius Lipp and Aamir Shakir and Rui Huang and Jing Li},
year={2024},
eprint={2408.06643},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2408.06643},
}
Owner
- Name: BigBuildBench
- Login: BigBuildBench
- Kind: organization
- Repositories: 1
- Profile: https://github.com/BigBuildBench
abbr. B3, benchmarking the repo-level understanding capability of your LLMs by reconstructing project build-file.
GitHub Events
Total
- Create event: 4
Last Year
- Create event: 4
Dependencies
- actions/cache v4 composite
- actions/setup-python v5 composite
- ./.github/actions/uv_setup * composite
- actions/checkout v4 composite
- ./.github/actions/uv_setup * composite
- actions/checkout v4 composite
- actions/download-artifact v4 composite
- actions/upload-artifact v4 composite
- ncipollo/release-action v1 composite
- pypa/gh-action-pypi-publish release/v1 composite
- ./.github/actions/uv_setup * composite
- actions/checkout v4 composite
- ./.github/actions/uv_setup * composite
- actions/checkout v4 composite
- actions/download-artifact v4 composite
- actions/upload-artifact v4 composite
- pypa/gh-action-pypi-publish release/v1 composite