SPB Git

Repository Public

shared.ts 8.3 KB 113 lines typescript

1/**2 * Shared material of the AI templates: the bilingual text helper (with French typography) and the3 * bibliography. Every record below was fetched and checked on CHECKED_AT — Crossref for the DOIs,4 * the arXiv abstract page for the preprints — and title, authors and year were copied from the response.5 */6import type { Locale, SheetInput } from "@/schema";7import { L } from "../types";89type SourceInput = NonNullable<SheetInput["sources"]>[number];1011const NBSP = " ";12const NNBSP = " ";1314/**15 * French typography on hand-written text: typographic apostrophes, non-breaking spaces inside « » and before : ; ? ! %.16 * Inline code, inline LaTeX and link targets are left untouched.17 */18export function frTypo(s: string): string {19  return s20    .split(/(`[^`]*`|\$[^$]*\$|\]\([^)]*\))/)21    .map((part, i) =>22      i % 2 === 123        ? part24        : part25            .replace(/(\p{L})'(?=\p{L})/gu, "$1\u2019")26            .replace(/« /g, `«${NBSP}`)27            .replace(/ »/g, `${NBSP}»`)28            .replace(/ :(?=\s|$)/g, `${NBSP}:`)29            .replace(/ ([;?!])/g, `${NNBSP}$1`)30            .replace(/(\d) %/g, `$1${NBSP}%`),31    )32    .join("");33}3435/** `const t = T(locale); t("français", "English")` — the L helper, plus French typography. */36export const T = (locale: Locale) => {37  const pick = L(locale);38  return (fr: string, en: string) => (locale === "fr" ? frTypo(pick(fr, en)) : pick(fr, en));39};4041export const CHECKED_AT = "2026-11-17T16:58:58Z";4243const arxiv = (id: string, arxivId: string, title: string, authors: string[], year: number): SourceInput => ({44  id, type: "preprint", title, authors, year, container: `arXiv:${arxivId}`, url: `https://arxiv.org/abs/${arxivId}`,45  status: "resolved", checkedAt: CHECKED_AT,46});47const article = (id: string, doi: string, title: string, authors: string[], year: number, container: string): SourceInput => ({48  id, type: "article", title, authors, year, container, doi, url: `https://doi.org/${doi}`,49  status: "resolved", checkedAt: CHECKED_AT,50});5152const SOURCES = {53  vaswani2017: arxiv("vaswani2017", "1706.03762", "Attention Is All You Need",54    ["Ashish Vaswani", "Noam Shazeer", "Niki Parmar", "Jakob Uszkoreit", "Llion Jones", "Aidan N. Gomez", "Lukasz Kaiser", "Illia Polosukhin"], 2017),55  ba2016: arxiv("ba2016", "1607.06450", "Layer Normalization", ["Jimmy Lei Ba", "Jamie Ryan Kiros", "Geoffrey E. Hinton"], 2016),56  he2016: article("he2016", "10.1109/CVPR.2016.90", "Deep Residual Learning for Image Recognition",57    ["Kaiming He", "Xiangyu Zhang", "Shaoqing Ren", "Jian Sun"], 2016, "2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 770–778"),58  devlin2018: arxiv("devlin2018", "1810.04805", "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding",59    ["Jacob Devlin", "Ming-Wei Chang", "Kenton Lee", "Kristina Toutanova"], 2018),60  brown2020: arxiv("brown2020", "2005.14165", "Language Models are Few-Shot Learners",61    ["Tom B. Brown", "Benjamin Mann", "Nick Ryder", "Melanie Subbiah", "Jared Kaplan", "Prafulla Dhariwal", "et al. (31 authors)"], 2020),6263  jacobs1991: article("jacobs1991", "10.1162/neco.1991.3.1.79", "Adaptive Mixtures of Local Experts",64    ["Robert A. Jacobs", "Michael I. Jordan", "Steven J. Nowlan", "Geoffrey E. Hinton"], 1991, "Neural Computation, 3(1), 79–87"),65  jordan1994: article("jordan1994", "10.1162/neco.1994.6.2.181", "Hierarchical Mixtures of Experts and the EM Algorithm",66    ["Michael I. Jordan", "Robert A. Jacobs"], 1994, "Neural Computation, 6(2), 181–214"),67  shazeer2017: arxiv("shazeer2017", "1701.06538", "Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer",68    ["Noam Shazeer", "Azalia Mirhoseini", "Krzysztof Maziarz", "Andy Davis", "Quoc Le", "Geoffrey Hinton", "Jeff Dean"], 2017),69  lepikhin2020: arxiv("lepikhin2020", "2006.16668", "GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding",70    ["Dmitry Lepikhin", "HyoukJoong Lee", "Yuanzhong Xu", "Dehao Chen", "Orhan Firat", "Yanping Huang", "Maxim Krikun", "Noam Shazeer", "Zhifeng Chen"], 2020),71  fedus2021: arxiv("fedus2021", "2101.03961", "Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity",72    ["William Fedus", "Barret Zoph", "Noam Shazeer"], 2021),7374  lewis2020: arxiv("lewis2020", "2005.11401", "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks",75    ["Patrick Lewis", "Ethan Perez", "Aleksandra Piktus", "Fabio Petroni", "Vladimir Karpukhin", "Naman Goyal", "Heinrich Küttler", "Mike Lewis", "Wen-tau Yih", "Tim Rocktäschel", "Sebastian Riedel", "Douwe Kiela"], 2020),76  karpukhin2020: article("karpukhin2020", "10.18653/v1/2020.emnlp-main.550", "Dense Passage Retrieval for Open-Domain Question Answering",77    ["Vladimir Karpukhin", "Barlas Oguz", "Sewon Min", "Patrick Lewis", "Ledell Wu", "Sergey Edunov", "Danqi Chen", "Wen-tau Yih"], 2020,78    "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 6769–6781"),79  robertson2009: article("robertson2009", "10.1561/1500000019", "The Probabilistic Relevance Framework: BM25 and Beyond",80    ["Stephen Robertson", "Hugo Zaragoza"], 2009, "Foundations and Trends in Information Retrieval, 4(1–2), 1–174"),81  reimers2019: article("reimers2019", "10.18653/v1/D19-1410", "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",82    ["Nils Reimers", "Iryna Gurevych"], 2019,83    "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 3980–3990"),84  gao2023: arxiv("gao2023", "2312.10997", "Retrieval-Augmented Generation for Large Language Models: A Survey",85    ["Yunfan Gao", "Yun Xiong", "Xinyu Gao", "Kangxiang Jia", "Jinliu Pan", "Yuxi Bi", "Yi Dai", "Jiawei Sun", "Meng Wang", "Haofen Wang"], 2023),8687  hu2021: arxiv("hu2021", "2106.09685", "LoRA: Low-Rank Adaptation of Large Language Models",88    ["Edward J. Hu", "Yelong Shen", "Phillip Wallis", "Zeyuan Allen-Zhu", "Yuanzhi Li", "Shean Wang", "Lu Wang", "Weizhu Chen"], 2021),89  liu2023: article("liu2023", "10.1145/3560815", "Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing",90    ["Pengfei Liu", "Weizhe Yuan", "Jinlan Fu", "Zhengbao Jiang", "Hiroaki Hayashi", "Graham Neubig"], 2023, "ACM Computing Surveys, 55(9), 1–35"),91  wei2022: arxiv("wei2022", "2201.11903", "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models",92    ["Jason Wei", "Xuezhi Wang", "Dale Schuurmans", "Maarten Bosma", "Brian Ichter", "Fei Xia", "Ed Chi", "Quoc Le", "Denny Zhou"], 2022),9394  shazeer2019: arxiv("shazeer2019", "1911.02150", "Fast Transformer Decoding: One Write-Head is All You Need", ["Noam Shazeer"], 2019),95  ainslie2023: arxiv("ainslie2023", "2305.13245", "GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints",96    ["Joshua Ainslie", "James Lee-Thorp", "Michiel de Jong", "Yury Zemlyanskiy", "Federico Lebrón", "Sumit Sanghai"], 2023),97  kwon2023: arxiv("kwon2023", "2309.06180", "Efficient Memory Management for Large Language Model Serving with PagedAttention",98    ["Woosuk Kwon", "Zhuohan Li", "Siyuan Zhuang", "Ying Sheng", "Lianmin Zheng", "Cody Hao Yu", "Joseph E. Gonzalez", "Hao Zhang", "Ion Stoica"], 2023),99100  rumelhart1986: article("rumelhart1986", "10.1038/323533a0", "Learning representations by back-propagating errors",101    ["David E. Rumelhart", "Geoffrey E. Hinton", "Ronald J. Williams"], 1986, "Nature, 323(6088), 533–536"),102  lecun1998: article("lecun1998", "10.1109/5.726791", "Gradient-based learning applied to document recognition",103    ["Y. Lecun", "L. Bottou", "Y. Bengio", "P. Haffner"], 1998, "Proceedings of the IEEE, 86(11), 2278–2324"),104  lecun2015: article("lecun2015", "10.1038/nature14539", "Deep learning",105    ["Yann LeCun", "Yoshua Bengio", "Geoffrey Hinton"], 2015, "Nature, 521(7553), 436–444"),106  kingma2014: arxiv("kingma2014", "1412.6980", "Adam: A Method for Stochastic Optimization", ["Diederik P. Kingma", "Jimmy Ba"], 2014),107} satisfies Record<string, SourceInput>;108109export type SourceKey = keyof typeof SOURCES;110111/** Fresh copies of the requested bibliography records, in the given order. */112export const pickSources = (...keys: SourceKey[]): SourceInput[] => keys.map((k) => ({ ...SOURCES[k], authors: [...(SOURCES[k].authors ?? [])] }));113
Files main
Menu

Theme