lukeslp commited on
Commit
bb580c2
·
verified ·
1 Parent(s): e45c4a7

Update README with YAML frontmatter and dataset card

Browse files
Files changed (1) hide show
  1. README.md +131 -59
README.md CHANGED
@@ -1,92 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # US Attention Data
2
 
3
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
4
- [![Data Sources](https://img.shields.io/badge/Sources-Wikipedia%20%7C%20GDELT%20%7C%20Google%20Trends-green)](https://en.wikipedia.org/wiki/Special:Statistics)
5
- [![HuggingFace](https://img.shields.io/badge/%F0%9F%A4%97-HuggingFace-yellow)](https://huggingface.co/datasets/lukeslp/us-attention-data)
6
 
7
- Weekly cross-platform attention metrics for tracking how much the world pays attention to the United States. Combines Wikipedia pageviews, GDELT global event mentions, and Google Trends search interest from 2020-2025.
8
 
9
- I built this dataset for the [one-year](https://dr.eamer.dev/datavis/one-year/) visualization project, which maps US global sentiment over time. Part of the [Data Trove](https://dr.eamer.dev/datavis/data_trove/) collection.
10
 
11
- ---
 
 
12
 
13
- ## What's Inside
14
 
15
- | File | Size | Description |
16
- |------|------|-------------|
17
- | `wikipedia_pageviews.json` | 2.5 MB | Daily pageview counts for US-related Wikipedia articles |
18
- | `wikipedia_event_articles.json` | 214 KB | Event-linked article metadata |
19
- | `wikipedia_trending.json` | 256 KB | Trending article detection |
20
- | `trends_data.json` | 810 KB | Google Trends search interest over time |
21
- | `weekly_trends.json` | 26 KB | Weekly trending topic aggregations |
22
- | `gdelt_timeline.json` | 131 KB | GDELT event mention timelines |
23
- | `gdelt_weekly_events.json` | 158 KB | GDELT weekly aggregated event counts and tone |
24
- | `events_unified.json` | 89 KB | Unified event data across all sources |
25
- | `weekly_attention_timeline.json` | 57 KB | Combined weekly attention metrics |
26
- | `unified_data.json` | 27 KB | Merged dataset across all attention sources |
27
- | `attention_metadata.json` | 2 KB | Collection metadata and schema |
28
 
29
- **Total: ~4.2 MB**
30
 
31
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
- ## Quick Start
 
 
 
 
34
 
35
- ### Python
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  ```python
38
  import json
 
39
 
40
- with open("wikipedia_pageviews.json") as f:
41
- pageviews = json.load(f)
42
-
43
- # Weekly attention across all sources
44
- with open("weekly_attention_timeline.json") as f:
45
- timeline = json.load(f)
46
- ```
47
 
48
- ### D3.js
 
49
 
50
- ```javascript
51
- const pageviews = await d3.json("wikipedia_pageviews.json");
52
- const gdelt = await d3.json("gdelt_weekly_events.json");
53
  ```
54
 
55
- ---
56
 
57
- ## Data Sources
 
 
 
 
58
 
59
- | Source | What It Tracks | Coverage |
60
- |--------|---------------|----------|
61
- | [Wikipedia Pageviews API](https://wikimedia.org/api/rest_v1/) | Article view counts | 2020-2025, daily |
62
- | [GDELT Project](https://www.gdeltproject.org/) | Global event mentions and media tone | 2020-2025, weekly |
63
- | [Google Trends](https://trends.google.com/) | Search interest indices | 2020-2025, weekly |
64
 
65
- ---
66
 
67
- ## Use Cases
 
 
68
 
69
- - Tracking how global attention to the US shifts over time
70
- - Correlating media events with Wikipedia traffic and search interest
71
- - Identifying seasonal attention patterns (elections, holidays, crises)
72
- - Building composite attention indices from multiple independent signals
73
 
74
- ---
 
 
75
 
76
- ## Related
77
 
78
- - [one-year visualization](https://dr.eamer.dev/datavis/one-year/) -- the viz this data powers
79
- - [Data Trove](https://dr.eamer.dev/datavis/data_trove/) -- full dataset catalog
80
- - [lukesteuber.com](https://lukesteuber.com) -- portfolio
 
 
 
 
 
 
81
 
82
- ---
83
 
84
- ## Author
85
 
86
- [Luke Steuber](https://lukesteuber.com) -- [@lukesteuber.com](https://bsky.app/profile/lukesteuber.com) on Bluesky
 
 
 
87
 
88
- ## License
89
 
90
- MIT. See [LICENSE](LICENSE).
91
 
92
- Data sourced from Wikipedia (CC BY-SA), GDELT (open), and Google Trends (fair use for research).
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - time-series-forecasting
5
+ - text-classification
6
+ language:
7
+ - en
8
+ tags:
9
+ - attention-metrics
10
+ - wikipedia
11
+ - google-trends
12
+ - gdelt
13
+ - pageviews
14
+ - search-interest
15
+ - media-coverage
16
+ - sentiment-analysis
17
+ - event-tracking
18
+ pretty_name: US Attention Data
19
+ size_categories:
20
+ - n<1K
21
+ ---
22
+
23
  # US Attention Data
24
 
25
+ Digital attention metrics tracking Wikipedia pageviews, Google Trends search interest, and GDELT global event coverage for United States-related topics throughout 2025.
 
 
26
 
27
+ ## Dataset Description
28
 
29
+ This dataset aggregates attention signals from three authoritative sources to track how digital attention flows around US-related topics:
30
 
31
+ - **Wikipedia Pageviews** (Wikimedia REST API) - 2.5MB tracking 8 key articles across countries
32
+ - **Google Trends** (pytrends API) - 810KB covering 138 search terms in the US region
33
+ - **GDELT 2.1** (Doc API) - Event mentions across 44 countries
34
 
35
+ ### Use Cases
36
 
37
+ - Media attention analysis
38
+ - Event impact measurement
39
+ - Search trend correlation
40
+ - Cross-platform attention patterns
41
+ - News cycle dynamics
42
+ - Public interest tracking
 
 
 
 
 
 
 
43
 
44
+ ## Dataset Structure
45
 
46
+ ### Data Files (10 total, 4.3 MB)
47
+
48
+ #### Wikipedia Pageviews
49
+ - `wikipedia_pageviews.json` - 2.5 MB - Country-level pageview analysis
50
+ - `wikipedia_trending.json` - 250 KB - Top 500 trending articles
51
+ - `wikipedia_event_articles.json` - 210 KB - Event-driven article tracking
52
+
53
+ #### Google Trends
54
+ - `trends_data.json` - 810 KB - 138 search terms, full year time series
55
+ - `weekly_trends.json` - 26 KB - Weekly aggregated snapshot
56
+
57
+ #### GDELT Event Coverage
58
+ - `gdelt_timeline.json` - 131 KB - 44 countries, event mentions
59
+ - `gdelt_weekly_events.json` - 158 KB - Weekly event aggregation
60
+
61
+ #### Unified Cross-Source
62
+ - `events_unified.json` - 88 KB - 177 events combined
63
+ - `unified_data.json` - 27 KB - High-level unified analysis
64
+ - `weekly_attention_timeline.json` - 56 KB - Weekly cross-platform metrics
65
+
66
+ ### Metadata Files
67
+
68
+ Each data file has a companion `*_metadata.json` with:
69
+ - Source API details
70
+ - Field descriptions
71
+ - Update timestamps
72
+ - Record counts
73
+ - Usage notes
74
+
75
+ ## Data Collection
76
 
77
+ ### Wikipedia (Wikimedia REST API)
78
+ - **Endpoint**: `https://wikimedia.org/api/rest_v1`
79
+ - **Auth**: None required
80
+ - **Rate Limit**: 5000 req/hour per IP
81
+ - **License**: CC0 Public Domain
82
 
83
+ ### Google Trends (pytrends)
84
+ - **Package**: `pytrends` Python library
85
+ - **Auth**: None required
86
+ - **Rate Limit**: Soft limits (use responsibly)
87
+ - **License**: Google Terms of Service
88
+
89
+ ### GDELT (GDELT 2.1 Doc API)
90
+ - **Endpoint**: `https://api.gdeltproject.org/api/v2/doc/doc`
91
+ - **Query**: `("United States" OR "United States of America")`
92
+ - **Auth**: None required
93
+ - **License**: Free for research and commercial use
94
+
95
+ ## Loading the Data
96
 
97
  ```python
98
  import json
99
+ import pandas as pd
100
 
101
+ # Load Wikipedia pageviews
102
+ with open('data/wikipedia_pageviews.json') as f:
103
+ wp_data = json.load(f)
 
 
 
 
104
 
105
+ # Load Google Trends
106
+ trends = pd.read_json('data/trends_data.json')
107
 
108
+ # Load GDELT events
109
+ with open('data/gdelt_timeline.json') as f:
110
+ gdelt = json.load(f)
111
  ```
112
 
113
+ ## Key Findings
114
 
115
+ - **Wikipedia** serves as primary information source with event-driven pageview spikes
116
+ - **Google Trends** shows search volatility averaging 3-5 day persistence
117
+ - **GDELT** reveals uneven global media coverage (Western bias)
118
+ - **Cross-source correlation** during major events (disasters, elections, conflicts)
119
+ - **Attention decay** follows exponential curve with 2-4 day half-life
120
 
121
+ ## Visualizations
 
 
 
 
122
 
123
+ Three live dashboards built on this data:
124
 
125
+ 1. **One-Year US Global Sentiment** - [dr.eamer.dev/datavis/one-year](https://dr.eamer.dev/datavis/one-year)
126
+ - Uses: `gdelt_timeline.json`
127
+ - Visualizes global media coverage patterns
128
 
129
+ 2. **Trends 2025** - [dr.eamer.dev/datavis/trends-2025](https://dr.eamer.dev/datavis/trends-2025)
130
+ - Uses: `trends_data.json`
131
+ - Interactive Google Trends dashboard
 
132
 
133
+ 3. **Wikipedia Attention Analytics** - [dr.eamer.dev/datavis/wiki-attention](https://dr.eamer.dev/datavis/wiki-attention)
134
+ - Uses: `wikipedia_pageviews.json`
135
+ - Pageview trend analysis
136
 
137
+ ## Citation
138
 
139
+ ```bibtex
140
+ @dataset{steuber2026attention,
141
+ title={US Attention Data: Digital Attention Metrics from Wikipedia, Google Trends, and GDELT},
142
+ author={Steuber, Luke},
143
+ year={2026},
144
+ publisher={HuggingFace},
145
+ url={https://huggingface.co/datasets/lukeslp/us-attention-data}
146
+ }
147
+ ```
148
 
149
+ ## License
150
 
151
+ MIT License - See LICENSE file for details.
152
 
153
+ Data sources have their own licenses:
154
+ - Wikipedia data: CC0 Public Domain
155
+ - Google Trends: Subject to Google Terms of Service
156
+ - GDELT: Free for research and commercial use
157
 
158
+ ## About
159
 
160
+ Created by Luke Steuber
161
 
162
+ - **Website**: [lukesteuber.com](https://lukesteuber.com)
163
+ - **Portfolio**: [dr.eamer.dev](https://dr.eamer.dev)
164
+ - **Bluesky**: [@lukesteuber.com](https://bsky.app/profile/lukesteuber.com)