class_docstr: AutoMM is designed to simplify the fine-tuning of foundation models
  for downstream applications with just three lines of code.
  AutoMM seamlessly integrates with popular model zoos such as
  `HuggingFace Transformers <https://github.com/huggingface/transformers>`_,
  `TIMM <https://github.com/huggingface/pytorch-image-models>`_,
  and `MMDetection <https://github.com/open-mmlab/mmdetection>`_,
  accommodating a diverse range of data modalities,
  including image, text, tabular, and document data, whether used individually or in combination.
  It offers support for an array of tasks, encompassing classification, regression,
  object detection, named entity recognition, semantic matching, and image segmentation.
class_docstr_tok: ["AutoMM","is","designed","to","simplify","the","fine-tuning","of","foundation","models","for","downstream","applications","with","just","three","lines","of","code",".","AutoMM","seamlessly","integrates","with","popular","model","zoos","such","as","`","HuggingFace","Transformers","<","https",":","\/\/github.com\/huggingface\/transformers",">","`","_",",","`","TIMM","<","https",":","\/\/github.com\/huggingface\/pytorch-image-models",">","`","_",",","and","`","MMDetection","<","https",":","\/\/github.com\/open-mmlab\/mmdetection",">","`","_",",","accommodating","a","diverse","range","of","data","modalities",",","including","image",",","text",",","tabular",",","and","document","data",",","whether","used","individually","or","in","combination",".","It","offers","support","for","an","array","of","tasks",",","encompassing","classification",",","regression",",","object","detection",",","named","entity","recognition",",","semantic","matching",",","and","image","segmentation","."]
docstr: Extract features for each sample, i.e., one row in the provided pd.DataFrame `data`.
  
  Parameters
  ----------
  data
      The data to extract embeddings for. Should contain same column names as training dataset and
      follow same format (except for the `label` column).
  id_mappings
       Id-to-content mappings. The contents can be text, image, etc.
       This is used when data contain the query/response identifiers instead of their contents.
  return_masks
      If true, returns a mask dictionary, whose keys are the same as those in the features dictionary.
      If a sample has empty input in feature column `image_0`, the sample will has mask 0 under key `image_0`.
  as_tensor
      Whether to return a Pytorch tensor.
  as_pandas
      Whether to return the output as a pandas DataFrame (True) or numpy array (False).
  realtime
      Whether to do realtime inference, which is efficient for small data (default False).
      If provided None, we would infer it on based on the data modalities
      and sample number.
  signature
      When using matcher, it can be query or response.
  
  Returns
  -------
  Array of embeddings, corresponding to each row in the given data.
  It will have shape (#samples, D) where the embedding dimension D is determined
  by the neural network's architecture.
docstr_tok: ["Extract","features","for","each","sample",",","i.e.",",","one","row","in","the","provided","pd.DataFrame","`","data","`",".","Parameters","--","--","--","--","--","data","The","data","to","extract","embeddings","for",".","Should","contain","same","column","names","as","training","dataset","and","follow","same","format","(","except","for","the","`","label","`","column",")",".","id_mappings","Id-to-content","mappings",".","The","contents","can","be","text",",","image",",","etc",".","This","is","used","when","data","contain","the","query\/response","identifiers","instead","of","their","contents",".","return_masks","If","true",",","returns","a","mask","dictionary",",","whose","keys","are","the","same","as","those","in","the","features","dictionary",".","If","a","sample","has","empty","input","in","feature","column","`","image_0","`",",","the","sample","will","has","mask","0","under","key","`","image_0","`",".","as_tensor","Whether","to","return","a","Pytorch","tensor",".","as_pandas","Whether","to","return","the","output","as","a","pandas","DataFrame","(","True",")","or","numpy","array","(","False",")",".","realtime","Whether","to","do","realtime","inference",",","which","is","efficient","for","small","data","(","default","False",")",".","If","provided","None",",","we","would","infer","it","on","based","on","the","data","modalities","and","sample","number",".","signature","When","using","matcher",",","it","can","be","query","or","response",".","Returns","--","--","--","-","Array","of","embeddings",",","corresponding","to","each","row","in","the","given","data",".","It","will","have","shape","(","#","samples",",","D",")","where","the","embedding","dimension","D","is","determined","by","the","neural","network","'s","architecture","."]
code: def extract_embedding(
      self,
      data: Union[pd.DataFrame, dict, list],
      id_mappings: Optional[
          Union[Dict[str, Dict], Dict[str, pd.Series]]
      ] = None,
      return_masks: Optional[bool] = False,
      as_tensor: Optional[bool] = False,
      as_pandas: Optional[bool] = False,
      realtime: Optional[bool] = False,
      signature: Optional[str] = None,
  ):
      """
      Extract features for each sample, i.e., one row in the provided pd.DataFrame `data`.
  
      Parameters
      ----------
      data
          The data to extract embeddings for. Should contain same column names as training dataset and
          follow same format (except for the `label` column).
      id_mappings
           Id-to-content mappings. The contents can be text, image, etc.
           This is used when data contain the query/response identifiers instead of their contents.
      return_masks
          If true, returns a mask dictionary, whose keys are the same as those in the features dictionary.
          If a sample has empty input in feature column `image_0`, the sample will has mask 0 under key `image_0`.
      as_tensor
          Whether to return a Pytorch tensor.
      as_pandas
          Whether to return the output as a pandas DataFrame (True) or numpy array (False).
      realtime
          Whether to do realtime inference, which is efficient for small data (default False).
          If provided None, we would infer it on based on the data modalities
          and sample number.
      signature
          When using matcher, it can be query or response.
  
      Returns
      -------
      Array of embeddings, corresponding to each row in the given data.
      It will have shape (#samples, D) where the embedding dimension D is determined
      by the neural network's architecture.
      """
      return self._learner.extract_embedding(
          data=data,
          return_masks=return_masks,
          as_tensor=as_tensor,
          as_pandas=as_pandas,
          realtime=realtime,
          signature=signature,
          id_mappings=id_mappings,
      )
  
imports: from __future__ import annotations
  import json
  import logging
  import os
  import warnings
  from typing import Dict, List, Optional, Union
  import pandas
  import transformers
  from autogluon.common.utils.log_utils import set_logger_verbosity, verbosity2loglevel
  from autogluon.core.metrics import Scorer
  from .constants import AUTOMM_TUTORIAL_MODE, FEW_SHOT_CLASSIFICATION, NER, OBJECT_DETECTION, OPEN_VOCABULARY_OBJECT_DETECTION, SEMANTIC_SEGMENTATION
  from .learners import BaseLearner, FewShotSVMLearner, MultiModalMatcher, NERLearner, ObjectDetectionLearner, SemanticSegmentationLearner
  from .problem_types import PROBLEM_TYPES_REG
  from .utils import get_dir_ckpt_paths
label_desc: Use image node_id 26 for calling the MultiModalPredictor obj's underlying member method code with example usage: obj.extract_embedding(data, id_mappings, return_masks, as_tensor, as_pandas, realtime, signature) and returns: self