Curator icon indicating copy to clipboard operation
Curator copied to clipboard

Update language-management/index.md

Open arhamm1 opened this issue 1 year ago • 1 comments

Description

Usage

# Add snippet demonstrating usage

Checklist

  • [ ] I am familiar with the Contributing Guide.
  • [ ] New or Existing tests cover these changes.
  • [ ] The documentation is up to date with these changes.

arhamm1 avatar Nov 20 '25 20:11 arhamm1

Greptile Overview

Greptile Summary

This PR significantly expands the language management documentation with detailed explanations, code examples, and troubleshooting guidance. The changes include:

  • Added comprehensive overview section explaining language processing capabilities
  • Added prerequisites section detailing FastText model requirements
  • Added multiple code examples demonstrating basic and complete language filtering pipelines
  • Added troubleshooting section for common issues

Issues found:

  • Duplicate @processing_stage decorator on lines 176-177 that will cause errors
  • DocumentBatch constructor missing required _metadata and _stage_perf parameters
  • Previous review threads identified additional issues with CommonCrawlWarcDownloader usage and FastTextLangId output format documentation that should be addressed

Confidence Score: 2/5

  • Documentation changes with code examples that contain errors - examples would fail if copied directly
  • Score of 2 reflects that while the documentation improvements are valuable, the code examples contain syntax errors (duplicate decorator) and incomplete API usage (missing DocumentBatch parameters) that would cause issues for users following the documentation.
  • docs/curate-text/process-data/language-management/index.md - code examples need fixes for duplicate decorator and DocumentBatch constructor

Important Files Changed

File Analysis

Filename Score Overview
docs/curate-text/process-data/language-management/index.md 2/5 Documentation overhaul with expanded language management examples. Contains duplicate decorator, incorrect output format documentation, and uses internal class CommonCrawlWarcDownloader instead of public API.

Sequence Diagram

sequenceDiagram
    participant User
    participant JsonlReader
    participant ScoreFilter
    participant FastTextLangId
    participant FilterStage
    participant JsonlWriter

    User->>JsonlReader: Load JSONL documents
    JsonlReader->>ScoreFilter: DocumentBatch
    ScoreFilter->>FastTextLangId: score_document(text)
    FastTextLangId-->>ScoreFilter: "[score, 'LANG_CODE']"
    ScoreFilter->>ScoreFilter: keep_document(score >= threshold)
    ScoreFilter->>FilterStage: Filtered DocumentBatch
    FilterStage->>FilterStage: Parse language, filter by code
    FilterStage->>JsonlWriter: English-only DocumentBatch
    JsonlWriter->>User: Curated JSONL output

greptile-apps avatar Nov 20 '25 20:11 greptile-apps