Draft
Conversation
Co-authored-by: Copilot Co-authored-by: Osma Suominen <[email protected]>
This is mainly workaround for differing model names in Ollama and HFH, which complicates tokenizer selection
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #859 +/- ##
==========================================
- Coverage 99.64% 97.56% -2.09%
==========================================
Files 99 100 +1
Lines 7349 7509 +160
==========================================
+ Hits 7323 7326 +3
- Misses 26 183 +157 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds exponentiated weighted averaging to suggestions and implements an LLM-based ensemble backend for ranking and scoring.
- Extend
SuggestionBatch.from_averagedto accept an optionalexponentsparameter for score exponentiation. - Introduce
BaseLLMBackendandLLMEnsembleBackendwith OpenAI/AzureOpenAI integration and parallel prompt processing. - Register the new
llm_ensemblebackend in the backend factory.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| annif/suggestion.py | Added exponents parameter and updated averaging logic/docstring. |
| annif/backend/llm_ensemble.py | New LLM ensemble backend: API calls, prompt handling, ensemble logic. |
| annif/backend/init.py | Registered llm_ensemble backend. |
Comments suppressed due to low confidence (2)
annif/suggestion.py:125
- [nitpick] Update the docstring for
from_averagedto include a description of the newexponentsparameter and its default behavior.
"""Create a new SuggestionBatch where the subject scores are the
annif/backend/llm_ensemble.py:263
- [nitpick] Add a brief docstring to
_get_labels_batchto clarify its behavior and inputs, improving code readability.
def _get_labels_batch(self, suggestion_batch: SuggestionBatch) -> list[list[str]]:
Co-authored-by: Copilot <[email protected]>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #856.