diff --git a/docs/tutorials/rerank/rerank_pipeline_with_bge-rerank-m3-v2_model_deployed_on_Sagemaker.md b/docs/tutorials/rerank/rerank_pipeline_with_bge-rerank-m3-v2_model_deployed_on_Sagemaker.md index 238f62300e..10b317da4a 100644 --- a/docs/tutorials/rerank/rerank_pipeline_with_bge-rerank-m3-v2_model_deployed_on_Sagemaker.md +++ b/docs/tutorials/rerank/rerank_pipeline_with_bge-rerank-m3-v2_model_deployed_on_Sagemaker.md @@ -59,10 +59,39 @@ result = predictor.predict(data={ ] }) -print(json.dumps(sorted(result, key=lambda x: x['index']), indent=2)) +print(json.dumps(result, indent=2)) ``` -The reranking results are as follows: +The reranking result is ordering by the highest score first: +``` +[ + { + "index": 2, + "score": 0.92879725 + }, + { + "index": 0, + "score": 0.013636836 + }, + { + "index": 1, + "score": 0.000593021 + }, + { + "index": 3, + "score": 0.00012148176 + } +] +``` + +You can sort the result by index number. + +```python +print(json.dumps(sorted(result, key=lambda x: x['index']),indent=2)) + +``` + +The results are as follows: ``` [ @@ -121,9 +150,51 @@ POST /_plugins/_ml/connectors/_create "headers": { "content-type": "application/json" }, - "request_body": "{ \"query\": \"${parameters.query}\", \"texts\": ${parameters.texts} }", - "pre_process_function": "\n def query_text = params.query_text;\n def text_docs = params.text_docs;\n def textDocsBuilder = new StringBuilder('[');\n for (int i=0; i