OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

LSR

LSR is a Python framework for defining, training and evaluating learned sparse information-retrieval methods. Its configurable, standalone modules cover datasets, losses, models, tokenization and training, and can be combined or integrated into another implementation.

Independent OpenViST project profile, based on linked sources.

LSR — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use LSR when you need a configurable research framework for training or evaluating learned sparse retrieval methods, or want reusable components for a retrieval implementation.

Who it is for

  • Researchers comparing learned sparse retrieval methods and training configurations.
  • Developers building retrieval experiments or incorporating modular retrieval components into an existing implementation.

Documented uses

  • Configure retrieval experiments using selectable datasets, models, losses and hyperparameters.
  • Train retrieval models using contrastive triplets or scored query-document pairs for distillation.
  • Generate query and document representations from trained models.
  • Prepare custom retrieval datasets in the formats expected by the framework.
Before you choose

Requirements & limits

The repository is public and licensed under Apache-2.0. The README specifies Python 3.9.12 and installing dependencies from requirements.txt.

  • The framework is modular, with separate components for datasets, losses, models, tokenization and training.
  • Custom data requires document and query mappings plus either training triplets or scored pairs.
  • The README warns that inference over document collections can take a long time and suggests partitioning the collection and using multiple GPUs.
  • The README documents optional Weights & Biases training reports and a setting to disable them.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Prepare a custom dataset for LSR training

Organize custom retrieval data in the formats LSR expects before configuring an experiment.

Before you start

  • A Python 3.9.12 Conda environment with LSR dependencies installed from requirements.txt.
  • A document collection mapping document_id to document_text.
  • A queries file mapping query_id to query_text.
  • Training triplets of query ID, positive document ID and negative document ID, or scored query-document pairs with relevance scores.

Steps

  1. Create and activate a Conda environment using Python 3.9.12.

  2. Install the project dependencies with pip from requirements.txt.

  3. Use the sample dataset configurations as templates and prepare the document collection, queries and one of the supported training-data formats.

  4. Use LSR’s dataset file-format guidance to configure the custom data.

Expected outcome

Custom retrieval data is organized in the input formats LSR describes, ready for use in a dataset and experiment configuration.

Guide limitations

  • This guide covers data preparation, not a completed training run; the README does not provide a full custom-dataset execution recipe here.
  • The README points to lsr/dataset_utils for file format details and refers to sample configurations under lsr/config/dataset; paths in the repository overview also show lsr/configs/dataset.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
thongnt99/learned-sparse-retrieval · Official homepage title · retained in its source language