Skip to content

Port 'LLM example retrieval' #641

Closed as not planned
Closed as not planned

Description

@Enkidu93

Port any relevant changes in sillsdev/machine.py#412 from machine.py to machine.

Activity

  1. added
    portingThis issue consists of porting code from machine.py to machine.
    on Nov 12, 2026
  2. claude commented on Nov 12, 2026

    @claude
    Contributor

    Claude finished @Enkidu93's task in 3m 54s —— View job • claude/issue-641-20261112-1529 • [Create PR ➔](https://github.com/sillsdev/machine/compare/master...claude/issue-641-20261112-1529?quick_pull=1&title=Issue%20%23641%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23641%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Ported machine.py PR #412 (LLM example retrieval)

    • Read issue and source PR
    • Ported Example, ExampleRetriever, TopKExampleRetriever, TfidfExampleRetriever, CoverageExampleRetriever, ExampleRetrieverFactory and ExampleRetrievalMethod to SIL.Machine.Translation.Llm, plus an internal TfidfIndex
    • Ported the tests (26 new tests, all passing)
    • ./local_check.sh --agent-strict: local_check: PASSED
    • Pushed and opened the PR

    PR: #642 (closes #641)

    Differences from the Python version

    • There is no scikit-learn or numpy equivalent here, so TF-IDF is a small internal sparse implementation that follows TfidfVectorizer defaults. It adds no new dependency.
    • Ties in ranking are broken by corpus order, because numpy leaves tie order unspecified.
    • Subclasses call Fit() at the end of their own constructor, because derived fields are not initialized yet when the base constructor runs.

    Not ported: pyproject.toml, uv.lock, the llm extra, __init__.py and the sklearn availability check. These are Python packaging only.
    · Branch

  3. moved this from 🆕 New to ✅ Done in Servalon Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    portingThis issue consists of porting code from machine.py to machine.

    Type

    No type

    Projects

    • Status
      ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions