<commit_before>namespace :db do

  desc "Load graph edge data from the given CSV file"
  task :load_edges, [:file] => :environment do |t, args|
    args.with_defaults(:file => "edge_entries.csv")
    file_path = "\\data\\#{args.file}"
    puts "\n**** Loading data from #{file_path} ****\n\n"
    file = File.open(file_path)
    count = 1
    Graph.transaction do
      file.each do |line|
        data = line.split(",")
        Graph.add_edge(data[0], data[1], Integer(data[2]))
        count = count + 1
        if count % 10000 == 0
          puts "#{count} records loaded"<commit_msg>Fix db load_edges task<commit_after>namespace :db do

  desc "Load graph edge data from the given CSV file"
  task :load_edges, [:file] => :environment do |t, args|
    args.with_defaults(:file => "edge_entries.csv")
    file_path = "./data/#{args.file}"
    puts "\n**** Loading data from #{file_path} ****\n\n"
    file = File.open(file_path)
    count = 1
    Graph.transaction do
      file.each do |line|
        data = line.split(",")
        Graph.add_edge(data[0], data[1], Integer(data[2]))
        count = count + 1
        if count % 10000 == 0
          puts "#{count} records loaded"
{'fraction_non_alphanumeric': 0.1545608108108108, 'fraction_numerical': 0.018581081081081082, 'mean_word_length': 2.7381703470031544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5748451', 'n_tokens_mistral': 403, 'n_tokens_neox': 384, 'n_words': 114}