Skip to content
Back to skills

Document And Data

ASecurity

"Guides HanLP input and output data contracts, Document APIs, task

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
documentationpythonapi

Works with

  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill document-and-data --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Document And Data?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Document And Data
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-document-and-data/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-document-and-data)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

```python
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 need | Use |
| --- | --- |
| Decide whether input should be raw text, sentence list, or tokenized sentences | `references/data-formats.md` |
| Interpret keys such as `tok/fine`, `pos/ctb`, `ner/msra`, `dep`, `con`, `srl`, `sdp`, `amr` | `references/annotation-keys.md` |
| Convert a `Document` to JSON, pretty text, or CoNLL | `references/document-api-reference.md` |
| Validate a JSON file before downstream processing | `scripts/validate_document_json.py` |

Files in this skill

  • SKILL.md1.8 KB
  • references/annotation-keys.md657 B
  • references/data-formats.md653 B
  • references/document-api-reference.md764 B
  • references/troubleshooting.md597 B
  • scripts/document_smoke.py835 B
  • scripts/validate_document_json.py1.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.