# Methodology Summary: Monthly Multisource Panel and Local-LLM Text Annotation

Date: 2026-07-23

This memo consolidates the methodology introduced on 2026-07-23 in two parts:
(1) the 2019-2022 monthly multisource attention panel, and (2) the local-LLM
annotation pipeline first applied to the 2019-2025 Guardian article corpus.
It is written so the same methods can be reported in Paper 1/Paper 2 methods
sections and reused for the X/Twitter annotation leg.

## Part 1: Monthly Multisource Panel

### Inputs

| Source | Input | Basis |
| --- | --- | --- |
| Google Trends | `data/processed/google_trends/collection_2019_2025/{year}/interest_over_time.csv` | Weekly scaled interest, anchor term `geothermal energy`, averaged to month |
| Guardian | `data/interim/guardian/action_artifacts/.../guardian_daily_articles.csv` (local only) | Article metadata deduplicated by `source_record_id`; monthly unique-article counts plus regex frame counts |
| X/Twitter | `data/processed/twitter_x/aligned_2019_2022/twitter_x_aligned_monthly_exact_2019_2022.csv` | Exact `geothermal` substring counts; 2019-2021 denominators are PostgreSQL estimates, 2022 exact NDJSON scans |

Build order: `build_google_trends_monthly_2019_2022.py` →
`build_guardian_monthly_aggregate_2019_2022.py` →
`build_monthly_multisource_2019_2022.py`. Output is the 48-month panel
`analysis_05_monthly_multisource_attention_panel_2019_2022.csv`.

### Validation checks (all passed)

1. 48 rows, 12 months per year, no missing values in any source column.
2. Guardian monthly sums reproduce the known annual unique-article counts
   exactly (55/33/55/57 for 2019-2022), confirming the year filter and
   record-id dedup exclude the 2025-2026 collection files that share the same
   interim directory.
3. X/Twitter monthly sums equal the aligned annual `exact_geothermal_hits`
   (all-language). The English-subset figures quoted elsewhere
   (703/479/556/677) come from a different column, not a discrepancy.

### Analysis conventions

- Cross-source association uses Spearman rank correlation on the 48 monthly
  observations; lead-lag screens shift one series by k = -3..+3 months.
- With 21 lead-lag tests and n = 48, nominally significant results (for
  example X/Twitter leading Guardian by 1-3 months, rho ≈ +0.38) are treated
  as screening hypotheses, not findings.
- Sources are plotted on separate axes (small multiples); the three series
  have incommensurable units and are never dual-axed or summed.

## Part 2: Local-LLM Annotation Pipeline

### Design decisions

| Decision | Choice | Rationale |
| --- | --- | --- |
| Model | `llama3.1:8b` (open weights) via Ollama | Runs fully on the project laptop (M5, 32 GB); no article or post text leaves the machine, matching the data-governance rule that raw records stay local |
| Decoding | Temperature 0, JSON schema enforced through Ollama structured output | Reproducible labels; schema-invalid output is impossible by construction |
| Unit of analysis | Guardian: headline + trail text + section + date. No article bodies are stored locally | Labels describe visible-metadata content, not full articles |
| Label schema | The six labels from `docs/social_media/annotation_codebook.md`, with location confidence replaced by `geographic_focus` (us_state / us_national / non_us / unclear) for news text | The codebook's location label presumes social-post author metadata; geography of coverage is what Task 1 needs from news |
| Provenance | Every row records model tag, prompt version, and timestamp; aggregates ship with a provenance table | Prompt and model changes are auditable |
| Governance | Article-level labels stay git-ignored under `data/interim/guardian/llm_annotations/`; only monthly aggregate counts are committed | Same boundary as the raw metadata |

### Prompt development protocol

Prompts are versioned (`PROMPT_VERSION` in the script). v1 failed a 5-article
smoke test in two ways: a UK story (Bath Abbey) was labeled `us_national`,
and a clearly relevant article received no frames. v2 added an explicit
reminder that the Guardian is a British newspaper with examples of non-US
places, and guidance that relevant energy stories almost always carry at
least one frame. Both errors resolved on retest. The protocol going forward:
never change the prompt without re-running the smoke set, and never mix
prompt versions within one analysis without re-annotating.

### Two-layer human + LLM protocol

The LLM pass is the first layer. The human-review queue is defined by rule,
not convenience:

1. all rows with model-reported `confidence = low` (31 of 386 in this run),
2. all logically inconsistent rows, currently `relevance = relevant` with
   `technology_type = non_energy_context` (24 of 386),
3. a stratified spot-check sample for error-rate estimation.

Disagreement rates from the human pass become the reported annotation error
estimate. Until that pass is done, LLM label distributions should be
described as model-assisted estimates.

### Headline results from the Guardian run (n = 386, zero failures)

- Relevance from visible text: 109 relevant, 66 uncertain, 211 irrelevant.
  Guardian full-text search matches article bodies, so roughly 72% of
  collected articles are not geothermal stories at the headline level. The
  panel's raw `guardian_unique_article_count` therefore mixes signal and
  noise and needs a relevance filter before perception claims.
- Geography of the 109 relevant articles: 64 non-US, 34 US-national, 8
  US-state, 3 unclear. The "U.S.-focused" description of the Guardian layer
  should be revised; clean US geothermal coverage is about 42 articles over
  seven years.
- Stance is dominated by `neutral_informational` (96 of 109), as expected for
  straight news; frames are dominated by climate/clean-energy (92), with
  seismicity nearly absent (4).

### Known limitations

1. Labels are based on headline + trail text only; body-level frames are
   invisible. This is a fixed property of the locally stored metadata, not of
   the model.
2. An 8B model makes recoverable errors (the v1 geography error); label
   quality at this size has not yet been benchmarked against a larger model.
   A planned check is re-annotating a 50-article subsample with Qwen3 14B and
   reporting agreement.
3. Guardian stance measures media framing, not public opinion. No acceptance
   claims follow from these labels.

## Reuse for the X/Twitter Leg

The pipeline transfers unchanged except for inputs: a stratified local export
of 300 posts (150 core-geothermal layer, 150 named-place/seismic layer,
spread across 2019-2022), fields `post_id, created_at, text, layer`, placed
under `data/interim/` and never committed. The codebook's original location
confidence label applies to posts and replaces `geographic_focus`. Aggregate
label rates are committed per month and per layer.
