Evo parallel index building

From OpenLAIR/OpenSkill · View interactive version

Evo parallel index building is an AI agent skill from the GitHub repository OpenLAIR/OpenSkill. Provides utilities for parallelizing TF-IDF inverted index construction using a MapReduce approach - chunking documents, computing local TF and DF in worker processes, merging partial results, and finalizing TF-IDF scores with global DF.

How to use this skill

Skill file

Parallel TF-IDF Index Building

Overview

Parallelizes TF-IDF index construction using MapReduce:

  1. Chunk: Split documents into chunks
  2. Map: Workers compute local TF and DF per chunk
  3. Reduce: Merge partial results (Counter.update for DF, dict.update for TF)
  4. Finalize: Compute IDF and TF-IDF scores, build inverted index

Key Formulas (matching sequential.py)

Usage

import sys
sys.path.insert(0, '/app/environment/skills/evo-parallel-index-building/scripts')
from utils import (
    chunk_documents,
    map_index_chunk,
    merge_partial_results,
    finalize_tfidf_scores,
    build_tfidf_index_parallel,
    tokenize,
    compute_term_frequencies
)

# Build index
index_dict, elapsed, num_docs, vocab_size = build_tfidf_index_parallel(
    documents, num_workers=4, chunk_size=500
)

Functions

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.