{
    "openapi": "3.0.0",
    "info": {
        "title": "智能分词 - API文档",
        "version": "1.0.0",
        "description": "NLP智能分词，快速把一段文本切分为一个个词组，并标注了词性。当参数str为1时，返回字符串形式的词组结果，以空格分隔。大文本分词时，应该使用post请求方式。且最大不能超过1000个字符。部分词性标注代码请参考<a href=\"https:\/\/www.tianapi.com\/article\/150\" target=\"_blank\">中文智能分词接口词性代码释义<\/a>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/nlpwords\/index": {
            "get": {
                "summary": "智能分词",
                "tags": [
                    "智能分词"
                ],
                "description": "自动将一段文本按词义切分",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "str",
                        "in": "query",
                        "description": "返回类型，数组0[默认]、字符串1",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "返回类型，数组0[默认]、字符串1"
                        }
                    },
                    {
                        "name": "content",
                        "in": "query",
                        "description": "文本内容",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "今天小天和kitty去上海外滩和南京东路玩",
                            "description": "文本内容"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "word": {
                                            "type": "string",
                                            "example": "今天",
                                            "description": "词语"
                                        },
                                        "index": {
                                            "type": "string",
                                            "example": "0",
                                            "description": "词组序号"
                                        },
                                        "word_tag": {
                                            "type": "string",
                                            "example": "132",
                                            "description": "词性代码"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "word": "今天",
                                                "index": "0",
                                                "word_tag": "132"
                                            },
                                            {
                                                "word": "小天",
                                                "index": "1",
                                                "word_tag": "96"
                                            },
                                            {
                                                "word": "和",
                                                "index": "2",
                                                "word_tag": "108"
                                            },
                                            {
                                                "word": "kitty",
                                                "index": "3",
                                                "word_tag": "95"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "智能分词",
                "tags": [
                    "智能分词"
                ],
                "description": "自动将一段文本按词义切分",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "str": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "返回类型，数组0[默认]、字符串1"
                                    },
                                    "content": {
                                        "type": "string",
                                        "example": "今天小天和kitty去上海外滩和南京东路玩",
                                        "description": "文本内容"
                                    }
                                },
                                "required": [
                                    "key",
                                    "content"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "word": {
                                            "type": "string",
                                            "example": "今天",
                                            "description": "词语"
                                        },
                                        "index": {
                                            "type": "string",
                                            "example": "0",
                                            "description": "词组序号"
                                        },
                                        "word_tag": {
                                            "type": "string",
                                            "example": "132",
                                            "description": "词性代码"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "word": "今天",
                                                "index": "0",
                                                "word_tag": "132"
                                            },
                                            {
                                                "word": "小天",
                                                "index": "1",
                                                "word_tag": "96"
                                            },
                                            {
                                                "word": "和",
                                                "index": "2",
                                                "word_tag": "108"
                                            },
                                            {
                                                "word": "kitty",
                                                "index": "3",
                                                "word_tag": "95"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}