code: def two_datasets_scatter_plot(
      plot_title: str,
      plot_data: pd.DataFrame,
      train_dataset: TextData,
      test_dataset: TextData,
      model_classes: list,
  ):
      """Plot a scatter plot of two datasets.
  
      Parameters
      ----------
      plot_title : str
          The title of the plot.
      plot_data : pd.DataFrame
          The data to plot (x and y axes).
      train_dataset : TextData
          The train dataset.
      test_dataset : TextData
          The test dataset.
      model_classes : list
          The names of the model classes (relevant only if the datasets are multi-label).
      """
      axes = plot_data.columns
      if train_dataset.name and test_dataset.name:
          dataset_names = (train_dataset.name, test_dataset.name)
      else:
          dataset_names = DEFAULT_DATASET_NAMES
  
      plot_data["Dataset"] = [dataset_names[0]] * len(train_dataset) + [
          dataset_names[1]
      ] * len(test_dataset)
  
      if train_dataset.task_type == TaskType.TOKEN_CLASSIFICATION:
          plot_data["Sample"] = np.concatenate(
              [
                  train_dataset.tokenized_text,
                  test_dataset.tokenized_text,
              ]
          )
  
          if train_dataset.has_label():
              plot_data["Label"] = list(
                  train_dataset.label_for_display(
                      model_classes=model_classes
                  )
              ) + list(
                  test_dataset.label_for_display(
                      model_classes=model_classes
                  )
              )
              plot_data["Sample"] = annotated_token_classification_text(
                  plot_data["Sample"], plot_data["Label"]
              )
              # Displayed labels are the counts of each label in the dataset:
              plot_data["Label"] = [
                  break_to_lines_and_trim(
                      str(count_token_classification_labels(x))
                  )
                  for x in plot_data["Label"]
              ]
          else:
              plot_data["Label"] = None
      else:
          if train_dataset.has_label():
              plot_data["Label"] = list(
                  train_dataset.label_for_print(
                      model_classes=model_classes
                  )
              ) + list(
                  test_dataset.label_for_print(
                      model_classes=model_classes
                  )
              )
          else:
              plot_data["Label"] = None
          plot_data["Sample"] = np.concatenate(
              [train_dataset.text, test_dataset.text]
          )
  
      plot_data["Sample"] = plot_data["Sample"].apply(
          break_to_lines_and_trim
      )
  
      fig = px.scatter(
          plot_data,
          x=axes[0],
          y=axes[1],
          color="Dataset",
          color_discrete_map=colors,
          hover_data=["Label", "Sample"],
          hover_name="Dataset",
          title=plot_title,
          opacity=0.4,
      )
      fig.update_traces(
          marker=dict(
              size=8, line=dict(width=1, color="DarkSlateGrey")
          ),
          selector=dict(mode="markers"),
      )
      return fig
  
file_path: deepchecks/deepchecks/nlp/utils/nlp_plot.py
imports: from typing import List, Sequence
  import numpy
  import pandas
  import plotly.express
  import plotly.graph_objs
  from deepchecks.nlp import TextData
  from deepchecks.nlp.task_type import TaskType
  from deepchecks.nlp.utils.text import break_to_lines_and_trim
  from deepchecks.nlp.utils.text_properties import TEXT_PROPERTIES_DESCRIPTION
  from deepchecks.nlp.utils.token_classification_utils import annotated_token_classification_text, count_token_classification_labels
  from deepchecks.utils.dataframes import un_numpy
  from deepchecks.utils.distribution.plot import get_density
  from deepchecks.utils.plot import DEFAULT_DATASET_NAMES, colors, common_and_outlier_colors
  from deepchecks.utils.strings import get_docs_link
label_desc: Use image node_id 3 for calling a global function with example usage: two_datasets_scatter_plot(plot_title, plot_data, train_dataset, test_dataset, model_classes) and returns: fig