nlpir-python


Namenlpir-python JSON
Version 0.9.15.1 PyPI version JSON
download
home_page
SummaryNLPIR-python A python wrapper and toolkit for NLPIR
upload_time2023-08-16 05:29:15
maintainer
docs_urlNone
authoryangyaofei, LingJoin Co.,Ltd.
requires_python>=3.6
licenseMIT
keywords nlpir nlp chinese word segmentation ictclas cws
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NLPIR-python  A python wrapper and toolkit for NLPIR

nlpir-python 是一个 [NLPIR](https://github.com/NLPIR-team/NLPIR>) 的python调用包

nlpir-python is a python wrapper for NLPIR modules.

[![Documentation Status](https://readthedocs.org/projects/nlpir-python/badge/?version=latest)](https://nlpir-python.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/nlpir-python.svg)](https://badge.fury.io/py/nlpir-python)
![Test](https://github.com/NLPIR-team/nlpir-python/workflows/test/badge.svg)

- Documentation: https://nlpir-python.rtfd.io
- Github: https://github.com/NLPIR-team/nlpir-python
- Support: https://github.com/NLPIR-team/nlpir-python/issues
- Free software: [MIT license](http://opensource.org/licenses/MIT)

## About

本模块提供两种调用方式:

This package includes two level of method:

##### 1. Native call from Dynamic Link Library(DLL) 原生的直接调用DLL的调用方式

These methods are native method directory from DLL, you can easily use them if you are familiar with the NLPIR modules.

原生方法是直接调用的NLPIR中的api,并进行了部分简化处理,和python化.

```  python
    from nlpir.native import ICTCLAS
    test_str = "法国启蒙思想家孟德斯鸠曾说过:“一切有权力的人都容易滥用" \
               "权力,这是一条千古不变的经验。有权力的人直到把权力用到" \
               "极限方可休止。”另一法国启蒙思想家卢梭从社会契约论的观点" \
               "出发,认为国家权力是公民让渡其全部“自然权利”而获得的," \
               "他在其名著《社会契约论》中写道:“任何国家权力无不是以民" \
               "众的权力(权利)让渡与公众认可作为前提的”。"
    ictclas = ICTCLAS()
    ictclas.paragraph_process(test_str, 0)
```

##### 2. High-level pythonic method 整合后的更加Python的调用方式

However, the native methods are not very friendly to the beginners. These methods provide a wrapper and tools for the
native call, make it easier to use.

然而,对于一般用户来说,原生api功能强大但是却不是很友好.这里nlpir-python对原生api就行包装, 并提供了一些工具方法,使其更利于使用.

``` python
    from nlpir import ictclas, tools
    tools.update_license()
    test_str = "法国启蒙思想家孟德斯鸠曾说过:“一切有权力的人都容易滥用" \
               "权力,这是一条千古不变的经验。有权力的人直到把权力用到" \
               "极限方可休止。”另一法国启蒙思想家卢梭从社会契约论的观点" \
               "出发,认为国家权力是公民让渡其全部“自然权利”而获得的," \
               "他在其名著《社会契约论》中写道:“任何国家权力无不是以民" \
               "众的权力(权利)让渡与公众认可作为前提的”。"

    for word, pos in ictclas.segment(test_str, pos_tagged=True):
        print(word, pos)

```

**NOTE**: This module only support python3.6+

**NOTE**: This repo use the git-lfs, please install lfs when pull this repo

## Supported Table

|                   | Native        | Native Doc    | Native Test   | High-Level    | High-Level Doc    | High-Level Test   | Tutorial      | 
| ----              | :----:        | :----:        | :----:        | :----:        | :----:            | :----:            | :----:        |    
| ICTCLAS           |       ✔       |       ✔       |       ✔       |       ✔       |         ✔         |         ✔         |       ✔       |
| NewWordFinder     |       ✔       |       ✔       |       ✔       |       ✔       |         ✔         |         ✔         |               |
| KeyExtract        |       ✔       |       ✔       |       ✔       |       ✔       |         ✔         |         ✔         |               |
| Summary           |       ✔       |       ✔       |       ✔       |       ✔       |         ✔         |         ✔         |               |
| SentimentNew      |       ✔       |       ✔       |       ✍       |               |                   |                   |               |
| SentimentAnalysis |       ✔       |       ✔       |       ✍       |       ✔       |         ✔         |                   |               |
| Classify          |       ✔       |       ✔       |       ✍       |               |                   |                   |               |
| DeepClassify      |       ✔       |       ✔       |       ✍       |               |                   |                   |               |
| Cluster           |       ✔       |       ✔       |               |       ✔       |         ✔         |                   |               |
| EyeChecker        |       ✔       |       ✔       |       ✔       |       ✔       |         ✔         |         ✔         |               |
| DocCompare        |               |               |               |               |                   |                   |               |
| DocExtractor      |       ✔       |       ✔       |               |       ✔       |         ✔         |                   |               |
| DocParser         |               |               |               |               |                   |                   |               |
| iEncoder          |               |               |               |               |                   |                   |               |
| HTMLParser        |               |               |               |               |                   |                   |               |
| KeyScanner        |       ✔       |       ✔       |               |       ✔       |         ✔         |                   |               |
| RedupRemover      |               |               |               |               |                   |                   |               |
| SpellChecker      |               |               |               |               |                   |                   |               |
| SplitSentence     |               |               |               |               |                   |                   |               |
| TextSimilarity    |       ✔       |       ✍       |               |       ✔       |         ✔         |                   |               |
| Word2vec          |               |               |               |               |                   |                   |               |


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "nlpir-python",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "nlpir,nlp,Chinese word segmentation,ictclas,CWS",
    "author": "yangyaofei, LingJoin Co.,Ltd.",
    "author_email": "yangyaofei@gmail.com",
    "download_url": "",
    "platform": "win32",
    "description": "# NLPIR-python  A python wrapper and toolkit for NLPIR\n\nnlpir-python \u662f\u4e00\u4e2a [NLPIR](https://github.com/NLPIR-team/NLPIR>) \u7684python\u8c03\u7528\u5305\n\nnlpir-python is a python wrapper for NLPIR modules.\n\n[![Documentation Status](https://readthedocs.org/projects/nlpir-python/badge/?version=latest)](https://nlpir-python.readthedocs.io/en/latest/?badge=latest)\n[![PyPI version](https://badge.fury.io/py/nlpir-python.svg)](https://badge.fury.io/py/nlpir-python)\n![Test](https://github.com/NLPIR-team/nlpir-python/workflows/test/badge.svg)\n\n- Documentation: https://nlpir-python.rtfd.io\n- Github: https://github.com/NLPIR-team/nlpir-python\n- Support: https://github.com/NLPIR-team/nlpir-python/issues\n- Free software: [MIT license](http://opensource.org/licenses/MIT)\n\n## About\n\n\u672c\u6a21\u5757\u63d0\u4f9b\u4e24\u79cd\u8c03\u7528\u65b9\u5f0f:\n\nThis package includes two level of method:\n\n##### 1. Native call from Dynamic Link Library(DLL) \u539f\u751f\u7684\u76f4\u63a5\u8c03\u7528DLL\u7684\u8c03\u7528\u65b9\u5f0f\n\nThese methods are native method directory from DLL, you can easily use them if you are familiar with the NLPIR modules.\n\n\u539f\u751f\u65b9\u6cd5\u662f\u76f4\u63a5\u8c03\u7528\u7684NLPIR\u4e2d\u7684api,\u5e76\u8fdb\u884c\u4e86\u90e8\u5206\u7b80\u5316\u5904\u7406,\u548cpython\u5316.\n\n```  python\n    from nlpir.native import ICTCLAS\n    test_str = \"\u6cd5\u56fd\u542f\u8499\u601d\u60f3\u5bb6\u5b5f\u5fb7\u65af\u9e20\u66fe\u8bf4\u8fc7\uff1a\u201c\u4e00\u5207\u6709\u6743\u529b\u7684\u4eba\u90fd\u5bb9\u6613\u6ee5\u7528\" \\\n               \"\u6743\u529b\uff0c\u8fd9\u662f\u4e00\u6761\u5343\u53e4\u4e0d\u53d8\u7684\u7ecf\u9a8c\u3002\u6709\u6743\u529b\u7684\u4eba\u76f4\u5230\u628a\u6743\u529b\u7528\u5230\" \\\n               \"\u6781\u9650\u65b9\u53ef\u4f11\u6b62\u3002\u201d\u53e6\u4e00\u6cd5\u56fd\u542f\u8499\u601d\u60f3\u5bb6\u5362\u68ad\u4ece\u793e\u4f1a\u5951\u7ea6\u8bba\u7684\u89c2\u70b9\" \\\n               \"\u51fa\u53d1\uff0c\u8ba4\u4e3a\u56fd\u5bb6\u6743\u529b\u662f\u516c\u6c11\u8ba9\u6e21\u5176\u5168\u90e8\u201c\u81ea\u7136\u6743\u5229\u201d\u800c\u83b7\u5f97\u7684\uff0c\" \\\n               \"\u4ed6\u5728\u5176\u540d\u8457\u300a\u793e\u4f1a\u5951\u7ea6\u8bba\u300b\u4e2d\u5199\u9053\uff1a\u201c\u4efb\u4f55\u56fd\u5bb6\u6743\u529b\u65e0\u4e0d\u662f\u4ee5\u6c11\" \\\n               \"\u4f17\u7684\u6743\u529b\uff08\u6743\u5229\uff09\u8ba9\u6e21\u4e0e\u516c\u4f17\u8ba4\u53ef\u4f5c\u4e3a\u524d\u63d0\u7684\u201d\u3002\"\n    ictclas = ICTCLAS()\n    ictclas.paragraph_process(test_str, 0)\n```\n\n##### 2. High-level pythonic method \u6574\u5408\u540e\u7684\u66f4\u52a0Python\u7684\u8c03\u7528\u65b9\u5f0f\n\nHowever, the native methods are not very friendly to the beginners. These methods provide a wrapper and tools for the\nnative call, make it easier to use.\n\n\u7136\u800c,\u5bf9\u4e8e\u4e00\u822c\u7528\u6237\u6765\u8bf4,\u539f\u751fapi\u529f\u80fd\u5f3a\u5927\u4f46\u662f\u5374\u4e0d\u662f\u5f88\u53cb\u597d.\u8fd9\u91ccnlpir-python\u5bf9\u539f\u751fapi\u5c31\u884c\u5305\u88c5, \u5e76\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5de5\u5177\u65b9\u6cd5,\u4f7f\u5176\u66f4\u5229\u4e8e\u4f7f\u7528.\n\n``` python\n    from nlpir import ictclas, tools\n    tools.update_license()\n    test_str = \"\u6cd5\u56fd\u542f\u8499\u601d\u60f3\u5bb6\u5b5f\u5fb7\u65af\u9e20\u66fe\u8bf4\u8fc7\uff1a\u201c\u4e00\u5207\u6709\u6743\u529b\u7684\u4eba\u90fd\u5bb9\u6613\u6ee5\u7528\" \\\n               \"\u6743\u529b\uff0c\u8fd9\u662f\u4e00\u6761\u5343\u53e4\u4e0d\u53d8\u7684\u7ecf\u9a8c\u3002\u6709\u6743\u529b\u7684\u4eba\u76f4\u5230\u628a\u6743\u529b\u7528\u5230\" \\\n               \"\u6781\u9650\u65b9\u53ef\u4f11\u6b62\u3002\u201d\u53e6\u4e00\u6cd5\u56fd\u542f\u8499\u601d\u60f3\u5bb6\u5362\u68ad\u4ece\u793e\u4f1a\u5951\u7ea6\u8bba\u7684\u89c2\u70b9\" \\\n               \"\u51fa\u53d1\uff0c\u8ba4\u4e3a\u56fd\u5bb6\u6743\u529b\u662f\u516c\u6c11\u8ba9\u6e21\u5176\u5168\u90e8\u201c\u81ea\u7136\u6743\u5229\u201d\u800c\u83b7\u5f97\u7684\uff0c\" \\\n               \"\u4ed6\u5728\u5176\u540d\u8457\u300a\u793e\u4f1a\u5951\u7ea6\u8bba\u300b\u4e2d\u5199\u9053\uff1a\u201c\u4efb\u4f55\u56fd\u5bb6\u6743\u529b\u65e0\u4e0d\u662f\u4ee5\u6c11\" \\\n               \"\u4f17\u7684\u6743\u529b\uff08\u6743\u5229\uff09\u8ba9\u6e21\u4e0e\u516c\u4f17\u8ba4\u53ef\u4f5c\u4e3a\u524d\u63d0\u7684\u201d\u3002\"\n\n    for word, pos in ictclas.segment(test_str, pos_tagged=True):\n        print(word, pos)\n\n```\n\n**NOTE**: This module only support python3.6+\n\n**NOTE**: This repo use the git-lfs, please install lfs when pull this repo\n\n## Supported Table\n\n|                   | Native        | Native Doc    | Native Test   | High-Level    | High-Level Doc    | High-Level Test   | Tutorial      | \n| ----              | :----:        | :----:        | :----:        | :----:        | :----:            | :----:            | :----:        |    \n| ICTCLAS           |       \u2714       |       \u2714       |       \u2714       |       \u2714       |         \u2714         |         \u2714         |       \u2714       |\n| NewWordFinder     |       \u2714       |       \u2714       |       \u2714       |       \u2714       |         \u2714         |         \u2714         |               |\n| KeyExtract        |       \u2714       |       \u2714       |       \u2714       |       \u2714       |         \u2714         |         \u2714         |               |\n| Summary           |       \u2714       |       \u2714       |       \u2714       |       \u2714       |         \u2714         |         \u2714         |               |\n| SentimentNew      |       \u2714       |       \u2714       |       \u270d       |               |                   |                   |               |\n| SentimentAnalysis |       \u2714       |       \u2714       |       \u270d       |       \u2714       |         \u2714         |                   |               |\n| Classify          |       \u2714       |       \u2714       |       \u270d       |               |                   |                   |               |\n| DeepClassify      |       \u2714       |       \u2714       |       \u270d       |               |                   |                   |               |\n| Cluster           |       \u2714       |       \u2714       |               |       \u2714       |         \u2714         |                   |               |\n| EyeChecker        |       \u2714       |       \u2714       |       \u2714       |       \u2714       |         \u2714         |         \u2714         |               |\n| DocCompare        |               |               |               |               |                   |                   |               |\n| DocExtractor      |       \u2714       |       \u2714       |               |       \u2714       |         \u2714         |                   |               |\n| DocParser         |               |               |               |               |                   |                   |               |\n| iEncoder          |               |               |               |               |                   |                   |               |\n| HTMLParser        |               |               |               |               |                   |                   |               |\n| KeyScanner        |       \u2714       |       \u2714       |               |       \u2714       |         \u2714         |                   |               |\n| RedupRemover      |               |               |               |               |                   |                   |               |\n| SpellChecker      |               |               |               |               |                   |                   |               |\n| SplitSentence     |               |               |               |               |                   |                   |               |\n| TextSimilarity    |       \u2714       |       \u270d       |               |       \u2714       |         \u2714         |                   |               |\n| Word2vec          |               |               |               |               |                   |                   |               |\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "NLPIR-python A python wrapper and toolkit for NLPIR",
    "version": "0.9.15.1",
    "project_urls": null,
    "split_keywords": [
        "nlpir",
        "nlp",
        "chinese word segmentation",
        "ictclas",
        "cws"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4eaf2565186341275fd76eb7470205fecd49fee19e2561e29c671aa87eacdadb",
                "md5": "bf9cfca64f7a660561845600ef335a6b",
                "sha256": "ba72b4e9006f7d00583ef324a374da6a1dd1016b63f79347f7f14bdc1ab36c0f"
            },
            "downloads": -1,
            "filename": "nlpir_python-0.9.15.1-py3-none-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "bf9cfca64f7a660561845600ef335a6b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 54960142,
            "upload_time": "2023-08-16T05:29:15",
            "upload_time_iso_8601": "2023-08-16T05:29:15.850004Z",
            "url": "https://files.pythonhosted.org/packages/4e/af/2565186341275fd76eb7470205fecd49fee19e2561e29c671aa87eacdadb/nlpir_python-0.9.15.1-py3-none-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc72b4664b99c0267c9a109442029c682e7e77b1a72ffb719e68c609a56a7034",
                "md5": "505ec0c475d1f72e8c7cd3a626186497",
                "sha256": "c8313998c10315a0745f63cdbed306f61b8676f0b3fc0bfa1508366b9ae9cc8b"
            },
            "downloads": -1,
            "filename": "nlpir_python-0.9.15.1-py3-none-macosx_11_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "505ec0c475d1f72e8c7cd3a626186497",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 54960140,
            "upload_time": "2023-08-16T05:29:20",
            "upload_time_iso_8601": "2023-08-16T05:29:20.513890Z",
            "url": "https://files.pythonhosted.org/packages/dc/72/b4664b99c0267c9a109442029c682e7e77b1a72ffb719e68c609a56a7034/nlpir_python-0.9.15.1-py3-none-macosx_11_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "310eaa901fada7f6abaaba4b587bd4f268dc4484e783c26e1b0fca112afc6117",
                "md5": "4aefe69bf0b2e55d28e62e9b0989e817",
                "sha256": "694ff2b38f9a6b3a30b8dfd58e176f6fa2ede738e1898648b0a8ce49408423b7"
            },
            "downloads": -1,
            "filename": "nlpir_python-0.9.15.1-py3-none-manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "4aefe69bf0b2e55d28e62e9b0989e817",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 65643353,
            "upload_time": "2023-08-16T05:29:25",
            "upload_time_iso_8601": "2023-08-16T05:29:25.137220Z",
            "url": "https://files.pythonhosted.org/packages/31/0e/aa901fada7f6abaaba4b587bd4f268dc4484e783c26e1b0fca112afc6117/nlpir_python-0.9.15.1-py3-none-manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c65798c380647464d16fb53dae770e2265a091b8f2c685cbb3c33251c7c0f3c4",
                "md5": "5c3cd0ac2c26e58227e8ff5323e6d0c6",
                "sha256": "91126730a2f85d4aff1838d642f28cf310cf52c3cd2748178715dd059ec23223"
            },
            "downloads": -1,
            "filename": "nlpir_python-0.9.15.1-py3-none-manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "5c3cd0ac2c26e58227e8ff5323e6d0c6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 64150072,
            "upload_time": "2023-08-16T05:29:29",
            "upload_time_iso_8601": "2023-08-16T05:29:29.829642Z",
            "url": "https://files.pythonhosted.org/packages/c6/57/98c380647464d16fb53dae770e2265a091b8f2c685cbb3c33251c7c0f3c4/nlpir_python-0.9.15.1-py3-none-manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a4dec8a5e13eb854bc7bf72586e152c09a36980cc490d9ba5b607273383e952",
                "md5": "c6aacc964b243c37119d69dbf858516c",
                "sha256": "181f032426967ec37a7679876cb206a4bcd236d6537f4112e011bc9c54d23929"
            },
            "downloads": -1,
            "filename": "nlpir_python-0.9.15.1-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "c6aacc964b243c37119d69dbf858516c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 61818723,
            "upload_time": "2023-08-16T05:29:34",
            "upload_time_iso_8601": "2023-08-16T05:29:34.462914Z",
            "url": "https://files.pythonhosted.org/packages/3a/4d/ec8a5e13eb854bc7bf72586e152c09a36980cc490d9ba5b607273383e952/nlpir_python-0.9.15.1-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-16 05:29:15",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nlpir-python"
}
        
Elapsed time: 2.69395s