code: def extract_embeddings(load_dir, use_gpu, batch_size):
      with open(load_dir / "s3e_stats.pkl", "rb") as f:
          s3e_stats = pickle.load(f)
  
      # Init inferencer
      inferencer = Inferencer.load(
          model_name_or_path=load_dir,
          task_type="embeddings",
          gpu=use_gpu,
          batch_size=batch_size,
          extraction_strategy="s3e",
          extraction_layer=-1,
          s3e_stats=s3e_stats,
      )
  
      # Input
      basic_texts = [
          {"text": "a man is walking on the street."},
          {"text": "a woman is walking on the street."},
      ]
  
      # Get embeddings for input text
      result = inferencer.inference_from_dicts(dicts=basic_texts)
      print(result)
      inferencer.close_multiprocessing_pool()
  
file_path: FARM/examples/embeddings_extraction_s3e_pooling.py
imports: import logging
  import pickle
  from pathlib import Path
  from farm.data_handler.processor import InferenceProcessor
  from farm.infer import Inferencer
  from farm.modeling.adaptive_model import AdaptiveModel
  from farm.modeling.language_model import LanguageModel
  from farm.modeling.tokenization import Tokenizer
  from farm.utils import set_all_seeds, initialize_device_settings
  from farm.modeling.wordembedding_utils import fit_s3e_on_corpus
label_desc: Use image node_id 2 for calling a global function with example usage: extract_embeddings(load_dir, use_gpu, batch_size) without return types