인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
문서 및 사무 · SKILL.md

document-and-data

document-and-data

Guides HanLP input and output data contracts, Document APIs, task keys, annotation schemas, JSON validation, pretty printing, and CoNLL conversion.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: document-and-data description: "Guides HanLP input and output data contracts, Document APIs, task keys, annotation schemas, JSON validation, pretty printing, and CoNLL conversion." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Document And Data

Use this sub-skill when the task is about HanLP input shapes, output JSON, hanlp_common.Document, task keys, annotation spans, pretty printing, CoNLL conversion, or validating a HanLP-like document.

Read First

  • Read references/data-formats.md for RESTful/native input shapes and output nesting.
  • Read references/document-api-reference.md for verified Document methods.
  • Read references/annotation-keys.md for task-key meanings and annotation schema notes.
  • Read references/troubleshooting.md for malformed JSON, prefix mismatches, missing fields, and conversion issues.
  • Run scripts/document_smoke.py to test Document behavior with a tiny fixture.
  • Run scripts/validate_document_json.py to lightly validate a saved HanLP-like JSON object.

Minimal Document Usage

from hanlp_common.document import Document
doc = Document(tok=[["商品", "和", "服务"]], pos=[["NN", "CC", "NN"]])
print(doc.to_json())
print(doc.count_sentences())
print(doc.get_by_prefix("tok"))

Route by Data Task

User needUse
Decide whether input should be raw text, sentence list, or tokenized sentencesreferences/data-formats.md
Interpret keys such as tok/fine, pos/ctb, ner/msra, dep, con, srl, sdp, amrreferences/annotation-keys.md
Convert a Document to JSON, pretty text, or CoNLLreferences/document-api-reference.md
Validate a JSON file before downstream processingscripts/validate_document_json.py
저장한 Skills