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

[FEAT] Labelling tool - Hide Splink predictions from the page by default #2531

Open
RobinL opened this issue Nov 28, 2024 · 0 comments
Open

Comments

@RobinL
Copy link
Member

RobinL commented Nov 28, 2024

Discussed in #2526

Originally posted by medwar99 November 27, 2024

Is your proposal related to a problem?

The labelling tool defaults to showing the Splink predictions by default, which is acknowledged as potentially introducing bias. We can currently tackle this issue in two ways:

  • Completely remove the ability to see the predictions by setting show_splink_predictions_in_interface=False.
  • Toggle the view to off by using the checkbox on the page.

The first option is good, and I believe wants to stay. It may not be suitable to allow reviewers even the option to see the predictions, but these tools tend to be for linkage operators and so defaulting show_splink_predictions_in_interface to True in in Python land works.

The problem with the second option is that the default behaviour of the tool is to show the predictions when loaded and so users may see Splink predictions before being able to toggle the view off. The default value setting returned by the _show_splink_predictions_initial_value() function of labelling_tool/slt.js sets a value of "Show splink predictions" if SHOW_SPLINK_PREDICTIONS is not false, causing the view to be visible on page load.

function _show_splink_predictions_initial_value(globalThis)
{
if (typeof globalThis.SHOW_SPLINK_PREDICTIONS == "undefined") {
return ["Show splink predictions"];
} else if (globalThis.SHOW_SPLINK_PREDICTIONS == true) {
return ["Show splink predictions"];
} else {
return [];
}
}

Describe the solution you'd like

Would it be better to have this checkbox default to be off on page load, and then allow users to toggle the checkbox if they want to see the Splink predictions? I updated the _show_splink_predictions_initial_value function to the following, which seemed to act as intended:

 function _show_splink_predictions_initial_value(globalThis)
  {
    if (typeof globalThis.SHOW_SPLINK_PREDICTIONS == "undefined") {
      return [];
    } else if (globalThis.SHOW_SPLINK_PREDICTIONS == true) {
      return [];
    } else {
      return [];
    }
  }

My JS skills aren't really good enough to know for sure if a) it has wider implications and b) makes the function a bit redundant.

Describe alternatives you've considered

  • I tried closing my eyes and clicking the checkbox before I looked at the page, but sometimes misclicked.
  • I tried clicking really really quickly, but unfortunately I'm not that fast.

In seriousness, I considered whether changing the show_splink_predictions_in_interface arg of linker.labelling_tool_for_specific_record() from a Boolean to a string might be worthwhile, but this seems unnecessarily complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant