HN 日本語サマリー

← 一覧へ戻る
AI・機械学習

Xの「おすすめ」タイムラインにおけるブラジル選挙フィルター

Brazilian election filter in X For You timeline (github.com)

44 pointsby LorenDB37 コメント

要約

このコードは、X(旧Twitter)の「おすすめ」タイムラインで、ブラジル2026年選挙に関連するコンテンツを除外するためのフィルターを実装しています。ブラジルの選挙裁判所に報告されたユーザーIDのリストに基づいて、特定の候補者やチャンネルからの投稿を非表示にする機能を提供します。

全文翻訳

use rustc_hash::FxHashSet; use std::sync::LazyLock; use crate::models::candidate::PostCandidate; use crate::models::query::ScoredPostsQuery; use xai_candidate_pipeline::filter::{Filter, FilterResult}; // Brazil 2026 election filter // Application providers that use a recommendation system for users must exclude from the // results the channels and profiles reported to the Electoral Court under the terms of // § 1º of this article and, except in cases of paid boosting, the content posted on them. // https://dadosabertos.tse.jus.br/dataset/candidatos-2026 // User ids below are obfuscated; usernames are included for transparency. // OmarAzizSenador deleted his account at the time this code was written. /// User ids reported to the Electoral Court for the Brazil 2026 election. static BRAZIL_2026_ELECTION_USER_IDS: LazyLock<FxHashSet<u64>> = LazyLock::new(|| { FxHashSet::from_iter([ // @renildo 14160928, // @renatoroseno 14492205, // @pedro_lupion 15022409, // @Sen_Cristovam 20242549, // @marcelvanhattem 21069302, // @nilvanferreira 21571098, // @RafaellMilas 21857669, // @chagasvieira 22035789, // @GabrielSouza_RS 22480147, // @Pimenta13Br 22864100, // @rigotto 23443097, // @euserafimcorrea 24761475, // @ManuelaDavila 25858078, // @CintyaMuniz 26284058, // @depguibismarck 29026134, // @cirogomes 33374761, // @aldenorlima 33973761, // @jooliveirapb 34909888, // @caduxavier 35470350, // @NetoAM 36145775, // @marciokieller 36403221, // @AlicePortugal 36971658, // @eniobritodesa 37654300, // @dep_geraldo 37711911, // @inacioarruda 38659819, // @murilogaldinopb 40040727, // @FlavioBolsonaro 40053694, // @BetoAlbuquerque 40463380, // @alexandrekalil 40721032, // @jessicamichels 41355867, // @lcbusato 42300711, // @Alice_Portugal 42304398, // @DepArthurMaia 42454330, // @kruke1 42487937, // @marcelorangel1 44107208, // @perpetua_acre 44693900, // @PedroTaquesMT 45448098, // @betinhogomes 46958570, // @DanielVilela15 47371488, // @zeca_dirceu 47461491, // @eduardopaes 48298703, // @RicardoBarrosPP 50101324, // @danielxdonizet 50360881, // @anyortiz 50430144, // @priscilakrause 51066167, // @advcorrea 51169114, // @afranioboppre50 51735736, // @DeputadoBacelar 52364013, // @JuniorMochi 52483984, // @GuilhermePaz 52750366, // @rosanedopv 52842057, // @RodrigoGuedesam 52954632, // @RollembergPSB 53050115, // @jorginhomello 53073647, // @nelsinhotrad 54412355, // @RubensOtoni 54539654, // @DeputadoWelter 54545619, // @marcosdoval 54600557, // @mineiroptrn 54897084, // @dep_acoutinho 56480030, // @venezianovital 56734024, // @DelegadoMeneses 57108807, // @RobinsonFaria 57151676, // @HarifeViegas 57163107, // @AlineMariano_pe 58314645, // @fredlinhares 58328715, // @JutayMeneses 59243227, // @fernandofilhope 59323812, // @franzepiaui 61190865, // @ale_campelo 61325857, // @carlaayres 62286707, // @HenriqueFontana 62804559, // @BohnGass 63127680, // @JoseAirtonPT 63868587, // @Bobadra 64302060, // @Marco_Brasil 64434503, // @livioluciano 65059970, // @FatimaCleidePT 65491379, // @fabio_novo 66413485, // @miguelcoelhope 66525428, // @VerGuilherme 66704302, // @cantojocelito 66719730, // @betodoisaum 66753261, // @mateus_simoesmg 66789220, // @ciro_nogueira 67098726, // @PattyParente 67234932, // @acirgurgacz 67601773, // @eduardoreiner 67947379, // @andrekamai 68404402, // @costa_rui 68466700, // @MarcosSantanaSC 68554516, // @CarlosBolsonaro 68712576, // @ProfIsrael 68719944, // @juliophilbert 69073488, // @Gyselle_Soares 70131422, // @ernanipolo 70284501, // @deputadoismael 70453020, // @FaissalCalil 71602909, // @SamuelMalafaia 73442547, // @pauderney 73803827, // @geraldoalckmin 74215006, // @eduardobismarck 74361905, // @luizcoutopt 74738674, // @agenorsantospa 74867163, // @santinroveda 75849275, // @fabriciopref 76039110, // @leitaothales 76224437, // @DepMajorAraujo 76383384, // @DepAfonsoHamm 76741399, // @MarcelAlexandre 77266759, // @raquelferreirar 78707944, // @joslene65 78714361, // @profdorinha 79174387, // @capitaotadeu 80214491, // @carlosmatosce 80597262, // @depdarcidematos 80712669, // @Adrianageronim 80733107, // @HermanoMorais 80995814, // @fabiofelixdf 81384580, // @liviaduartepsol 81742151, // @carlosjordy 82271629, // @Manato_es 82433790, // @darypagung 82936046, // @joaoromaneto 84141432, // @andrerochamg 84196661, // @wevertonrocha 85859074, // @realrcoutinho 86065271, // @vozdaenf 86348991, // @romeropelapb 88303403, // @arthurgurgeladv 90630534, // @ANDREAESPANHA 90898890, // @wilsonlimaAM 91109801, // @f_trad 92509126, // @marcelodeputado 93116173, // @tomazteixeira 93958167, ]) }); pub struct Brazil2026ElectionFilter; impl Filter<PostCandidate> for Brazil2026ElectionFilter { fn filter(&self, candidate: &PostCandidate) -> FilterResult { if BRAZIL_2026_ELECTION_USER_IDS.contains(&candidate.user_id) { FilterResult::Exclude } else { FilterResult::Include } } }