Pearson Correlation & Spearman Correlation

Hello, I am new to ElasticSearch
I am following this tutorial trying to implement Semantic Textual Similarity between a query and set of questions/documents in the Stackoverflow dataset.
I found that Pearson/Spearman correlation are not pre-implemented in painless functions of ES,

  1. How can I implement them in a custom query script? I am looking for guidance and/or code snippets
  2. How can I sort the results desc? or are they sorted desc by default, I noticed they were already sorted desc
  3. This is a general STS question, why most of the research paper showing their results in Pearson & Spearman Correlation, sometimes Cosine Similarity, while most of the online tutorials/materials have scores reported in Cosine Similarity? Does this mean for STS cosine similarity is better than the others?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.