class_docstr: Given two sets of sentences in different languages, e.g. (en_1, en_2, en_3...) and (fr_1, fr_2, fr_3, ...),
  and assuming that fr_i is the translation of en_i.
  Checks if vec(en_i) has the highest similarity to vec(fr_i). Computes the accuracy in both directions
docstr: Constructs an evaluator based for the dataset
  
  The labels need to indicate the similarity between the sentences.
  
  :param source_sentences:
      List of sentences in source language
  :param target_sentences:
      List of sentences in target language
  :param print_wrong_matches:
      Prints incorrect matches
  :param write_csv:
      Write results to CSV file
code: def __init__(
      self,
      source_sentences: List[str],
      target_sentences: List[str],
      show_progress_bar: bool = False,
      batch_size: int = 16,
      name: str = "",
      print_wrong_matches: bool = False,
      write_csv: bool = True,
  ):
      """
      Constructs an evaluator based for the dataset
  
      The labels need to indicate the similarity between the sentences.
  
      :param source_sentences:
          List of sentences in source language
      :param target_sentences:
          List of sentences in target language
      :param print_wrong_matches:
          Prints incorrect matches
      :param write_csv:
          Write results to CSV file
      """
      self.source_sentences = source_sentences
      self.target_sentences = target_sentences
      self.name = name
      self.batch_size = batch_size
      self.show_progress_bar = show_progress_bar
      self.print_wrong_matches = print_wrong_matches
  
      assert len(self.source_sentences) == len(self.target_sentences)
  
      if name:
          name = "_" + name
  
      self.csv_file = "translation_evaluation" + name + "_results.csv"
      self.csv_headers = ["epoch", "steps", "src2trg", "trg2src"]
      self.write_csv = write_csv
  
file_path: sentence-transformers/sentence_transformers/evaluation/TranslationEvaluator.py
imports: from .None import SentenceEvaluator
  import logging
  from ..util import pytorch_cos_sim
  import os
  import csv
  import numpy
  from typing import List
  import torch
label_desc: Use image node_id 1 to create a new TranslationEvaluator object from inherited base classes: SentenceEvaluator with example: obj = TranslationEvaluator(source_sentences, target_sentences, show_progress_bar, batch_size, name, print_wrong_matches, write_csv)