Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding weights param for combination technique #235

Conversation

martin-gaievski
Copy link
Member

Description

Adding parameter "weights" for combination technique in normalization processor. Weights are use to multiply scores for each sub-query from the Hybrid search query. Weights are mapped to sub-query based on position (index), if there are less weights provided we use "1.0" for the rest of sub-query scores. If there are more weights provided we take first N and ignore the rest.

Parameter is set as part of the search pipeline, example of such request:

{
    "description": "Post processor for hybrid search",
    "phase_results_processors": [
        {
            "normalization-processor": {
                "normalization": {
                    "technique": "min_max"
                },
                "combination": {
                    "technique": "arithmetic_mean",
                    "parameters": {
                        "weights": [
                            0.4, 0.7
                        ]
                    }
                }
            }
        }
    ]
}

Issues Resolved

#228, part of solution for #126

Check List

  • All tests pass
  • New functionality has javadoc added
  • Commits are signed as per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
skip

@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #235 (4d76945) into feature/normalization (2224f1f) will increase coverage by 0.40%.
The diff coverage is 95.45%.

@@                     Coverage Diff                     @@
##             feature/normalization     #235      +/-   ##
===========================================================
+ Coverage                    85.55%   85.95%   +0.40%     
- Complexity                     296      310      +14     
===========================================================
  Files                           24       24              
  Lines                          872      904      +32     
  Branches                       134      137       +3     
===========================================================
+ Hits                           746      777      +31     
  Misses                          67       67              
- Partials                        59       60       +1     
Files Changed Coverage Δ
...rmalization/MinMaxScoreNormalizationTechnique.java 84.61% <ø> (ø)
...ation/ArithmeticMeanScoreCombinationTechnique.java 92.30% <94.11%> (+12.30%) ⬆️
...processor/combination/ScoreCombinationFactory.java 100.00% <100.00%> (ø)
...ocessor/factory/NormalizationProcessorFactory.java 100.00% <100.00%> (ø)
...essor/normalization/ScoreNormalizationFactory.java 100.00% <100.00%> (ø)

@martin-gaievski martin-gaievski force-pushed the add_algo_params_for_combination branch from 751db4d to e320ed3 Compare July 27, 2023 17:18
@martin-gaievski martin-gaievski merged commit fe72dbc into opensearch-project:feature/normalization Jul 28, 2023
14 checks passed
martin-gaievski added a commit that referenced this pull request Aug 3, 2023
* Adding weights param for combination technique

Signed-off-by: Martin Gaievski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants