-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch_openalex3.py
More file actions
86 lines (81 loc) · 4.38 KB
/
Copy pathsearch_openalex3.py
File metadata and controls
86 lines (81 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env python3
"""Final critical searches — fixed error handling."""
import urllib.request
import urllib.parse
import json
import time
def search_openalex(query, per_page=15):
url = f'https://api.openalex.org/works?filter=title_and_abstract.search:{urllib.parse.quote(query)}&sort=publication_date:desc&per_page={per_page}'
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0 (research bot)'})
with urllib.request.urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode('utf-8'))
def extract_papers(data, min_year=2024):
papers = []
for r in data.get('results', []):
year = r.get('publication_year', 0)
if year < min_year:
continue
title = r.get('title', 'No title')
date = r.get('publication_date', str(year))
doi = r.get('doi', '') or ''
authors = []
for a in r.get('authorships', []):
if a and isinstance(a, dict):
author = a.get('author')
if author and isinstance(author, dict):
authors.append(author.get('display_name', '?'))
loc = r.get('primary_location')
journal = ''
if loc and isinstance(loc, dict):
source = loc.get('source')
if source and isinstance(source, dict):
journal = source.get('display_name', '') or ''
oa_info = r.get('open_access')
is_oa = oa_info.get('is_oa', False) if oa_info and isinstance(oa_info, dict) else False
cited_by = r.get('cited_by_count', 0)
papers.append({'title': title, 'date': date, 'year': year, 'doi': doi,
'authors': authors, 'journal': journal, 'is_oa': is_oa,
'cited_by': cited_by})
return papers
def print_papers(papers, label):
print(f"\n{'='*80}")
print(f"📚 {label} ({len(papers)} papers)")
print(f"{'='*80}")
if not papers:
print(" (no results)")
return
for i, p in enumerate(papers, 1):
print(f"\n [{i}] [{p['year']}-{p['date'][5:10] if p['date'] else '??'}] {p['title'][:140]}")
print(f" Journal: {p['journal'][:70]}")
print(f" Authors: {', '.join(p['authors'][:4])}{' et al.' if len(p['authors']) > 4 else ''}")
print(f" DOI: {p['doi'][:70]}")
print(f" Cited: {p['cited_by']}")
QUERIES = [
("wildfire+brazil+deep+learning+detection+mapping", "Brazil Wildfire DL Detection/Mapping"),
("wildfire+burn+scar+satellite+deep+learning+2025", "Burn Scar Satellite DL 2025+"),
("wildfire+spread+prediction+graph+convolutional+network", "GCN Wildfire Spread Prediction"),
("physics+aware+neural+network+wildfire+propagation", "Physics-Aware NN Wildfire Propagation"),
("wildfire+spread+convolutional+LSTM+satellite+2025", "ConvLSTM Wildfire Satellite 2025+"),
("wildfire+detection+GOES+ABI+VIIRS+deep+learning+2025+2026", "GOES+VIIRS DL Detection 2025-2026"),
("wildfire+monitoring+foundation+model+earth+observation", "Foundation Model Wildfire EO"),
("koopman+neural+operator+forecast+prediction", "Koopman Neural Operator Forecast"),
("wildfire+data+assimilation+deep+learning", "Data Assimilation Wildfire DL"),
("digital+twin+wildfire+prediction+deep+learning+2025+2026", "DT Wildfire Prediction 2025-2026"),
("neural+operator+wildfire+spread+propagation+2025", "Neural Operator Wildfire Spread"),
("wildfire+risk+assessment+graph+neural+network", "GNN Wildfire Risk Assessment"),
("wildfire+deep+learning+explainable+AI+satellite", "XAI Wildfire Satellite DL"),
("wildfire+self+supervised+learning+satellite", "Self-Supervised Wildfire Learning"),
("wildfire+contrastive+learning+satellite", "Contrastive Learning Wildfire Satellite"),
("wildfire++machine+learning+Cerrado+Caatinga+2025+2026", "Cerrado+Caatinga Wildfire ML 2025-2026"),
("wildfire+prediction+recurrent+neural+network+convolutional+satellite", "RNN+CNN Wildfire Satellite"),
("wildfire+forecast+attention+mechanism+spatiotemporal", "Attention Spatiotemporal Wildfire"),
]
for query, label in QUERIES:
try:
data = search_openalex(query, per_page=10)
papers = extract_papers(data, min_year=2024)
recent = [p for p in papers if p['year'] >= 2025]
print_papers(recent if recent else papers[:5], label)
time.sleep(0.4)
except Exception as e:
print(f"\n⚠️ Error for '{label}': {e}")