Download _gather.py from zaaabik/reference_papers: direct link, hf CLI and curl.
- Browser
- Download file 2.54 kB
-
https://huggingface.co/datasets/zaaabik/reference_papers/resolve/main/_gather.py
- Command line
-
hf download hf://datasets/zaaabik/reference_papers/_gather.py
-
curl -L -o _gather.py https://huggingface.co/datasets/zaaabik/reference_papers/resolve/main/_gather.py
2.54 kB
| """Gather candidate papers from Semantic Scholar: venue-filtered keyword queries.""" | |
| import json, time, urllib.parse, urllib.request, sys | |
| QUERIES = [ | |
| "uncertainty estimation text classification", "misclassification detection", "selective prediction NLP", | |
| "selective classification", "out-of-distribution detection text", "out-of-distribution detection pretrained transformers", | |
| "calibration pretrained language models", "failure prediction confidence", "Mahalanobis distance out-of-distribution", | |
| "hallucination detection hidden states", "internal states language model truthfulness", "probing intermediate layers transformer", | |
| "layer-wise representations language model", "uncertainty quantification large language models", "confidence estimation language models", | |
| "error detection classifier confidence", "deep deterministic uncertainty", "hidden states probe correctness", | |
| "abstention language models", "near out-of-distribution detection", "uncertainty estimation transformers", | |
| ] | |
| VENUES = "NAACL,ACL,EMNLP,ICLR,NeurIPS,ICML,AAAI,TACL,COLING,EACL,Findings of the Association for Computational Linguistics,Transactions of the Association for Computational Linguistics,Annual Meeting of the Association for Computational Linguistics,Conference on Empirical Methods in Natural Language Processing,North American Chapter of the Association for Computational Linguistics,International Conference on Learning Representations,Neural Information Processing Systems,International Conference on Machine Learning,AAAI Conference on Artificial Intelligence,CVPR,Computer Vision and Pattern Recognition" | |
| FIELDS = "title,venue,year,openAccessPdf,externalIds,citationCount,authors" | |
| out = {} | |
| for q in QUERIES: | |
| for attempt in range(6): | |
| url = ("https://api.semanticscholar.org/graph/v1/paper/search?" + | |
| urllib.parse.urlencode({"query": q, "year": "2020-2026", "venue": VENUES, | |
| "fields": FIELDS, "limit": 40})) | |
| try: | |
| with urllib.request.urlopen(url, timeout=60) as r: | |
| d = json.load(r) | |
| break | |
| except Exception as e: | |
| print("retry", q, e, file=sys.stderr); time.sleep(5 + 5*attempt); d = {"data": []} | |
| for p in d.get("data", []): | |
| out.setdefault(p["paperId"], p)["_q"] = out.get(p["paperId"], {}).get("_q", []) + [q] | |
| print(q, len(d.get("data", [])), "total so far", len(out), file=sys.stderr) | |
| time.sleep(1.5) | |
| json.dump(list(out.values()), open("reference_papers/_candidates.json", "w"), indent=1) | |