{ "info": { "author": "aohan237", "author_email": "aohan237@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development", "Topic :: Software Development :: Libraries" ], "description": "\u7b80\u5355\u7684 \u4efb\u52a1\u5f0f \u81ea\u7136\u8bed\u8a00\u7406\u89e3 \u5de5\u5177\n===============================\n\n\u8bf4\u660e\n----\n\n\u652f\u6301\u4e2d\u6587\u8bed\u53e5\u7684\u6a21\u7248\u5339\u914d\u3002\u53ef\u4ee5\u7406\u89e3\u4e3a\uff0c\u7b80\u5355\u7248\u672c\u7684\u767e\u5ea6unit\u6216\u8005\u79d1\u5927\u8baf\u98de\u7684AIUI\n\n\u5bf9\u4e8e\uff0c\u7b80\u5355\u8bed\u53e5\u7684\u81ea\u7136\u8bed\u8a00\u7406\u89e3\u4e5f\u662f\u5f88\u65b9\u4fbf\u7684\u3002\u6b22\u8fce\u5927\u5bb6\u8bd5\u7528\u3002\n\n\u5bf9\u4e8e\u4e0d\u559c\u6b22\u8c03\u7528API\uff0c\u559c\u6b22\u5728\u81ea\u5df1\u4ee3\u7801\u4e2d\u5d4c\u5165\u7684\u4eba\u662f\u86ee\u597d\u7528\u7684\u3002\n\n\u7528\u4f8b\n----\n\n::\n\n ```\n from pmnlp.word import build_sentence_word_dict\n from pmnlp.sentence import SentenceTplTrie\n\n # \u521d\u59cb\u5316\uff0c\u7528\u4e8e\u8bb0\u5f55\u7528\u6237\u914d\u7f6e\u7684\u8bcd\u69fd\uff0c\u4ee5\u53ca\u8bed\u53e5\u7684\u6a21\u7248\u5339\u914d\u3002\n user_word_dict = {'num': ['\u4e00\u676f', '\u4e24\u676f'], 'coffee': [\n '\u62ff\u94c1', '\u62ff\u94c1\u5496\u5561'], 'common': [], 'phone': ['re\\d+']}\n sentent_intent_tpl = {\n 'coffee': '[common:0-4][num][common:0-10][coffee]'\n }\n\n # \u5efa\u7acb\u6a21\u578b\n sentence_word_dict = build_sentence_word_dict(word_dict=user_word_dict)\n test_tree = SentenceTplTrie(word_dict=sentence_word_dict)\n test_tree.build(sentence_tpl_dict=sentent_intent_tpl, common_key='common')\n\n\n # \u7406\u89e3\u7528\u6237\u8f93\u5165\n _, intent, result = test_tree.sep('\u6211\u8981\u4e00\u676f\u70ed\u554a\u554a\u554a\u554a\u554a\u554a\u62ff\u94c1\u5496\u5561',common_key='common')\n if isinstance(intent, str):\n print(intent, result)\n else:\n print(intent, result)\n ```\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aohan237/pmnlp", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pmnlp", "package_url": "https://pypi.org/project/pmnlp/", "platform": "POSIX", "project_url": "https://pypi.org/project/pmnlp/", "project_urls": { "Homepage": "https://github.com/aohan237/pmnlp" }, "release_url": "https://pypi.org/project/pmnlp/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "pattern match for nlp", "version": "0.2.0" }, "last_serial": 3709443, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "122db8eddca697f81972ebd08cba09e7", "sha256": "bc3dd1c67d54eff74748dc1165f682f96085889e5a5dd05abd3df4cecfc6c400" }, "downloads": -1, "filename": "pmnlp-0.1.0.tar.gz", "has_sig": false, "md5_digest": "122db8eddca697f81972ebd08cba09e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4667, "upload_time": "2018-03-01T07:41:12", "url": "https://files.pythonhosted.org/packages/81/ae/efaebaa447e2917f1c64749daa047fb26019fd11aceea66796c6b725ad05/pmnlp-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7f3d9cb350dd3cc0ff1527ee48e011ad", "sha256": "25b7c17334ec66a866c0c7eb12f519ff40708246e072897696cd2e3f19a15c62" }, "downloads": -1, "filename": "pmnlp-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7f3d9cb350dd3cc0ff1527ee48e011ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5083, "upload_time": "2018-03-27T07:45:30", "url": "https://files.pythonhosted.org/packages/14/99/f66f014450344251e68129a3753c6fcf31b1bda8170a6550676162612bb9/pmnlp-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7f3d9cb350dd3cc0ff1527ee48e011ad", "sha256": "25b7c17334ec66a866c0c7eb12f519ff40708246e072897696cd2e3f19a15c62" }, "downloads": -1, "filename": "pmnlp-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7f3d9cb350dd3cc0ff1527ee48e011ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5083, "upload_time": "2018-03-27T07:45:30", "url": "https://files.pythonhosted.org/packages/14/99/f66f014450344251e68129a3753c6fcf31b1bda8170a6550676162612bb9/pmnlp-0.2.0.tar.gz" } ] }