<commit_before>class WorkSerializer < ActiveModel::Serializer
  cache key: 'work'
  attributes :doi, :identifier, :url, :author, :title, :container_title, :description, :resource_type_subtype, :data_center_id, :member_id, :resource_type_id, :version, :license, :schema_version, :results, :related_identifiers, :published, :registered, :updated, :media, :xml

  belongs_to :data_center, serializer: DataCenterSerializer
  belongs_to :member, serializer: MemberSerializer

  belongs_to :resource_type, serializer: ResourceTypeSerializer

  def media
    object.media.present? ? object.media.map { |m| { media_type: m.split(":", 2).first, url: m.split(":", 2).last }} : nil
  end

  def updated
    object.updated_at
  end
end<commit_msg>use url as doi identifier<commit_after>class WorkSerializer < ActiveModel::Serializer
  cache key: 'work'
  attributes :doi, :identifier, :url, :author, :title, :container_title, :description, :resource_type_subtype, :data_center_id, :member_id, :resource_type_id, :version, :license, :schema_version, :results, :related_identifiers, :published, :registered, :updated, :media, :xml

  belongs_to :data_center, serializer: DataCenterSerializer
  belongs_to :member, serializer: MemberSerializer

  belongs_to :resource_type, serializer: ResourceTypeSerializer

  def id
    object.identifier
  end

  def media
    object.media.present? ? object.media.map { |m| { media_type: m.split(":", 2).first, url: m.split(":", 2).last }} : nil
  end

  def updated
    object.updated_at
  end
end
{'fraction_non_alphanumeric': 0.12171052631578948, 'fraction_numerical': 0.002631578947368421, 'mean_word_length': 5.820627802690583, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7371397', 'n_tokens_mistral': 483, 'n_tokens_neox': 474, 'n_words': 123}