- より良い本にするため、誤植や誤り、改善点等の洗い出しと反映を行う。
- サポートページへ反映されるまで時間がかかるので、一旦ここで管理する。
- 正式な内容は編集に依頼してサポートページへ掲載する。
- フィードバック、指摘、マサカリ、感謝します。
| ページ | 誤 | 正しい | 備考 |
| # /// script | |
| # requires-python = ">=3.12" | |
| # dependencies = [ | |
| # "fastapi>=0.115.12", | |
| # "langchain>=0.3.25", | |
| # "langgraph>=0.4.8", | |
| # "uvicorn>=0.34.3", | |
| # ] | |
| # /// | |
| from typing import Any, Dict, List, TypedDict |
| import random | |
| from collections import defaultdict | |
| from collections.abc import Iterator | |
| from typing import Literal, Optional | |
| import networkx as nx | |
| import numpy as np | |
| import numpy.typing as npt | |
| import tqdm | |
| from scipy.special import betaln, logsumexp |
| [paths] | |
| train = "./train.spacy" | |
| dev = "./dev.spacy" | |
| init_tok2vec = null | |
| vectors = null | |
| [corpora] | |
| [corpora.train] | |
| @readers = "spacy.Corpus.v1" |
| import spacy | |
| from spacy.tokens import DocBin | |
| from spacy_partial_tagger.tokenizer import CharacterTokenizer | |
| text = "Selegiline - induced postural hypotension in Parkinson's disease: a longitudinal study on the effects of drug withdrawal." | |
| patterns = [ | |
| {"label": "Chemical", "pattern": [{"LOWER": "selegiline"}]}, | |
| {"label": "Disease", "pattern": [{"LOWER": "hypotension"}]}, | |
| { | |
| "label": "Disease", |
| import os | |
| import urllib.request | |
| import spacy | |
| import tarfile | |
| from pathlib import Path | |
| def maybe_download(model, dest): | |
| save_path = Path(dest) / model | |
| if not os.path.exists(save_path): |
| #!/bin/bash | |
| REGION=us-east-1 | |
| RUNTIME=python3.7 | |
| while getopts :n:r:p: OPT | |
| do | |
| case $OPT in | |
| n) PACKAGE=$OPTARG;; | |
| r) REGION=$OPTARG;; | |
| p) RUNTIME=$OPTARG;; |
| REGION=us-west-1 | |
| RUNTIME=python3.7 | |
| docker run \ | |
| -v $(pwd):/opt \ | |
| -it lambci/lambda:build-$RUNTIME \ | |
| pip install spacy -t /opt/python | |
| zip -r spacy.zip python/ |