code: def _convert_to_transformers_classification_regression(
      adaptive_model, prediction_head
  ):
      if (
          adaptive_model.language_model.model.base_model_prefix
          == "roberta"
      ):
          # Classification Heads in transformers have different architecture across Language Model variants
          # The RobertaClassificationhead has components: input2dense, dropout, tanh, dense2output
          # The tanh function cannot be mapped to current FARM style linear Feed Forward ClassificationHeads.
          # So conversion for this type cannot work. We would need a compatible FARM RobertaClassificationHead
          logger.error(
              "Conversion for Text Classification and Regression with Roberta or XLMRoberta "
              "not possible at the moment."
          )
  
      # add more info to config
      adaptive_model.language_model.model.config.num_labels = (
          prediction_head.num_labels
      )
      adaptive_model.language_model.model.config.id2label = {
          id: label
          for id, label in enumerate(prediction_head.label_list)
      }
      adaptive_model.language_model.model.config.label2id = {
          label: id
          for id, label in enumerate(prediction_head.label_list)
      }
      adaptive_model.language_model.model.config.finetuning_task = (
          prediction_head.model_type
      )
      adaptive_model.language_model.model.config.language = (
          adaptive_model.language_model.language
      )
  
      # init model
      transformers_model = (
          AutoModelForSequenceClassification.from_config(
              adaptive_model.language_model.model.config
          )
      )
      # transfer weights for language model + prediction head
      setattr(
          transformers_model,
          transformers_model.base_model_prefix,
          adaptive_model.language_model.model,
      )
      transformers_model.classifier.load_state_dict(
          prediction_head.feed_forward.feed_forward[0].state_dict()
      )
  
      return transformers_model
  
file_path: FARM/farm/conversion/transformers.py
imports: import logging
  from transformers import AutoModelForSequenceClassification, AutoModelForQuestionAnswering, AutoModelWithLMHead, AutoModelForTokenClassification
  from farm.modeling import adaptive_model
  from farm.modeling.language_model import LanguageModel
  from farm.modeling.prediction_head import BertLMHead, QuestionAnsweringHead, RegressionHead, TextClassificationHead, TokenClassificationHead
label_desc: Use image node_id 3 for calling the Converter obj's underlying member method code with example usage: obj._convert_to_transformers_classification_regression(adaptive_model, prediction_head) and returns: transformers_model