{ "info": { "author": "Fako Berkers", "author_email": "email@fakoberkers.nl", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# SpaCy Arguing Lexicon\n\nA [spaCy](https://spacy.io/) extension that wraps around the [arguing lexicon by MPQA](http://mpqa.cs.pitt.edu/lexicons/arg_lexicon/). \nIt allows easy programmatic access to labeled sentences containing arguing lexicon. Using spaCy you can then apply the latest machine learning technologies with little effort. \n\nUse the arguing lexicon extension for instance for deep argument mining. It is available in English and Dutch. \n\n## Getting started\n\nYou can install the spaCy extension through pip. It requires spaCy 2.\n\n```bash\npip install spacy_arguing_lexicon\npython -m spacy download en # optional, downloads a spaCy language model if you haven't downloaded one already\n```\n\nThen enable the extension by adding the arguing lexicon parser to the spaCy pipeline.\n\n```python\nimport spacy\nfrom spacy_arguing_lexicon import ArguingLexiconParser\n\nnlp = spacy.load(\"en\")\nnlp.add_pipe(ArguingLexiconParser(lang=nlp.lang))\n```\n\nNow you can load any document and access the parts of that document which contain arguments. \nYou access the arguments through the ```doc._.arguments``` attribute, which gets added by this extension.\n\n```python\ndoc = nlp(\"\"\"\n A changing society should not cling to traditional family models. \n Society is changing, and the traditional idea of the nuclear family \n with married mother and father \n is no longer the only acceptable alternative.\n\"\"\")\n\nargument_span = next(doc._.arguments.get_argument_spans())\nprint(\"Argument lexicon:\", argument_span.text)\nprint(\"Label of lexicon:\", argument_span.label_)\nprint(\"Sentence where lexicon occurs:\", argument_span.sent.text.strip())\n```\n\nThe above will output\n\n```\nArgument lexicon: should\nLabel of lexicon: necessity\nSentence where lexicon occurs: A changing society should not cling to traditional family models.\n```\n\nAs ```get_argument_spans``` yields [spaCy Spans](https://spacy.io/api/span) \nit is trivial to retrieve things like average word embeddings for sentences that contain arguing lexicon.\nThese average embeddings can serve as input for your deep learning models.\n\n\nYou can for example access the built-in spaCy vectors for a sentence containing argument lexicon with\n\n```python\nprint(\"Vector type:\", type(argument_span.sent.vector))\nprint(\"Vector shape:\", argument_span.sent.vector.shape)\n``` \n\nWhich will output\n\n```\nVector type: \nVector shape: (384,)\n```\n\n\n## How it works\n\nThe MPQA arguing lexicon is made available under the GNU General Public License.\nIt is a set of about 200 regular expressions with macros divided into 17 categories.\nFor more information about how the lexicon was created we refer to the [arguing lexicon homepage](http://mpqa.cs.pitt.edu/lexicons/arg_lexicon/).\n\nThe Dutch arguing lexicon is a translation of the English lexicon and is available only through this extension.\n\nUnder the hood this extension parses the regular expressions and unpacks any macros inside of them. \nThe ```doc._.arguments.get_argument_spans``` method tries to match any lexicon regular expression against the text of the input [spaCy Doc](https://spacy.io/api/doc).\nWhen a match is found the match gets transformed into a [spaCy Span](https://spacy.io/api/span) before it gets yielded.\n\n```doc._.arguments.get_argument_spans``` is the only recommended way of using this extension at the moment.\n\nAs the MPQA arguing lexicon is made available as a list of regular expressions we side stepped the [spaCy Matcher](https://spacy.io/api/matcher), \nbut we think that loading the lexicon as a set of matchers might improve the performance.\n\n\n## Citation\n\nPlease cite the following when using this software:\n\n```\nSwapna Somasundaran, Josef Ruppenhofer and Janyce Wiebe (2007) Detecting Arguing and Sentiment in Meetings, \nSIGdial Workshop on Discourse and Dialogue, Antwerp, Belgium, September 2007 (SIGdial Workshop 2007)\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/fako/spacy_arguing_lexicon", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "spacy-arguing-lexicon", "package_url": "https://pypi.org/project/spacy-arguing-lexicon/", "platform": "", "project_url": "https://pypi.org/project/spacy-arguing-lexicon/", "project_urls": { "Homepage": "https://github.com/fako/spacy_arguing_lexicon" }, "release_url": "https://pypi.org/project/spacy-arguing-lexicon/0.0.3/", "requires_dist": [ "spacy (>=2)" ], "requires_python": "~=3.4", "summary": "A spaCy extension wrapping around the arguing lexicon by MPQA", "version": "0.0.3" }, "last_serial": 4530142, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "e175cfc517448b6331c50265b51fc093", "sha256": "82bc2f2acc4de0cab451a1c233aa39c979cfac9cebabde5628172757a1e5b5b6" }, "downloads": -1, "filename": "spacy_arguing_lexicon-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e175cfc517448b6331c50265b51fc093", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.4", "size": 5554, "upload_time": "2018-06-17T14:00:09", "url": "https://files.pythonhosted.org/packages/72/d8/eefed8a0f98281cc8c98e9d26c67efb6b5fbd35032e13f2c87f9de7479a2/spacy_arguing_lexicon-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dd28e773da33e5116480416e11161d56", "sha256": "aab1533ee779a1e4e6ca9fd59fdbf2c6bcf8cbe3ae07488b82bdfe8589981ead" }, "downloads": -1, "filename": "spacy_arguing_lexicon-0.0.1.tar.gz", "has_sig": false, "md5_digest": "dd28e773da33e5116480416e11161d56", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.4", "size": 4709, "upload_time": "2018-06-17T14:00:11", "url": "https://files.pythonhosted.org/packages/7d/fa/6b3996a46696bd3ac6be0622893a8b4ff0cb6631e3f55514210b7e70aef1/spacy_arguing_lexicon-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "a54ce6b069989f754b2dc831233c5882", "sha256": "275a6cb0699beab0e94872ada9b463a02fb1df70999a22aea2f0bab8f6b04802" }, "downloads": -1, "filename": "spacy_arguing_lexicon-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a54ce6b069989f754b2dc831233c5882", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.4", "size": 25591, "upload_time": "2018-06-17T15:00:49", "url": "https://files.pythonhosted.org/packages/04/27/0ca98a5ab5ffcb9a2f4a5162588cfd5a9d273c54c665ceee5e38b532bc9f/spacy_arguing_lexicon-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1f3ba9fd531f1548431cc1e9d60c7edb", "sha256": "99cae17fd029e6588954626d5e5fd7fa13830a05a40fce8eadbe042da10eca98" }, "downloads": -1, "filename": "spacy_arguing_lexicon-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1f3ba9fd531f1548431cc1e9d60c7edb", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.4", "size": 14261, "upload_time": "2018-06-17T15:00:52", "url": "https://files.pythonhosted.org/packages/b4/e0/30b4c56e1d453f7c19cb8691fd2d8f2ac554b9f61685c829467e4fe4723d/spacy_arguing_lexicon-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "fc07abd4685ab8685849d06e52d1a986", "sha256": "fa80b266421f74c523075280ad57d0775292c51be5f59e1f7609af9380ba92e8" }, "downloads": -1, "filename": "spacy_arguing_lexicon-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "fc07abd4685ab8685849d06e52d1a986", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.4", "size": 25865, "upload_time": "2018-11-26T15:56:25", "url": "https://files.pythonhosted.org/packages/88/a4/49f3ab0b36952cc2e58544ef47c26bb293f9160c42593208d811aeaefbb7/spacy_arguing_lexicon-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "23a2501b016439d348caa18622e45443", "sha256": "87530104ee438136ceef0a33362ee2c38c4f761dc916abe45b51f5f362be4cba" }, "downloads": -1, "filename": "spacy_arguing_lexicon-0.0.3.tar.gz", "has_sig": false, "md5_digest": "23a2501b016439d348caa18622e45443", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.4", "size": 14484, "upload_time": "2018-11-26T15:56:27", "url": "https://files.pythonhosted.org/packages/1e/02/4c1ea675e74018ac2bf7a5c3d7a01c773d28f4a2e68b8a76306536c7b510/spacy_arguing_lexicon-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fc07abd4685ab8685849d06e52d1a986", "sha256": "fa80b266421f74c523075280ad57d0775292c51be5f59e1f7609af9380ba92e8" }, "downloads": -1, "filename": "spacy_arguing_lexicon-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "fc07abd4685ab8685849d06e52d1a986", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.4", "size": 25865, "upload_time": "2018-11-26T15:56:25", "url": "https://files.pythonhosted.org/packages/88/a4/49f3ab0b36952cc2e58544ef47c26bb293f9160c42593208d811aeaefbb7/spacy_arguing_lexicon-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "23a2501b016439d348caa18622e45443", "sha256": "87530104ee438136ceef0a33362ee2c38c4f761dc916abe45b51f5f362be4cba" }, "downloads": -1, "filename": "spacy_arguing_lexicon-0.0.3.tar.gz", "has_sig": false, "md5_digest": "23a2501b016439d348caa18622e45443", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.4", "size": 14484, "upload_time": "2018-11-26T15:56:27", "url": "https://files.pythonhosted.org/packages/1e/02/4c1ea675e74018ac2bf7a5c3d7a01c773d28f4a2e68b8a76306536c7b510/spacy_arguing_lexicon-0.0.3.tar.gz" } ] }