{ "info": { "author": "Mitsuharu Emoto", "author_email": "mthr1982+python@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6" ], "description": "text-trans\n===\n\nIt computes a transition probability of a text.\n\n\n## Description\n\nI want to determine if a word was randomly generated. \nI guess that it can be determined by text transition probabilities trained from correct words.\n\n\n## Vertify\n\nI trained transition probability using almost english words. \nI computed and compared probability for english words learned at junior high school in Japan, and randomly generated words.\nFrom the figure below, it can see that each peak is different.\n\n![text transition prob](examples/Figure_1.png)\n\n\n## Install\n\n```shell\n$ pip install texttrans\n```\n\n\n## Usage\n\n\n### default\n\nTransition probability is computed for English words. I use \"words_alpha.txt\" of [dwyl/english-words](https://github.com/dwyl/english-words) to train default probability.\n\n```python\nfrom texttrans.texttrans import TextTrans\np = TextTrans().prob(\"pen\")\nprint(p)\n```\n\n```\n0.11640052876679541\n```\n\n### training\n\nIt prepares a text file that lists words, e.g. like below.\n\n```txt:train.txt\nhogehoge\npiyopiyo\n```\n\nIt train text transtion of input text.\n\n```python\nfrom texttrans.texttrans import TextTrans\n\ntrain_path = \"train.txt\"\nmodel_path = \"model.pki\"\n\ntt1 = TextTrans(lang=None)\ntt1.train(train_path= train_path, save_path= model_path)\nprint(\"p =\", tt.prob(\"hoge\"))\n```\n\nIt computes the probability according to trained model.\n\n```\ntt2 = TextTrans(model_path=model_path)\nprint(\"p =\", tt.prob(\"hoge\"))\n```\n\n## Licence\n\n[MIT](https://github.com/mitsuharu/text-trans/blob/master/LICENSE)\n\n\n## Appendix\n\n- [kyotolt22_20181109.pdf - Speaker Deck](https://speakerdeck.com/mitsuharu/kyotolt22-20181109)\n- [\u30e9\u30f3\u30c0\u30e0\u306a\u6587\u5b57\u5217\u3092\u5224\u5b9a\u3057\u305f\u3044 - Qiita](https://qiita.com/mitsuharu_e/items/309288b68220adddaf8b#pypi%E3%81%AB%E7%99%BB%E9%8C%B2%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E8%BF%BD%E8%A8%98-20190605)\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mitsuharu/text-trans", "keywords": "texttrans,text-trans", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "texttrans", "package_url": "https://pypi.org/project/texttrans/", "platform": "", "project_url": "https://pypi.org/project/texttrans/", "project_urls": { "Homepage": "https://github.com/mitsuharu/text-trans" }, "release_url": "https://pypi.org/project/texttrans/1.0.10/", "requires_dist": null, "requires_python": "", "summary": "To computes transition probability of text", "version": "1.0.10" }, "last_serial": 5385126, "releases": { "1.0.10": [ { "comment_text": "", "digests": { "md5": "1f9169f96683d52441a1a0319bbf2f5a", "sha256": "9ff1e7695ce09032cd13268b089455fe7fe2308875b0034e2b1fed958d3bc5eb" }, "downloads": -1, "filename": "texttrans-1.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "1f9169f96683d52441a1a0319bbf2f5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12602, "upload_time": "2019-06-11T07:37:39", "url": "https://files.pythonhosted.org/packages/17/1a/eb29a23d00196cf1ad76f029a4b221974cce941208f20017a591143fa9d6/texttrans-1.0.10-py3-none-any.whl" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "f7e9a83b67c1fe9831a6f985665d2243", "sha256": "314e5aeac47c2c5540ef82fa1bef0718fe959ee630f6028fcc4ea6275036627c" }, "downloads": -1, "filename": "texttrans-1.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "f7e9a83b67c1fe9831a6f985665d2243", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11376, "upload_time": "2019-06-05T13:48:16", "url": "https://files.pythonhosted.org/packages/68/ea/e02fd0bb4139dd2803d3c9cd96e9e3cf553566cdbf397d314690a6d072fa/texttrans-1.0.9-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f9169f96683d52441a1a0319bbf2f5a", "sha256": "9ff1e7695ce09032cd13268b089455fe7fe2308875b0034e2b1fed958d3bc5eb" }, "downloads": -1, "filename": "texttrans-1.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "1f9169f96683d52441a1a0319bbf2f5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12602, "upload_time": "2019-06-11T07:37:39", "url": "https://files.pythonhosted.org/packages/17/1a/eb29a23d00196cf1ad76f029a4b221974cce941208f20017a591143fa9d6/texttrans-1.0.10-py3-none-any.whl" } ] }