<commit_before>namespace :morph do
  desc "Get contractors from morph.io api"
  task :get_contractors do
    require 'open-uri'

    url = "https://api.morph.io/equivalentideas/westconnex_contracts/data.json?key=#{ENV['MORPH_SECRET_KEY']}&query=select%20*%20from%20'contractors'"
    contractors = JSON.parse(open(url).read)

    p "Found #{contractors.count} contractors"
  end
end<commit_msg>Get :environment in task for access to models<commit_after>namespace :morph do
  desc "Get contractors from morph.io api"
  task :get_contractors => :environment do
    require 'open-uri'

    url = "https://api.morph.io/equivalentideas/westconnex_contracts/data.json?key=#{ENV['MORPH_SECRET_KEY']}&query=select%20*%20from%20'contractors'"
    contractors = JSON.parse(open(url).read)

    p "Found #{contractors.count} contractors"
  end
end
{'fraction_non_alphanumeric': 0.13157894736842105, 'fraction_numerical': 0.014354066985645933, 'mean_word_length': 5.246268656716418, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '1835220', 'n_tokens_mistral': 298, 'n_tokens_neox': 281, 'n_words': 55}