<commit_before>class AnswerConnection < ApplicationRecord
  validates_presence_of :similarity

  belongs_to :answer_1, class_name: :Answer
  belongs_to :answer_2, class_name: :Answer

  # Shortcut to get the resulted similarity between two answers.
  def self.similarity(answer_1, answer_2)
    where(answer_1: answer_1, answer_2: answer_2).or(where(answer_1: answer_2, answer_2: answer_1)).pluck(:similarity).first
  end

  # answer_1 similarity to answer_2 means the same similarity of answer_2
  # to answer_1.
  def self.create_simetrical_record(answer_1, answer_2, similarity)
    AnswerConnection.create!(answer_1: answer_1, answer_2: answer_2, similarity: similarity)
    AnswerConnection.create!(answer_1: answer_2, answer_2: answer_1, similarity: similarity)
  end
end<commit_msg>Minor changes<commit_after>class AnswerConnection < ApplicationRecord
  validates_presence_of :similarity

  belongs_to :answer_1, class_name: :Answer
  belongs_to :answer_2, class_name: :Answer

  # Shortcut to get the resulted similarity between two answers.
  scope :similarity, -> (answer_1, answer_2)do
    where(answer_1: answer_1, answer_2: answer_2)
    .or(where(answer_1: answer_2, answer_2: answer_1)).pluck(:similarity).first
  end

  # answer_1 similarity to answer_2 means the same similarity of answer_2
  # to answer_1.
  def self.create_simetrical_record(answer_1, answer_2, similarity)
    create!(answer_1: answer_1, answer_2: answer_2, similarity: similarity)
    create!(answer_1: answer_2, answer_2: answer_1, similarity: similarity)
  end
end
{'fraction_non_alphanumeric': 0.08172458172458172, 'fraction_numerical': 0.03346203346203346, 'mean_word_length': 5.850220264317181, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4127982', 'n_tokens_mistral': 528, 'n_tokens_neox': 499, 'n_words': 128}