community-notes-br / README.md
histlearn's picture
c955ff34483396d42c20188007df8376c4e241705fc57c13641054a6e0c9b559
4a2b376 verified
|
raw
history blame
16.9 kB
---
language:
- pt
license: cc0-1.0
task_categories:
- text-classification
- token-classification
size_categories:
- 100K<n<1M
tags:
- community-notes
- birdwatch
- misinformation
- portuguese
- ner
- topic-modeling
- brazilian-politics
- fact-checking
configs:
- config_name: notes
data_files: notes_pt.parquet
- config_name: entities
data_files: entities.parquet
- config_name: topic_metadata
data_files: topic_metadata.parquet
- config_name: macrotheme_metadata
data_files: macrotheme_metadata.parquet
---
# Community Notes BR — Enriched Portuguese Subset
A curated, enriched Portuguese-language subset of X (formerly Twitter) Community Notes, with topic modeling, named entity recognition, and reproduction of the official Matrix Factorization scoring.
**Snapshot:** 2026-04-07 of the official Birdwatch public dump.
**Coverage:** 2021-10-13 → 2026-04-05.
**Notes:** 142,448 — all in Portuguese (fastText `lid.176`, confidence ≥ 0.80, mean 0.98).
**Tweets:** 90,822 unique.
**Entities:** 536,373 across 22 named-entity types.
**Topics:** 899 fine-grained, organized into 38 macrothemes.
## Resumo em português
Subconjunto curado em PT-BR das Community Notes da X, enriquecido com modelagem de tópicos hierárquicos (BERTopic + LLM com gramática formal GBNF), reconhecimento de entidades nomeadas (GLiNER + regex + dicionários canônicos), e reprodução do algoritmo oficial de pontuação por fatoração matricial. Cobre 142k notas em PT (2021-10 a 2026-04), 90k tweets distintos, 536k entidades em 22 tipos, 899 tópicos finos agrupados em 38 macrotemas. Licença CC0; alinhada à licença da fonte original.
---
## Files
| File | Rows | Size | Granularity |
|---|---|---|---|
| `notes_pt.parquet` | 142,448 | 35 MB | one row per note |
| `entities.parquet` | 536,373 | 40 MB | one row per entity (long format) |
| `topic_metadata.parquet` | 898 | 70 KB | one row per topic |
| `macrotheme_metadata.parquet` | 38 | 6 KB | one row per macrotheme |
| `taxonomy.json` | — | — | entity-type definitions |
| `cross_modal_validation/` | — | — | quality assessment tables (see below) |
Join key: `noteId` between `notes_pt` and `entities`. Tweet text is **not** redistributed (X ToS); use `tweetId` to hydrate via X API or consult the project's static catalog.
---
## Schema
### `notes_pt.parquet`
| Column | Type | Description |
|---|---|---|
| `noteId` | string | Primary key (Community Notes note identifier). |
| `tweetId` | string | The tweet the note refers to. |
| `note_author_participant_id` | string | Anonymized note author ID (CN's own `participantId`). |
| `created_at` | timestamp | Note creation time (UTC, derived from `createdAtMillis`). |
| `year_month` | string | `YYYY-MM` for time-series convenience. |
| `summary` | string | Note text as published. |
| `summary_clean` | string | Whitespace-normalized, URL-stripped version (used for embeddings). |
| `classification_algoritmo` | string | `MISINFORMED_OR_POTENTIALLY_MISLEADING` or `NOT_MISLEADING`. From the original CN data. |
| `idioma` | string | Always `pt` (subset). |
| `confianca_idioma` | float | fastText `lid.176.bin` confidence, [0.80, 1.00]. |
| `status_final` | string | Latest community status: `CURRENTLY_RATED_HELPFUL`, `CURRENTLY_RATED_NOT_HELPFUL`, `NEEDS_MORE_RATINGS`, or null. |
| `consenso` | string | 4-class compaction: `CRH` / `CRNH` / `NMR` / `Outro`. |
| `n_ratings` | int | Total ratings the note received. |
| `n_notas_no_tweet` | int | Number of notes attached to the same tweet. |
| `coreNoteIntercept` | float32 | Output of the official MF scoring algorithm; null when the note had insufficient ratings. |
| `coreNoteFactor1` | float32 | First factor from MF; interpretable as a polarity axis. |
| `topic_id` | int | BERTopic cluster id; `-1` denotes the outlier cluster (47,162 notes); null for 397 notes outside the topic-model run. |
| `topic_name` | string | LLM-generated short label (Marco-Mini-Instruct via GBNF grammar). |
| `contexto_central` | string | LLM-generated one-sentence description of the topic. |
| `categoria_ampla` | string | LLM-classified category (13 controlled values). |
| `macrotheme_id` | int | Macrotheme cluster id from hierarchical aggregation. |
| `macrotheme_label` | string | LLM-generated macrotheme label. |
| `stratum` | string | Sampling stratum for the hydrated tweet sub-sample (`top_notas`, `bat_signals`, `aleatorio`). Null for unsampled notes. |
### `entities.parquet` (long format)
| Column | Type | Description |
|---|---|---|
| `entity_id` | string | `<row_id>_<j>` — unique per extraction. |
| `noteId` | string | FK to `notes_pt`. |
| `tweetId` | string | FK to `notes_pt`. |
| `texto_entidade` | string | Surface form as it appears in the note. |
| `texto_canonico` | string | Normalized form (lowercase + unidecode + dictionary lookup for programs/agencies/parties). |
| `tipo_entidade` | string | Canonical PT type (see `taxonomy.json`; 22 values). |
| `label_modelo` | string | Original GLiNER English label or regex pattern name. |
| `inicio` / `fim` | int | Character offsets in `summary`. |
| `score` | float | GLiNER confidence [0,1]; 0.94–1.00 for regex-extracted entities. |
| `fonte_extracao` | string | `gliner` \| `regex_url` \| `regex_data` \| `regex_percentual` \| `regex_valor` \| `regex_lei_norma` \| `regex_processo`. |
| `contexto` | string | ±90-character window around the entity. |
| `papel_no_texto` | string | `mencao` (mentioned as object) or `fonte_ou_evidencia` (cited as source/evidence). |
| `dominio` | string | Canonicalized domain (URLs only). |
| `topic_id` / `macrotheme_id` | int | Denormalized for analysis convenience. |
---
## Construction methodology
Five-stage pipeline. Code is described in the accompanying paper and the project's static catalog; only the final artifacts are redistributed here.
### 1. ETL — bronze/silver/gold
The 5 official Birdwatch tables (`notes`, `noteRatings`, `noteStatusHistory`, `userEnrollment`, `batSignals`) are downloaded by snapshot date, hash-verified (MD5/SHA256), schema-drift-checked across shards, and materialized in DuckDB. Bronze keeps everything as `VARCHAR` with metadata; silver adds typed columns and snake_case names; gold exports compressed Parquet.
### 2. Portuguese filter
Each note's `summary_clean` (whitespace-normalized, URL-stripped via SQL) is classified by fastText `lid.176.bin`. Notes with `idioma = pt` and `confianca_idioma ≥ 0.80` are retained, yielding 142,448 notes (mean confidence 0.98). A 300-note stratified sample (100 per confidence band: 0.80–0.90 / 0.90–0.95 / 0.95–1.00) was visually inspected and looked correct, although this was a quick, non-exhaustive check rather than a rigorous human evaluation.
### 3. Topic modeling
Notes are embedded with `intfloat/multilingual-e5-large-instruct` (1024-d) using a Portuguese instruction prompt that orients the embedding toward the *factual matter under dispute*, not the procedural surface. Clustering uses BERTopic (UMAP `n_components=10`, HDBSCAN `min_cluster_size=30`, `min_samples=5`) with parameters chosen by a DBCV grid search. Outliers are reduced via embedding similarity (threshold 0.975). Each topic is then labeled by `Marco-Mini-Instruct` (GGUF Q6_K) constrained by a GBNF grammar that forces a JSON object with three fields (`contexto_central`, `categoria_ampla`, `rotulo_curto`) — this guarantees parseable output and a controlled category vocabulary.
Macrothemes are obtained by hierarchical aggregation (average linkage on cosine similarity of topic embeddings, distance threshold 0.05). Each macrotheme is then labeled by a second LLM pass that receives the `contexto_central` of its constituent topics rather than just keywords. A two-layer procedural filter (keyword + LLM) flags topics that are about the platform itself (notes mechanics, satire without a target) rather than substantive content.
### 4. Named entity recognition
Each note runs through:
- **GLiNER** (`urchade/gliner_multi-v2.1`) with a custom 16-type Portuguese taxonomy (politicians, parties, agencies, courts, security forces, public figures, media outlets, digital platforms, public programs, etc.) and per-type confidence thresholds (0.40–0.55, see `taxonomy.json`).
- **Six regex extractors** (URLs, dates, monetary values, percentages, laws/decrees, judicial process numbers) for high-precision structured patterns.
- **Three canonicalization dictionaries** (YAML-defined, editable) mapping orthographic variants to canonical forms for public programs (Bolsa Família, SUS, Prouni, …), agency acronyms (STF, TSE, IBGE, Anvisa, …), and parties.
- **Overlap resolution** by IoU ≥ 0.5 with priority order favoring regex over GLiNER.
An LLM-based revision step (Marco-Mini reviewing low-confidence ambiguous entities) is implemented in the project pipeline but was **not applied** to this release due to GPU time constraints; the entities here are post-extraction, post-canonicalization, pre-LLM-revision.
### 5. Note scoring
The official Twitter/X `communitynotes` Matrix Factorization algorithm is run on the PT subset using the upstream `scoring/src` code with minimal patches (asserts → warnings to accept the smaller universe). Outputs `coreNoteIntercept` (overall helpfulness baseline) and `coreNoteFactor1` (first polarization factor) — the same fields the algorithm produces in production, restricted to PT notes.
---
## Quantitative description
### Volume by status (community consensus)
| `consenso` | n_notes | % |
|---|---|---|
| `NMR` (NEEDS_MORE_RATINGS) | 116,741 | 82.0% |
| `CRH` (CURRENTLY_RATED_HELPFUL) | 15,857 | 11.1% |
| `CRNH` (CURRENTLY_RATED_NOT_HELPFUL) | 4,423 | 3.1% |
| `Outro` | 5,427 | 3.8% |
PT-BR shows a higher CRH rate (11.57%) than English (8.69%) in the same snapshot — a finding worth further study.
### Volume by macrotheme (top 10 of 38)
| macrotheme_id | rotulo_macro | categoria_dominante | n_topics | n_notas |
|---|---|---|---|---|
| 0 | Sátira clara | Outro | 73 | 12,090 |
| 1 | Crise Política | Política | 123 | 9,833 |
| 2 | Sátira de humorista | Política | 74 | 7,552 |
| 3 | Economia e Política | Economia | 72 | 6,864 |
| 4 | Taylor Swift e Política | Política | 45 | 6,400 |
| 5 | Cotas e Cortes no Ensino Superior | Política | 47 | 6,370 |
| 6 | Futebol e Racismo | Política | 48 | 5,474 |
| 7 | Apostas Online | Golpes e Fraudes | 61 | 4,700 |
| 8 | Musk e Censura | Tecnologia | 32 | 4,344 |
| 9 | Racismo e Liberdade | Política | 35 | 3,525 |
### Entities by type (top 15 of 22)
| tipo_entidade | n |
|---|---|
| URL_DOMINIO | 174,625 |
| PESSOA | 82,190 |
| LOCAL | 49,247 |
| ORGANIZACAO | 47,191 |
| VEICULO_MIDIA | 43,810 |
| ATOR_POLITICO | 34,117 |
| PLATAFORMA_DIGITAL | 27,763 |
| ORGAO_PUBLICO | 16,788 |
| DATA | 13,292 |
| PARTIDO | 9,045 |
| ESTATISTICA | 7,519 |
| EVENTO_POLITICO | 7,367 |
| PROGRAMA_PUBLICO | 5,773 |
| ORGAO_SEGURANCA | 4,287 |
| VALOR_MONETARIO | 4,224 |
131,399 notes (92%) carry at least one entity; mean of 4.08 entities per annotated note.
### Missing data
| Column | Missingness | Reason |
|---|---|---|
| `coreNoteIntercept`/`coreNoteFactor1` | 27.3% | Notes with too few ratings are not scored by MF. |
| `topic_id` | 0.3% (397) | Notes outside the topic-model run. |
| `topic_name`/`contexto_central`/`categoria_ampla` | 33.4% | Notes in the BERTopic outlier cluster (`topic_id = -1`) plus the 397 above. |
| `macrotheme_id`/`macrotheme_label` | 33.4% | Same as topic_name. |
| `status_final` | 3.8% | Notes whose status is unmapped or empty in the snapshot. |
| `stratum` | 97.2% | Only 4,055 notes were sampled for tweet hydration. |
---
## Quality assessment
No exhaustive human validation was performed. Quality is supported by four converging lines of evidence:
**1. Deterministic checks.** The ETL produces MD5/SHA256 hashes per shard, schema-drift detection across shards, integrity-referential checks against orphans, and snapshot-to-snapshot diffs.
**2. Intrinsic metrics.** Topic clustering parameters were selected by DBCV grid search (32 combinations); topic_model fit produces silhouette and stability statistics. fastText language confidence has a median of 0.99. GLiNER scores have a median of 0.91; regex sources are 0.94–1.00 by design.
**3. Cross-modal consistency.** The `cross_modal_validation/` folder ships pre-computed tables showing that macrotheme labels match the empirical entity-type signatures of their notes — for example, *Futebol e Racismo* has 41% `ORGANIZACAO` entities (Flamengo, Palmeiras, FIFA, CBF) and `ge.globo.com` as the top citation source; *Apostas Online* combines `ORGANIZACAO`+`PLATAFORMA_DIGITAL` with `archive.ph`, `reclameaqui` and `pastebin` as top sources, the canonical fingerprint of fraud reporting; *Crise Política* is dominated by `ATOR_POLITICO` (Lula, Bolsonaro, STF, TSE). 14 of the top 15 macrothemes show coherent signatures across four independent dimensions (label, dominant entity type, top entities, top domains).
**4. Detected failure modes** (transparent self-report). Two macrothemes are flagged: *Sátira clara* shows generic top entities (`autor`, `nnn`, `comunidade`) and 100% meta-platform top domains (`communitynotes.x.com`, `help.x.com`) — likely procedural content the two-layer filter did not catch. *Cotas e Cortes no Ensino Superior* shows low concentration (dominant/secondary type ratio ≈ 1.04) and entities that mismatch the label, suggesting the hierarchical-clustering threshold merged unrelated clusters. Both cases are documented in `cross_modal_validation/concentracao_por_macrotema.csv`.
**5. Spot-checked language filter.** A 300-note sample stratified across confidence bands was visually inspected and looked correct; this was a quick check, not a rigorous evaluation.
---
## Limitations
- **No exhaustive human validation** of topic labels or named entities. The LLM-based revision step for the NER is implemented but was not applied to this release.
- **Tweet text not redistributed** due to X's terms of service. Use `tweetId` for hydration. The project keeps a static catalog with note-level context for human inspection.
- **Snapshot-bound.** This is the 2026-04-07 snapshot; status fields evolve over time. Future snapshots may diverge.
- **PT-BR coverage bias.** The fastText filter at 0.80 confidence aims for high precision and may exclude some short or code-mixed notes.
- **Topic outliers.** 33% of notes fall in `topic_id = -1` (BERTopic outliers). Outlier reduction was applied but conservative.
- **Procedural leakage.** As noted, *Sátira clara* contains residual procedural content.
---
## Suggested use cases
- **NER benchmarking in PT-BR with politically salient categories** (`ATOR_POLITICO`, `PARTIDO`, `ORGAO_JUDICIARIO`, `ORGAO_SEGURANCA`, `PROGRAMA_PUBLICO`).
- **Helpful-note classification** at note text only, or with text + tabular signals (`coreNoteFactor1`, `n_ratings`).
- **Polarization analysis** along `coreNoteFactor1`, conditioned on macrotheme.
- **Source-citation studies**: which domains are cited as evidence in misinformation pushback, by topic and over time.
- **Longitudinal studies of Brazilian online discourse**: the 4.5-year window covers two electoral cycles, the COVID aftermath, the 2024 floods, multiple sport scandals, and major changes to Twitter/X moderation.
- **Procedural-content filtering**: the *Sátira clara* failure mode is itself a use case for training procedural-vs-substantive classifiers.
---
## Citation
```
@inproceedings{communitynotesbr2026,
title = {Community Notes BR: An enriched Portuguese subset of X's crowdsourced fact-checking notes for misinformation research},
author = {Machado da Rocha, Davi},
booktitle = {Anais do VII Dataset Showcase Workshop (DSW), SBBD},
year = {2026},
publisher = {SBC},
doi = {TBD}
}
```
## License
The original Community Notes data is released by X under CC0. Derivative annotations in this release (topic labels, NER, MF reproduction) are released under **CC0 1.0 Universal** to match the source license. Tweet text is **not** included; only `tweetId` is published.
## AI usage disclosure
This dataset incorporates outputs from generative AI models as part of its construction:
- **Marco-Mini-Instruct** (GGUF Q6_K, via `llama-cpp-python`) for structured topic and macrotheme labeling, with grammar-constrained JSON output.
- **`intfloat/multilingual-e5-large-instruct`** for embedding generation.
- **`urchade/gliner_multi-v2.1`** for NER extraction.
Generative AI was used for parts of the prose in this datacard and the accompanying paper. AI was not used to generate the data itself or its annotations beyond the explicit pipeline steps described above.
---
**Maintainer:** Davi Machado da Rocha (USP).
**Source of upstream data:** Birdwatch public dump, snapshot 2026-04-07, ©X Corp under CC0.