{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "# TextClassify\n\n## Model\n\n* fastText char\n* fastText word\n* CNN char embedding\n* CNN word embedding\n* CNN char & word embedding\n* CNN + BiGRU + char & word embedding\n\n## Segment Model\n\n* pyltp\n* jieba\n\n## Embedding\n\n* fastText (CBOW / skip-gram)\n* gensim\n\nchar or word embedding\n\n## Usage\n\n```python\nfrom text_classify import TextClassify\n\n# default params\nt = TextClassify()\ntext = ''\nlogtis = t.predict(text, precision='16')\n\n# get index2label\nt.index2label\n\n# get top label\nt.get_top_label(text, k=5, precision='16')\n```\n\n## Parameters\n\n### `TextClassify`\n\n* model: 'fasttext' (default), 'cnn', 'mcnn', 'mgcnn'\n* cut: True, False (default)\n* cut_model: 'pyltp' (default), 'jieba'\n* pyltp_model: '/data_hdd/ltp_data/cws.model'\n* fasttext_char_model: '/data_hdd/embedding/fasttext/zhihu_char_model.bin'\n* fasttext_word_model: '/data_hdd/embedding/fasttext/zhihu_word_model.bin'\n* cnn_char_model: '/home/keming/GitHub/custom_recom/cnn_char_fulltext_best.pth'\n* cnn_word_model: '/home/keming/GitHub/custom_recom/cnn_word_fulltext_best.pth'\n* mcnn_model: '/home/keming/GitHub/custom_recom/mcnn_fulltext_best.pth'\n* mgcnn_model: '/home/keming/GitHub/custom_recom/mgcnn_fulltext_best.pth'\n* char_embedding_model: '/data_hdd/embedding/wiki_char_256.model'\n* word_embedding_model: '/data_hdd/embedding/wiki_word_256.model'\n* words_index: '/data_hdd/zhihu/topic/words.csv'\n* chars_index: '/data_hdd/zhihu/topic/chars.csv'\n* labels_index: '/data_hdd/zhihu/topic/topics.csv'\n* delete_char: '/data_hdd/zhihu/del_chars.txt'\n* num_class: 384\n* embedding_dim: 256\n* num_filter: 128\n* char_sentence_length: 256\n* word_sentence_length: 128\n* char_vocab_size: 12592\n* word_vocab_size: 727811\n* filter_size_1: [2, 3, 4, 5]\n* filter_size_2: [2, 3, 4]\n* rnn_num_unit: 128\n* rnn_num_layer: 2\n\n### `TextClassify.predict`\n\n* text\n* precision: '16' (default), '32', '64'\n\n### `TextClassify.get_top_label`\n\n* text\n* k: 5 (default), numbers of label to return\n* precision: '16' (default), '32', '64'\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "text-classify", "package_url": "https://pypi.org/project/text-classify/", "platform": "", "project_url": "https://pypi.org/project/text-classify/", "project_urls": null, "release_url": "https://pypi.org/project/text-classify/0.0.8/", "requires_dist": [ "jieba", "numpy", "plane", "pybind11", "pyltp", "scipy" ], "requires_python": "", "summary": "Simple tool to predict text classes with various models.", "version": "0.0.8" }, "last_serial": 3813731, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "88f4babfa6b90527e1c4e0cd6c0f93ac", "sha256": "72174264d7a67c109f675558bcdd3a195c5c5c3b04a555d9e20d1f2b74431d85" }, "downloads": -1, "filename": "text_classify-0.0.1.tar.gz", "has_sig": false, "md5_digest": "88f4babfa6b90527e1c4e0cd6c0f93ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4712, "upload_time": "2018-01-16T10:42:55", "url": "https://files.pythonhosted.org/packages/a3/3f/6d89fbdc29761d4cb8374a5e532cc9733209b4f7ace8d088568c5b65d389/text_classify-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "8e70152d9c0058f1fffc4897d579914f", "sha256": "6d2a1c81554ce5ba7ff683c09c2c078c00d579139375f42bfb53c5ac79575ab4" }, "downloads": -1, "filename": "text_classify-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8e70152d9c0058f1fffc4897d579914f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4637, "upload_time": "2018-01-16T10:48:28", "url": "https://files.pythonhosted.org/packages/73/db/302b3ae90fa407a769a9502620894937a2dfebe227c194cde35f3fefc90d/text_classify-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "1c0a3f3800e95f2e52767be478e7d703", "sha256": "7d0f7677e9f3edb04954e26d5c7c6c2b749a21b7fd9bbeabd56729389a46e4ec" }, "downloads": -1, "filename": "text_classify-0.0.3.tar.gz", "has_sig": false, "md5_digest": "1c0a3f3800e95f2e52767be478e7d703", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4673, "upload_time": "2018-01-18T09:19:52", "url": "https://files.pythonhosted.org/packages/49/f8/fb2b47e753dba344f071c7f4c39a56067946c2fc66876985cd18043f9076/text_classify-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "87f4ea92fa7c16595e1aed381dc3cd0e", "sha256": "a68eb346edca685a5241ec0e605bcc849ca6c56d12c9d478c58b5464d2623cf4" }, "downloads": -1, "filename": "text_classify-0.0.4.tar.gz", "has_sig": false, "md5_digest": "87f4ea92fa7c16595e1aed381dc3cd0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4729, "upload_time": "2018-01-18T09:49:42", "url": "https://files.pythonhosted.org/packages/e5/4a/6eaa866368075276f524c5b4cdc498f44c35f3c55d6703a9e8d8b782d3f8/text_classify-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "752cc92fef9c5e920839fc0b465a53b4", "sha256": "191c75cc0bb57ead5c1def7d98f723b6f8241851447824970130a07ae791570f" }, "downloads": -1, "filename": "text_classify-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "752cc92fef9c5e920839fc0b465a53b4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9076, "upload_time": "2018-04-12T08:59:38", "url": "https://files.pythonhosted.org/packages/76/49/59ee24d35079a9f844bdbd25206b4a5c17238659a7176bb7ec84b4b04099/text_classify-0.0.5-py2.py3-none-any.whl" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "65c2f2a5413249ca3410ee12b254f7a5", "sha256": "16cdf214b27e1528b5b7af5458cc024901fcfe175f134ac5529fda98a5fb4c0e" }, "downloads": -1, "filename": "text_classify-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "65c2f2a5413249ca3410ee12b254f7a5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10122, "upload_time": "2018-04-27T08:24:56", "url": "https://files.pythonhosted.org/packages/f0/a5/9b66a64172343dec8aac741854750e4e183ac3562f4d4d8d1d0fa863eaa6/text_classify-0.0.6-py2.py3-none-any.whl" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "b7330d5274ef97e6ec65dabc44e22baf", "sha256": "4df493dd82b22f56c354df16611e7178246a66c19ccf8370fc9430324c42d6ab" }, "downloads": -1, "filename": "text_classify-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b7330d5274ef97e6ec65dabc44e22baf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10117, "upload_time": "2018-04-27T08:48:15", "url": "https://files.pythonhosted.org/packages/97/24/47c943a73722edc16599b09e457c31bf7505dbd70164499e789320338382/text_classify-0.0.7-py2.py3-none-any.whl" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "832d9297cbc00384a1632c19e9fc2122", "sha256": "317d292c27e1eb1aaae0879b5aee8b0030ebb2431135b7c38773d2c883f4c767" }, "downloads": -1, "filename": "text_classify-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "832d9297cbc00384a1632c19e9fc2122", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10120, "upload_time": "2018-04-27T11:06:22", "url": "https://files.pythonhosted.org/packages/4b/14/eb2f2ce36770ef53730eb0cc1abfe8932babeeff293b067be9d5469a8ead/text_classify-0.0.8-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "832d9297cbc00384a1632c19e9fc2122", "sha256": "317d292c27e1eb1aaae0879b5aee8b0030ebb2431135b7c38773d2c883f4c767" }, "downloads": -1, "filename": "text_classify-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "832d9297cbc00384a1632c19e9fc2122", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10120, "upload_time": "2018-04-27T11:06:22", "url": "https://files.pythonhosted.org/packages/4b/14/eb2f2ce36770ef53730eb0cc1abfe8932babeeff293b067be9d5469a8ead/text_classify-0.0.8-py2.py3-none-any.whl" } ] }