<commit_before>defmodule ProtoBench do
  def load(pb_path) do
    bin = File.read!(pb_path)
    Benchmarks.BenchmarkDataset.decode(bin)
  end

  def mod_name("benchmarks.proto2.GoogleMessage1"), do: Benchmarks.Proto2.GoogleMessage1
  def mod_name("benchmarks.proto3.GoogleMessage1"), do: Benchmarks.Proto3.GoogleMessage1
  def mod_name("benchmarks.proto2.GoogleMessage2"), do: Benchmarks.Proto2.GoogleMessage2
end<commit_msg>Generalize ProtoBench to load any dataset<commit_after>defmodule ProtoBench do
  def load(pb_path) do
    pb_path
    |> File.read!()
    |> Benchmarks.BenchmarkDataset.decode()
  end

  def mod_name(name) do
    name
    |> String.split(".")
    |> Enum.map(&Macro.camelize/1)
    |> Module.safe_concat()
  end
end
{'fraction_non_alphanumeric': 0.11351351351351352, 'fraction_numerical': 0.01756756756756757, 'mean_word_length': 4.613636363636363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '887836', 'n_tokens_mistral': 267, 'n_tokens_neox': 257, 'n_words': 46}