class_docstr: This dataset reader can be used to read-in parallel sentences, i.e., it reads in a file with tab-seperated sentences with the same
  sentence in different languages. For example, the file can look like this (EN       DE      ES):
  hello world     hallo welt  hola mundo
  second sentence zweiter satz    segunda oración
  
  The sentence in the first column will be mapped to a sentence embedding using the given the embedder. For example,
  embedder is a mono-lingual sentence embedding method for English. The sentences in the other languages will also be
  mapped to this English sentence embedding.
  
  When getting a sample from the dataset, we get one sentence with the according sentence embedding for this sentence.
  
  teacher_model can be any class that implement an encode function. The encode function gets a list of sentences and
  returns a list of sentence embeddings
class_docstr_tok: ["This","dataset","reader","can","be","used","to","read-in","parallel","sentences",",","i.e.",",","it","reads","in","a","file","with","tab-seperated","sentences","with","the","same","sentence","in","different","languages",".","For","example",",","the","file","can","look","like","this","(","EN","DE","ES",")",":","hello","world","hallo","welt","hola","mundo","second","sentence","zweiter","satz","segunda","oraci\u00f3n","The","sentence","in","the","first","column","will","be","mapped","to","a","sentence","embedding","using","the","given","the","embedder",".","For","example",",","embedder","is","a","mono-lingual","sentence","embedding","method","for","English",".","The","sentences","in","the","other","languages","will","also","be","mapped","to","this","English","sentence","embedding",".","When","getting","a","sample","from","the","dataset",",","we","get","one","sentence","with","the","according","sentence","embedding","for","this","sentence",".","teacher_model","can","be","any","class","that","implement","an","encode","function",".","The","encode","function","gets","a","list","of","sentences","and","returns","a","list","of","sentence","embeddings"]
docstr: Parallel sentences dataset reader to train student model given a teacher model
  
  :param student_model: Student sentence embedding model that should be trained
  :param teacher_model: Teacher model, that provides the sentence embeddings for the first column in the dataset file
docstr_tok: ["Parallel","sentences","dataset","reader","to","train","student","model","given","a","teacher","model",":","param","student_model",":","Student","sentence","embedding","model","that","should","be","trained",":","param","teacher_model",":","Teacher","model",",","that","provides","the","sentence","embeddings","for","the","first","column","in","the","dataset","file"]
code: def __init__(
      self,
      student_model: SentenceTransformer,
      teacher_model: SentenceTransformer,
      batch_size: int = 8,
      use_embedding_cache: bool = True,
  ):
      """
      Parallel sentences dataset reader to train student model given a teacher model
  
      :param student_model: Student sentence embedding model that should be trained
      :param teacher_model: Teacher model, that provides the sentence embeddings for the first column in the dataset file
      """
      self.student_model = student_model
      self.teacher_model = teacher_model
      self.datasets = []
      self.datasets_iterator = []
      self.datasets_tokenized = []
      self.dataset_indices = []
      self.copy_dataset_indices = []
      self.cache = []
      self.batch_size = batch_size
      self.use_embedding_cache = use_embedding_cache
      self.embedding_cache = {}
      self.num_sentences = 0
  
file_path: sentence-transformers/sentence_transformers/datasets/ParallelSentencesDataset.py
imports: from torch.utils.data import Dataset
  import logging
  import gzip
  from ..None import SentenceTransformer
  from ..readers import InputExample
  from typing import List
  import random
label_desc: Use image node_id 1 to create a new ParallelSentencesDataset object from inherited base classes: Dataset with example: obj = ParallelSentencesDataset(student_model, teacher_model, batch_size, use_embedding_cache)