Skip to content
This repository was archived by the owner on May 5, 2026. It is now read-only.

feat(doctest): Instruction/response pair extraction (GH-7)#31

Open
noahgift wants to merge 1 commit into
feat/decontaminatefrom
feat/instruct-pairs
Open

feat(doctest): Instruction/response pair extraction (GH-7)#31
noahgift wants to merge 1 commit into
feat/decontaminatefrom
feat/instruct-pairs

Conversation

@noahgift

@noahgift noahgift commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add InstructExtractor to extract Python function signature + docstring → instruction/response JSONL pairs for fine-tuning
  • Handle single-line and multi-line docstrings, deduplication, configurable body length filters
  • Fix Rust regex multiline \s* indent capture bug (use [^\S\n]* to exclude newlines)
  • 6 tests all passing, 460 lines (under 500-line pmat limit)

Test plan

  • cargo test --features doctest -p alimentar -- doctest::instruct::tests (6/6 pass)
  • Wire into apr data prep subcommand in aprender
  • End-to-end test with real Python corpus

🤖 Generated with Claude Code

…ource (GH-7)

Extract Python function signature + docstring as instruction and function body
as response, producing JSONL pairs suitable for fine-tuning. Handles single-line
and multi-line docstrings, deduplication, and configurable body length filters.

Key fix: Use [^\S\n]* instead of \s* for indent capture to prevent newline
from inflating base_indent in Rust regex multiline mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant