Skip to content

Commit

Permalink
Adding more fields to the data export
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Feb 12, 2025
1 parent b13d7f1 commit 107d154
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/tasks/data/text_similarity_data.rake
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ namespace :check do
'explainer' => :description,
'fact-check' => :summary
}
claim = nil
claim = article.claim_description.description if type == 'fact-check'
{
id: nil,
team_id: nil,
team_slug: nil,
media_id: nil,
title: nil,
description: nil,
Expand All @@ -33,7 +37,8 @@ namespace :check do
title: article.title,
body: article.send(body_method_mapping[type]),
url: article.url,
type: type
type: type,
claim: claim
}]
}
end
Expand Down Expand Up @@ -75,6 +80,8 @@ namespace :check do
# Item data
object = {
id: item.id,
team_id: item.team_id,
team_slug: item.team.slug,
media_id: item.media_id,
title: item.title,
description: item.description,
Expand All @@ -90,6 +97,7 @@ namespace :check do
title: explainer.title,
body: explainer.description,
url: explainer.url,
claim: nil,
type: 'explainer'
}
end
Expand All @@ -102,6 +110,7 @@ namespace :check do
title: fact_check.title,
body: fact_check.summary,
url: fact_check.url,
claim: fact_check.claim_description.description,
type: 'fact-check'
}
end
Expand All @@ -113,7 +122,7 @@ namespace :check do
parent_id: relationship.source_id,
child_id: relationship.target_id,
user_name: relationship.user&.name
}
}.merge(relationship.as_json)
end

data << object
Expand Down

0 comments on commit 107d154

Please sign in to comment.