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: Reads in a tab-seperated .txt/.csv/.tsv or .gz file. The different columns contain the different translations of the sentence in the first column
  
  :param filepath: Filepath to the file
  :param weight: If more than one dataset is loaded with load_data: With which frequency should data be sampled from this dataset?
  :param max_sentences: Max number of lines to be read from filepath
  :param max_sentence_length: Skip the example if one of the sentences is has more characters than max_sentence_length
  :param batch_size: Size for encoding parallel sentences
  :return:
docstr_tok: ["Reads","in","a","tab-seperated",".txt\/.csv\/.tsv","or",".gz","file",".","The","different","columns","contain","the","different","translations","of","the","sentence","in","the","first","column",":","param","filepath",":","Filepath","to","the","file",":","param","weight",":","If","more","than","one","dataset","is","loaded","with","load_data",":","With","which","frequency","should","data","be","sampled","from","this","dataset","?",":","param","max_sentences",":","Max","number","of","lines","to","be","read","from","filepath",":","param","max_sentence_length",":","Skip","the","example","if","one","of","the","sentences","is","has","more","characters","than","max_sentence_length",":","param","batch_size",":","Size","for","encoding","parallel","sentences",":","return",":"]
code: def load_data(
      self,
      filepath: str,
      weight: int = 100,
      max_sentences: int = None,
      max_sentence_length: int = 128,
  ):
      """
      Reads in a tab-seperated .txt/.csv/.tsv or .gz file. The different columns contain the different translations of the sentence in the first column
  
      :param filepath: Filepath to the file
      :param weight: If more than one dataset is loaded with load_data: With which frequency should data be sampled from this dataset?
      :param max_sentences: Max number of lines to be read from filepath
      :param max_sentence_length: Skip the example if one of the sentences is has more characters than max_sentence_length
      :param batch_size: Size for encoding parallel sentences
      :return:
      """
  
      logger.info("Load " + filepath)
      parallel_sentences = []
  
      with gzip.open(
          filepath, "rt", encoding="utf8"
      ) if filepath.endswith(".gz") else open(
          filepath, encoding="utf8"
      ) as fIn:
          count = 0
          for line in fIn:
              sentences = line.strip().split("\t")
              if (
                  max_sentence_length is not None
                  and max_sentence_length > 0
                  and max([len(sent) for sent in sentences])
                  > max_sentence_length
              ):
                  continue
  
              parallel_sentences.append(sentences)
              count += 1
              if (
                  max_sentences is not None
                  and max_sentences > 0
                  and count >= max_sentences
              ):
                  break
      self.add_dataset(
          parallel_sentences,
          weight=weight,
          max_sentences=max_sentences,
          max_sentence_length=max_sentence_length,
      )
  
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 2 for calling the ParallelSentencesDataset obj's underlying member method code with example usage: obj.load_data(filepath, weight, max_sentences, max_sentence_length) without return types