{ "info": { "author": "LINHD POSTDATA Project", "author_email": "info@linhd.uned.es", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=============\nSpaCy Affixes\n=============\n\n\n.. image:: https://img.shields.io/pypi/v/spacy-affixes.svg\n :target: https://pypi.python.org/pypi/spacy-affixes\n\n.. image:: https://img.shields.io/travis/linhd-postdata/spacy-affixes.svg\n :target: https://travis-ci.org/linhd-postdata/spacy-affixes\n\n.. image:: https://readthedocs.org/projects/spacy-affixes/badge/?version=latest\n :target: https://spacy-affixes.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\nSpaCy support for affixes splitting for Freeling-like affixes rules and dictionaries.\n\n\n* Free software: Apache Software License 2.0\n* Documentation: https://spacy-affixes.readthedocs.io.\n\n\nUsage\n-----\nThis library was born to split clitics from verbs so POS tagging works out-of-the-box with spaCy models.\n\n.. code-block:: python\n\n from spacy_affixes import AffixesMatcher\n nlp = spacy.load(\"es\")\n affixes_matcher = AffixesMatcher(nlp, split_on=[\"VERB\"])\n nlp.add_pipe(affixes_matcher, name=\"affixes\", before=\"tagger\")\n for token in nlp(\"Yo mismamente podr\u00eda hac\u00e9rselo bien.\"):\n print(\n token.text,\n token.lemma_,\n token.pos_,\n token.tag_,\n token._.has_affixes,\n token._.affixes_rule,\n token._.affixes_kind,\n token._.affixes_text,\n token._.affixes_length,\n )\n\nThe output will be\n\n.. code-block:: text\n\n Hay Hay AUX AUX__Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin False None None None 0\n que que SCONJ SCONJ___ False None None None 0\n hac\u00e9r hacer VERB True suffix_selo suffix hacer 2\n se se PRON PRON__Person=3 False None None None 0\n lo el PRON PRON__Case=Acc|Gender=Masc|Number=Sing|Person=3|PronType=Prs False None None None 0\n todo todo PRON PRON__Gender=Masc|Number=Sing|PronType=Ind False prefix_todo None None 0\n , , PUNCT PUNCT__PunctType=Comm False None None None 0\n y y CONJ CCONJ___ False None None None 0\n r\u00e1pidamente r\u00e1pidamente ADV ADV___ False suffix_mente None None 0\n adem\u00e1s adem\u00e1s ADV ADV___ False prefix_a None None 0\n . . PUNCT PUNCT__PunctType=Peri False None None None 0\n\nHowever, words with suffixes could also be split if needed, or virtually any word for which a rule matches,\njust by passing a list of Universal Dependency POS's to the argument :code:`split_on`. Passing in :code:`split_on=\"*\"` would make :code:`AffixesMatcher()` try to split on everything it finds.\n\nRules and Lexicon\n-----------------\nDue to licensing issues, :code:`spacy-affixes` comes with no rules nor lexicons by default. There are two ways of getting data into :code:`spacy-affixes`:\n\n1. Create the rules and lexicon yourself with the entities you are interested on, and pass them in using :code:`AffixesMatcher(nlp, rules=, dictionary=)`. The format for these is as follows.\n\n - rules: Dictionary of rules for affixes handling. Each dict uses a key that contains the pattern to match and the value is a list of dicts with the corresponding rule parameters:\n\n - pattern: Regular expression to match, (ex. :code:`r\"ito$\"`) If a match is found, it gets removed from the token\n - kind: :code:`AFFIXES_SUFFIX` or :code:`AFFIXES_PREFIX`\n - pos_re: EAGLE regular expression to match, (ex. :code:`r\"V\"`)\n - strip_accent: Boolean indicating whether accents should be stripped in order to find the rest of the token in the lexicon\n - affix_add: List of strings to add to the rest of the token to find it in the lexicon. Each element in the list is tried separately, as in an OR condition. The character :code:`*` means add nothing (ex. :code:`[\"*\", \"io\"]`)\n - affix_text: List of Strings with the text to the rest of the token as individual tokens. For example, a rule for :code:`d\u00edgamelo` might have :code:`[\"me\", \"lo\"]` as its :code:`affix_text`\n\n - lexicon: Dictionary keyed by word with values for lemma, EAGLE code, UD POS, and UD Tags.\n\n2. Convert the Freeling data. Take into account that if you use Freeling data you are effectively agreeing to their license, which might have implications in the release if your own code. If installed, :code:`spacy-affixes` will look for the environment variables :code:`FREELINGDIR` or :code:`FREELINGSHARE` to find the affixes rules and dictionary files and will process them. If you don't have Freeling installed you can always run the :code:`download` command:\n\n.. code-block:: bash\n\n python -m spacy_affixes download \n\nWhere :code:`lang` is the 2-character ISO 639-1 code for a supported language, and :code:`version` an tagged version in their GitHub repository.\n\nNotes\n-----\n- There is not yet support for Universal Dependencies tags since a good mapping is missing.\n- Some decisions might feel idiosyncratic since the purpose of this library at the beginning was to just split clitics in Spanish texts. \n\n\n\n=======\nHistory\n=======\n\n0.1.0 (2019-04-02)\n------------------\n\n* First release on PyPI.\n\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/linhd-postdata/spacy-affixes", "keywords": "spacy_affixes", "license": "Apache Software License 2.0", "maintainer": "", "maintainer_email": "", "name": "spacy-affixes", "package_url": "https://pypi.org/project/spacy-affixes/", "platform": "", "project_url": "https://pypi.org/project/spacy-affixes/", "project_urls": { "Homepage": "https://github.com/linhd-postdata/spacy-affixes" }, "release_url": "https://pypi.org/project/spacy-affixes/0.1.3/", "requires_dist": [ "spacy (>=2.0)" ], "requires_python": "", "summary": "SpaCy support to split affixes for Freeling-like affixes rules and dictionaries", "version": "0.1.3" }, "last_serial": 5351751, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "943e702c8b419e50a3a43e59d4c6368d", "sha256": "29a59f11a616f4a4590dca6f4a277da3c79e6d9070b5c7fef8459acf2ca4414e" }, "downloads": -1, "filename": "spacy_affixes-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "943e702c8b419e50a3a43e59d4c6368d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11829, "upload_time": "2019-04-05T09:14:08", "url": "https://files.pythonhosted.org/packages/5c/0b/d15720f6c794c59c341da75ba14c09ed1bc8b4522b8f9fa8f5988d52e762/spacy_affixes-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c577b6394915915433c50198fbc642aa", "sha256": "7bd44b49291f3cc48e4f47bc957f4013cc97a39d9b06dfee7f471c40417cd3c5" }, "downloads": -1, "filename": "spacy_affixes-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c577b6394915915433c50198fbc642aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17290, "upload_time": "2019-04-05T09:14:11", "url": "https://files.pythonhosted.org/packages/ce/b1/a04093589da9186fc88a7db358254b011c4725969749d70baea1de6baacc/spacy_affixes-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "560caa726adf8b6ad7bd5ec6dce42a72", "sha256": "b01a338bc868a888b27afa6b5789eb555ad2705f07511dc942269342bd62efa7" }, "downloads": -1, "filename": "spacy_affixes-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "560caa726adf8b6ad7bd5ec6dce42a72", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13526, "upload_time": "2019-04-11T09:33:19", "url": "https://files.pythonhosted.org/packages/e3/20/0b591b8f46b50c80e62ee646ab4e3cecde0f80fa150a99e28efa61f67f46/spacy_affixes-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c475abe92b771687b57852dc2dc8cd85", "sha256": "9a7cf2c356edf5fea370853c10819808e5927ae12007cd1d99cdd07917e3bf5e" }, "downloads": -1, "filename": "spacy_affixes-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c475abe92b771687b57852dc2dc8cd85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19816, "upload_time": "2019-04-11T09:33:20", "url": "https://files.pythonhosted.org/packages/13/cf/e3e38f3a23d349849faf8aabfbdf5887fcd673e2fb2f53441b25df04f32d/spacy_affixes-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a33e3b18b5a9d77aa436caa84f043082", "sha256": "8345c155348b69d677fe1e6f24d8a5110b52239f26ddb6eb5eaba141d5c61c07" }, "downloads": -1, "filename": "spacy_affixes-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a33e3b18b5a9d77aa436caa84f043082", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16377, "upload_time": "2019-05-29T11:17:19", "url": "https://files.pythonhosted.org/packages/19/c4/d840905124c8937946151ed197389e9afbda851f8d6863daf41beee1aef7/spacy_affixes-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "889a2964bfb099e0d057f4c776561ce7", "sha256": "1805b1e458cf7db60dd658f89a0ae97dd930bc653d9db699acd52545a92e7210" }, "downloads": -1, "filename": "spacy_affixes-0.1.3.tar.gz", "has_sig": false, "md5_digest": "889a2964bfb099e0d057f4c776561ce7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23536, "upload_time": "2019-05-29T11:17:20", "url": "https://files.pythonhosted.org/packages/34/4d/3ab978729cc3ec4d47e2570aa49f18e43932b5f899de71adba3c6e065efc/spacy_affixes-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a33e3b18b5a9d77aa436caa84f043082", "sha256": "8345c155348b69d677fe1e6f24d8a5110b52239f26ddb6eb5eaba141d5c61c07" }, "downloads": -1, "filename": "spacy_affixes-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a33e3b18b5a9d77aa436caa84f043082", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16377, "upload_time": "2019-05-29T11:17:19", "url": "https://files.pythonhosted.org/packages/19/c4/d840905124c8937946151ed197389e9afbda851f8d6863daf41beee1aef7/spacy_affixes-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "889a2964bfb099e0d057f4c776561ce7", "sha256": "1805b1e458cf7db60dd658f89a0ae97dd930bc653d9db699acd52545a92e7210" }, "downloads": -1, "filename": "spacy_affixes-0.1.3.tar.gz", "has_sig": false, "md5_digest": "889a2964bfb099e0d057f4c776561ce7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23536, "upload_time": "2019-05-29T11:17:20", "url": "https://files.pythonhosted.org/packages/34/4d/3ab978729cc3ec4d47e2570aa49f18e43932b5f899de71adba3c6e065efc/spacy_affixes-0.1.3.tar.gz" } ] }