Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
=======================================
Coverage 99.65% 99.65%
=======================================
Files 99 100 +1
Lines 7446 7520 +74
=======================================
+ Hits 7420 7494 +74
Misses 26 26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closed
|
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.



2nd part of #813, after PR #863
This PR implements the core functionality needed for experimenting with "flexible fusion", i.e. making it possible to apply Annif backends not just on document text, but metadata fields. It enables the following:
metadatafield within Document objects.selectcan be used to select which parts of a document (main text and/or metadata fields) are given as input to the backend. For exampleselect(title)orselect(title,description,text)Implementation notes
textis a mandatory field, whilesubject_setandmetadataare optional (defaulting to empty set and empty dict, respectively)transform_text(to transform text only, similar as before) ortransform_doc(transform whole Document objects). The latter was needed to implement theselecttransform.Currently, this PR is targeting the PR branch of Flexible fusion part 1: CSV short-text document corpus format #863 because this is built on top of that.It needs to be merged after Flexible fusion part 1: CSV short-text document corpus format #863.What is still missing
This PR implements only the minimum needed for experimentation with custom metadata and select transforms: it should now be possible to train and evaluate models with custom document metadata, as long as the CSV short text corpus format is used.
These parts are still missing, to be implemented in future PRs:
httpbackend should support it