code: def _get_data_points_from_sentence(
      self, sentence: Sentence
  ) -> List[Relation]:
      entity_pairs = []
      entity_spans = sentence.get_spans(self.entity_label_type)
  
      for span_1 in entity_spans:
          for span_2 in entity_spans:
              if span_1 == span_2:
                  continue
  
              # filter entity pairs according to their tags if set
              if (
                  self.entity_pair_filters is not None
                  and (
                      span_1.get_label(self.entity_label_type).value,
                      span_2.get_label(self.entity_label_type).value,
                  )
                  not in self.entity_pair_filters
              ):
                  continue
  
              relation = Relation(span_1, span_2)
              if (
                  self.training
                  and self.train_on_gold_pairs_only
                  and relation.get_label(self.label_type).value == "O"
              ):
                  continue
              entity_pairs.append(relation)
      return entity_pairs
  
file_path: flair/flair/models/relation_extractor_model.py
imports: import logging
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Set, Tuple, Union
  import torch
  import flair.embeddings
  import flair.nn
  from flair.data import Relation, Sentence
  from flair.file_utils import cached_path
label_desc: Use image node_id 2 for calling the RelationExtractor obj's underlying member method code with example usage: obj._get_data_points_from_sentence(sentence) and returns: entity_pairs