{"record":{"id":"c23b9799b47383f5","repo":"hankcs/HanLP","slug":"chinese-treebank-9-0-is-a-copyright-dataset-owned","errorCode":null,"errorMessage":"Chinese Treebank 9.0 is a copyright dataset owned by LDC which we cannot re-distribute. Please apply for a licence from LDC (https://catalog.ldc.upenn.edu/LDC2016T13) then download it to {path_from_url(_CTB9_HOME)}","messagePattern":"Chinese Treebank 9\\.0 is a copyright dataset owned by LDC which we cannot re-distribute\\. Please apply for a licence from LDC \\(https://catalog\\.ldc\\.upenn\\.edu/LDC2016T13\\) then download it to (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"critical","filePath":"hanlp/datasets/parsing/ctb9.py","lineNumber":49,"sourceCode":"\nCTB9_BRACKET_LINE_NOEC_TRAIN = _CTB9_HOME + 'tasks/par/train.noempty.txt'\n'''Training set for ctb9 constituency parsing without empty categories.'''\nCTB9_BRACKET_LINE_NOEC_DEV = _CTB9_HOME + 'tasks/par/dev.noempty.txt'\n'''Dev set for ctb9 constituency parsing without empty categories.'''\nCTB9_BRACKET_LINE_NOEC_TEST = _CTB9_HOME + 'tasks/par/test.noempty.txt'\n'''Test set for ctb9 constituency parsing without empty categories.'''\n\nCTB9_SD330_TRAIN = _CTB9_HOME + 'tasks/dep/train.conllx'\n'''Training set for ctb9 in Stanford Dependencies 3.3.0 standard.'''\nCTB9_SD330_DEV = _CTB9_HOME + 'tasks/dep/dev.conllx'\n'''Dev set for ctb9 in Stanford Dependencies 3.3.0 standard.'''\nCTB9_SD330_TEST = _CTB9_HOME + 'tasks/dep/test.conllx'\n'''Test set for ctb9 in Stanford Dependencies 3.3.0 standard.'''\n\ntry:\n    get_resource(_CTB9_HOME)\nexcept HTTPError:\n    raise FileNotFoundError(\n        'Chinese Treebank 9.0 is a copyright dataset owned by LDC which we cannot re-distribute. '\n        f'Please apply for a licence from LDC (https://catalog.ldc.upenn.edu/LDC2016T13) '\n        f'then download it to {path_from_url(_CTB9_HOME)}'\n    )\n\nmake_ctb(_CTB9_HOME)\n","sourceCodeStart":31,"sourceCodeEnd":56,"githubUrl":"https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/hanlp/datasets/parsing/ctb9.py#L31-L56","documentation":"At import time, hanlp.datasets.parsing.ctb9 tries to fetch the CTB9 dataset home and, on HTTPError (the data is not hosted), raises FileNotFoundError explaining that CTB 9.0 is LDC-licensed and cannot be redistributed. The message tells you to obtain an LDC licence and manually place the corpus at the shown local path.","triggerScenarios":"import hanlp.datasets.parsing.ctb9 (or a pipeline that pulls it in) without the CTB9 corpus already at the expected local path; the download attempt gets an HTTP error instead of data.","commonSituations":"Fresh machines/environments; assuming HanLP auto-downloads all datasets like it does for open ones; new users unaware CTB is paid LDC data.","solutions":["Apply for an LDC licence (LDC2016T13) and download CTB9","Copy/extract the corpus to the path shown in the message (path_from_url(_CTB9_HOME) — typically your HANLP data dir) and re-run","Alternatively use an open Chinese treebank/dataset supported by HanLP if licensing CTB is not an option"],"exampleFix":"# shell: after obtaining CTB9 from LDC\nmkdir -p ~/hanlp/ctb9\ncp -r /path/to/ctb9/* ~/hanlp/ctb9/\n# then re-run your script","handlingStrategy":"validation","validationCode":"from hanlp.utils.io_util import path_from_url\nfrom os.path import exists\nctb_home = path_from_url('http://nlp.ee.polyu.edu.hk/releases/ctb9/')  # or reuse _CTB9_HOME\nif not exists(ctb_home):\n    raise SystemExit(f'CTB9 corpus missing at {ctb_home}. Obtain LDC2016T13 and place it there.')","typeGuard":null,"tryCatchPattern":"try:\n    import hanlp.datasets.parsing.ctb9  # noqa\nexcept FileNotFoundError as e:\n    print(e)  # show licence/placement instructions\n    sys.exit(1)","preventionTips":["Pre-download licensed corpora to the HanLP data dir before importing dataset modules","Automate environment provisioning so licensed data presence is checked at deploy time"],"tags":["python","dataset","licensing","ldc","file-not-found"],"backgroundTag":"dataset-license-required","analyzedSha":"ddb1299bddff079e447af52ec12549c50636bfa8","analyzedAt":"2026-08-27T03:36:54.287Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}