code: def _labels_to_tensor(self, sentences: List[Sentence]):
      indices = [
          torch.tensor(
              [float(label.value) for label in sentence.labels],
              dtype=torch.float,
          )
          for sentence in sentences
      ]
  
      vec = torch.cat(indices, 0).to(flair.device)
  
      return vec
  
imports: import logging
  import typing
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  from torch import nn
  from torch.utils.data.dataset import Dataset
  from tqdm import tqdm
  import flair
  import flair.embeddings
  from flair.data import Corpus, Dictionary, Sentence, _iter_dataset
  from flair.datasets import DataLoader, FlairDatapointDataset
  from flair.embeddings.base import load_embeddings
  from flair.nn.model import ReduceTransformerVocabMixin
  from flair.training_utils import MetricRegression, Result, store_embeddings
label_desc: Use image node_id 6 for calling the TextRegressor obj's underlying member method code with example usage: obj._labels_to_tensor(sentences) and returns: vec