Named Entity Recognition (NER) is the language-category specialist service in thcode’s AI for Thai catalog. It analyzes Thai text — or text mixing Thai and other scripts — and identifies spans that represent named entities such as people, places, and organizations, returning each entity with its label and character offset. This is useful whenever thcode needs to reason about proper nouns embedded in Thai source code comments, documentation strings, user-facing copy, or natural-language task descriptions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Temicide/thcode/llms.txt
Use this file to discover all available pages before exploring further.
NER is catalogued in this release. It is discoverable and fully inspectable via
/tools, but the endpoint mapping, live transport, and contract test are a subsequent integration phase. Invoking the service now returns a stub refusal: "Catalogued — Not available yet".NER is a member of the Verification Quartet — the four services required to pass live contract tests in Phase 1. It is verified coverage, but it is not part of the public Demo Portfolio. See ADR 0011 for the distinction.Service Identity
| Field | Value |
|---|---|
| Service ID | named-entity-recognition |
| Upstream name | Named Entity Recognition |
| Thai name | การรู้จำเอนทิตี |
| Category | language |
| Modality | text |
| Endpoint | https://api.aiforthai.in.th/thainer |
| Support level | catalogued |
| Contract ver. | 1.0.0 |
| Adapter ver. | 1.0.0 |
Search Terms
The router matches NER against the following terms. You can use any of them in the/tools search command:
Handler: Input Contract
TheNerSpecialistHandler builds a transport request from a text artifact. The handler reads the first prepared artifact, preferring the text property and falling back to extractedText when text is absent. The plain text string is then sent as a JSON body.
Request body sent to the NER endpoint
POST to https://api.aiforthai.in.th/thainer with:
Authorization: Bearer <key>— the raw API key is resolved in scope only and never appears in Evidence, logs, or the secret-freeheadersSummary(which shows[redacted]).Content-Type: application/json
Handler: Output Contract
TheNerSpecialistHandler maps the upstream JSON response into two typed SpecialistFieldValue fields:
- entities
- confidence
Kind: The handler never fabricates entities or labels. If the upstream array is empty or contains no valid elements, the field is
structuredMapped from the entities array in the upstream response. Each element must be a non-null, non-array object with both text: string and label: string properties to be kept — elements missing either field are dropped. Valid entities are wrapped verbatim (including the optional offset property) in { items: [...] }.present: false and listed in emptyFields.Fixture
The handler ships with a deterministic, built-in (non-user) fixture for health probes. The canary usestext/plain as the media type and sends the following Thai/mixed-language text containing known names, organizations, and locations:
| Text | Label | Offset |
|---|---|---|
สมชาย ใจดี | PERSON | 3 |
ไทยเทค จำกัด | ORGANIZATION | 28 |
กรุงเทพมหานคร | LOCATION | 47 |
สมหญิง รักเรียน | PERSON | 88 |
สนามบินสุวรรณภูมิ | LOCATION | 107 |
0.92. Any media type other than text/plain is rejected before the probe is dispatched.
Use Cases
Code Comments & Docstrings
Identify Thai proper nouns in inline comments or JSDoc/TSDoc blocks so Typhoon can reference them accurately in generated code or documentation.
User-Facing Strings
Detect names, places, and organizations in Thai UI copy or localization files, enabling targeted string substitution or validation.
Natural-Language Task Descriptions
Extract entities from a Thai task description before it is passed to the reasoning model, enriching the context with structured provenance.
Pipeline Chaining
Feed a Speech-to-Text transcript directly into NER to identify entities in spoken Thai — combining two specialist services in a single task flow.
Using /tools with NER
Inspect the NER catalog entry
Search for language or entity services