Related Pages - Scoring

Hi. I’m looking for a little bit of clarification or insight into the RelatedPages scoring mechanism. This is very powerful plugin but the documentation could use some love. I have the plugin working fine, I’m just trying to get accurate scoring. I searched and didn’t find anything in the Muut archive.

First, here’s my full relatedpages.yaml

enabled: true
limit: 7
show_score: true
score_threshold: 20
filter:
  items:
    @page: /home
  order:
    by: date
    dir: desc
page_in_filter: true
explicit_pages:
  process: true
  score: 100
taxonomy_match:
  taxonomy: tag
  taxonomy_taxonomy:
    process: true
    score_scale:
      1: '50'
      2: '65'
      3: '85'
      4: '100'
  taxonomy_content:
    process: false
    score_scale:
      1: '20'
      2: '30'
      3: '45'
      4: '60'
      5: '70'
      6: '80'
      7: '90'
      8: '100'
content_match:
  process: false


Note that I am really only focused on taxonomy_taxonomy matching at this point until I fully grasp scoring mechanism, so I will re-paste just that codeblock for easier reference:

taxonomy_taxonomy:
  process: true
  score_scale:
    1: '50'
    2: '65'
    3: '85'
    4: '100'

I’ve done probably too much testing and I have questions that hopefully some of which can be addressed:

  1. If I understand correctly, the line 1: '50' equates to 1 matched tag = score 50, etc.

  2. I’m also under the impression that something must be set to ‘100’ - in my example it’s 4: '100'

    • Therefore, 4 matched tags = score 100
  3. So, what if I suddenly start doubling the number of tags on each post from 4 - 8? Would I need to update this YAML to something like:

    taxonomy_taxonomy:
      process: true
      score_scale:
        1: '30'
        2: '40'
        3: '50'
        4: '60'
        5: '70'
        6: '80'
        7: '90'
        8: '100'
    

    ?
    3a. What if I’m only using 2 tags, or what if not every post has the same number of tags assigned to it?

  4. Aside from the requirement of something being set to ‘100’ the other items (1, 2 & 3 which are set to ‘50’, ‘65’ & ‘85’ respectively in my initial example) can be set to any arbitrary value under ‘100’. Is this correct?

  5. I understand the necessity to translate number of matched values into something else - called ‘score’ for this plugin - for taxonomy_content matching, as the ‘score’ is an actual matching percentage in that case (right?), but I’m confused how the end-user is supposed to know what these scores actually equate to for taxonomy_taxonomy matching. I.e. for my config, 100 equates to 4 matched tags. On another site it could be completely different. How can user have confidence in score when it’s not actual percentage but a defined value?

  6. Since I’m only using taxonomy_taxonomy right now, I thought maybe I could switch the ‘scores’ to just the number of matched tag, like 1: '1', etc. That way ‘scoring’ is more intuitive to the user: a score of ‘1’ would equate to 1 matched tag, etc. However due to point #2 above this does not seem possible?

I have more questions but… that’s probably enough for now!

I spent more time messing around with this YAML and was able to answer some of my questions. I’m hoping still that someone with more experience using this plugin will chime in at some point with some general pointers or “you’re doing it wrong”'s.

  1. verified

  2. verified

  3. seems like a 'yes’
    3a. still testing this

  4. verified

  5. wrong. percentages only available when utilizing content_match

  6. I was able to get this working with the following YAML:

    enabled: true
    limit: 5
    show_score: true
    score_threshold: 0
    filter:
      items:
        @page: /home
      order:
        by: date
        dir: desc
    page_in_filter: true
    explicit_pages:
      process: true
      score: 100
    taxonomy_match:
      taxonomy: tag
      taxonomy_taxonomy:
        process: true
        score_scale:
          1: '1'
          2: '2'
          3: '3'
          4: '4'
          5: '5'
          6: '6'
          7: '7'
          8: '8'
          9: '9'
          10: '10'
          11: '11'
          12: '12'
          13: '13'
          14: '14'
          15: '15'
          16: '100'
      taxonomy_content:
        process: false
          score_scale:
            1: '20'
            2: '30'
            3: '45'
            4: '60'
            5: '70'
            6: '80'
            7: '90'
            8: '100'
    content_match:
      process: false
    
    • with these notable changes:

      • change to score_threshold: 0

      • create taxonomy_taxonomy score_scale as shown below, with your chosen tag maximum set to ‘100’. For this example I went with 16 because I was typing manually. For production I’ll fire up numbers/excel and generate a full 1-100 list, for peace-of-mind. Remember, I’m only want to display the literal matched tag counts at this time, not ‘scores’.

        taxonomy_match:
          taxonomy: tag
          taxonomy_taxonomy:
            process: true
            score_scale:
              1: '1'
              2: '2'
              3: '3'
              ...
        
              ...
              16: '100'
          taxonomy_content:
            ...
        
    • live example if it’s unclear what I was trying to achieve here.