{ "info": { "author": "Arne Neumann", "author_email": "pypolibox.programming@arne.cl", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Text Processing :: Linguistic" ], "description": "pypolibox\n=========\n\n*pypolibox* is a database-to-text generation (NLG) software built\non Python 2.7, *NLTK* and Nicholas FitzGerald's *pydocplanner*.\n\nUsing a database of technical books and some user input, pypolibox\ngenerates sentences descriptions. These descriptions are then used by\nthe *OpenCCG* surface realiser to generate written sentences in German.\n\n\nInstallation\n------------\n\nPrerequisites\n~~~~~~~~~~~~~\n\nIn order to generate sentences (instead of abstract sentence\ndescriptions), you will need to install `OpenCCG`_ (tested with version\n0.9.5). Make sure that you can call ``tccg`` from the command line,\ne.g. by adding the ``openccg/bin`` directory to your ``$PATH``.\n\nUnder Linux, you'd have to add something like this to your ``.bashrc``:\n\n::\n\n export PATH=/home/username/bin/openccg/bin:$PATH\n\n export OPENCCG_HOME=/home/username/bin/openccg\n export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64\n\n\n.. _`OpenCCG`: http://openccg.sourceforge.net/\n\nUnder Windows, you'll have to `set the environment variables`_\n``OPENCCG_HOME``, ``JAVA_HOME`` and add the full path of your\n``openccg/bin`` directory to the ``PATH`` variable.\n\n.. _`set the environment variables`: http://www.voidspace.org.uk/python/articles/command_line.shtml#environment-variables\n\n`pywin32`_ also needs to be installed under Windows.\n\n.. _`pywin32`: http://sourceforge.net/projects/pywin32/\n\n\nInstall from PyPI\n~~~~~~~~~~~~~~~~~\n\n::\n\n pip install pypolibox\n\nUnder Linux, you might have to prepend that command with ``sudo`` or\nexecute it as root. Under Windows, you'll need to run this command in a\n`console with administrator rights `_.\n\n\nInstall from source\n~~~~~~~~~~~~~~~~~~~\n\nYou might also need superuser/admin rights for this (see above).\n\n::\n\n git clone https://github.com/arne-cl/pypolibox.git\n cd pypolibox\n python setup.py install\n\n\nUsage\n-----\n\nCommand line usage\n~~~~~~~~~~~~~~~~~~\n\n``pypolibox`` can be used from the command line or from within a Python\ninterpreter. To see all the available options, enter::\n\n pypolibox -h\n\nTo find books that are written in German and use the\nprogramming language Prolog, type::\n\n pypolibox --language German --proglang Prolog\n\nor, if you prefer short but cryptic commands::\n\n pypolibox -l German -p Prolog\n\nYou can choose between several output formats using the ``-o`` or\n``--output-format`` argument.\n\n* ``openccg`` generates sentences using OpenCCG (default option)\n* ``textplan-xml`` generates an XML representation of the textplans\n* ``textplan-featstruct`` generates a feature structure representation (``nltk.featstruct``)\n* ``hlds`` generates an HLDS XML representations of all the sentences.\n\nThe following example query will generate HLDS XML snippets describing books\nabout Prolog written in German::\n\n pypolibox --language German --proglang Prolog --output-format hlds\n\nFurther usage examples can be found in the ``pypolibox.database.Query``\nclass documentation. \n\nLibrary usage\n~~~~~~~~~~~~~\n\nIf you'd like to access ``pypolibox`` from\nwithin a Python interpreter, you can simply use the same arguments.\nInstead of a string like *-l German -p Prolog*, you will have to\nprovide your arguments as a list of strings::\n\n Query([\"-l\", \"German\", \"-p\", \"Prolog\"])\n\nThis query would be equivalent to the command line queries above.\n``pypolibox`` is built as a pipeline, where each important step is\nrepresented by a class. Each of these classes function as the input\nof the next class in the pipeline, e.g.::\n\n query = Query([\"-l\", \"German\", \"-p\", \"Prolog\"])\n Results(query)\n Books(Results(query))\n ...\n TextPlans(AllMessages(AllPropositions(AllFacts(Books(Results(query))))))\n\nIf you instanciate a Query with your query arguments, you can use\nthis ``Query`` instance as the input of a ``Results`` instance\n(which contains the data that the database provided for your query),\nwhich in turn can be used as the input of a ``Books`` instance etc.\n\nOf course, you wouldn't want to chain all those classes just to retrieve\ntextplans. To do so, simply use one of the functions provided in the\n``debug`` module, either by running the ``debug.py`` file in\nthe interpreter or by importing it::\n\n import debug\n debug.gen_textplans([\"-l\", \"German\", \"-p\", \"Prolog\"])\n\nThis function call would return the same results as the aforementioned\ncommand line calls. For further testing, try\n``debug.testqueries`` and ``debug.error_testqueries``, which\nbasically are lists of predefined valid and invalid query arguments and which\ncan be used to query the database (and see how errors are handled).\n\n\nDocumentation\n-------------\n\nThe documentation is available `online `_,\nbut you can always get an up-to-date local copy using `Sphinx`_.\n\nYou can generate an HTML or PDF version by running these commands in\npypolibox's ``docs`` directory::\n\n make latexpdf\n\nto produce a PDF (``docs/_build/latex/pypolibox.pdf``) and ::\n\n make html\n\nto produce a set of HTML files (``docs/_build/html/index.html``).\n\n.. _`Sphinx`: http://sphinx-doc.org/\n\n\nPackage Overview\n----------------\n\nThe pypolibox package contains the following modules:\n\n- The ``pypolibox`` module is the main module, which is invoked from the\n command line.\n- The ``database`` module handles the user input, queries the database and\n returns the results.\n- ``facts`` converts those results into attribute value matrices.\n- The ``propositions`` module evaluates those facts (positive, negative,\n neutral).\n- The ``textplan`` module takes those propositions and turns them into\n messages. In contrast to propositions, messages do not contain duplicates\n and add comparative information. Rules will be used to combine those\n message into constituent sets and ultimately into one text plan. The\n ``textplan`` module also allows exporting those text plans in XML format.\n- The ``rules`` module contains the rules used by be the ``textplan`` module\n to combine messages into constituent sets and textplans, respectively.\n- The ``messages`` module generates messages from propositions, which will\n be used by the ``textplan`` module.\n\n\n- The ``lexicalize_messageblocks`` is the \"main\" module of the\n lexicalization. For each message block in a textplan, it generates one or\n more possible lexicalizations which are then realized by the\n ``realization`` module.\n- The ``lexicalization`` module generates lexicalizations (in HLDS-XML\n format) for each message, which are used by the\n ``lexicalize_messageblocks`` module to form lexicalizations of complete\n message blocks.\n- **A note on terminology**: A message block in ``pypolibox`` is basically an\n instance of the ``Message`` class, e.g an \"id\" message block. This\n \"id\" message block in turn consists of several messages, e.g. an\n \"authors\" message and a \"title\" message.\n- The ``realization`` module takes a lexicalized phrase or sentence (in\n HLDS-XML format) and converts it into a surface realization (with the\n help of OpenCCGs ``tccg`` executable).\n- The ``hlds`` module allows to convert textplans from a\n ``nltk.featstruct``-based format to HLDS-XML and vice versa. In addition, the\n module can produce attribute-value matrices of these textplans as\n LaTeX/PDF files.\n\n\nLicence\n-------\n\nThe code is licensed under GPL Version 3. The grammar fragment is licensed\nunder `Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License `_.\n\nAuthor\n------\n\nArne Neumann\n\n\nAcknowledgements\n----------------\n\nThis software reimplements parts of the Java-based *JPolibox*\ntext-generation software written by Alexandra Strelakova, Felix Dombek,\nMathias Langer and Till Kolter. pypolibox also includes a heavily\nmodified version of Nicholas FitzGerald's *pydocplanner*, which he\nreleased under a Creative Commons license (not specified further).\nThe German OpenCCG grammar fragment that comes with pypolibox was written by\nMartin Oltmann.\n\n\n.. This is your project NEWS file which will contain the release notes.\n.. Example: http://www.python.org/download/releases/2.6/NEWS.txt\n.. The content of this file, along with README.rst, will appear in your\n.. project's PyPI page.\n\nNews\n====\n\n1.0.2 (2014-05-17)\n\n*Release data: 17-May-2014*\n\n* added Windows-specific requirements to setup.py (``winpexpect`` vs. ``pexpect``)\n* README now covers installation prerequisites\n\n\n1.0.1 (2014-05-13)\n------------------\n\n*Release date: 13-May-2014*\n\n* installation via ``pip`` or ``python setup.py install`` now adds two programs\n to your path: ``pypolibox`` and ``hlds-converter``\n* added new output formats (``--output-format`` parameter):\n textplan featstructs, HLDS XML\n* documentation is now hosted at `readthedocs.org `_\n* converted documentation from epydoc to sphinx\n* added make file, license file\n\n\n1.0.0 (2014-30-04)\n------------------\n\n*Release date: 30-Apr-2014*\n\n* pypolibox is now licensed under GPLv3\n* OpenCCG grammar fragment (CC-BY-NC-SA 4.0 licensed) now shipped with code\n* first release via PyPI\n* got rid of configuration file\n* fixed some errors in the documentation", "description_content_type": null, "docs_url": "https://pythonhosted.org/pypolibox/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/arne-cl/pypolibox", "keywords": "linguistics nlp nlg", "license": "GPL Version 3", "maintainer": null, "maintainer_email": null, "name": "pypolibox", "package_url": "https://pypi.org/project/pypolibox/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pypolibox/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/arne-cl/pypolibox" }, "release_url": "https://pypi.org/project/pypolibox/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "text generation for product recommendations using OpenCCG", "version": "1.0.2" }, "last_serial": 1095774, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a642b180cc0f3301d1ac9a8813f7fa29", "sha256": "0a672077c840907c03ec0ca76dce2e3f15d2e60574fffbafb782adaf1dda143f" }, "downloads": -1, "filename": "pypolibox-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a642b180cc0f3301d1ac9a8813f7fa29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225411, "upload_time": "2014-04-30T14:50:28", "url": "https://files.pythonhosted.org/packages/a8/49/83147847501f0e7cdc5506fd838eead01c2b752e3177e50fab2f2195fca3/pypolibox-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "928cfbb6da6ec6db895a272655d6590e", "sha256": "bec4bdf863b46d3a24b7c238acd460e825ecb301293e839efa501f0b416c3f2c" }, "downloads": -1, "filename": "pypolibox-1.0.1.tar.gz", "has_sig": false, "md5_digest": "928cfbb6da6ec6db895a272655d6590e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 226569, "upload_time": "2014-05-13T11:10:31", "url": "https://files.pythonhosted.org/packages/9c/40/0dcf8ebadebd0be8f52ee25cba0b738fd8627828b7a4792d34adf88c169e/pypolibox-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "b254f297c5305c41f34e3d7e2c215ce6", "sha256": "f3830327c2a5bf20cf6794dc2c0a0f4ac1516aee56ce44dbdc19a2181361495a" }, "downloads": -1, "filename": "pypolibox-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b254f297c5305c41f34e3d7e2c215ce6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 224628, "upload_time": "2014-05-17T21:06:27", "url": "https://files.pythonhosted.org/packages/b2/e3/2fb162d15a1bc36d54e34e8588e27e3ac4e66e4f85d0c7d04d4c939f6ee8/pypolibox-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b254f297c5305c41f34e3d7e2c215ce6", "sha256": "f3830327c2a5bf20cf6794dc2c0a0f4ac1516aee56ce44dbdc19a2181361495a" }, "downloads": -1, "filename": "pypolibox-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b254f297c5305c41f34e3d7e2c215ce6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 224628, "upload_time": "2014-05-17T21:06:27", "url": "https://files.pythonhosted.org/packages/b2/e3/2fb162d15a1bc36d54e34e8588e27e3ac4e66e4f85d0c7d04d4c939f6ee8/pypolibox-1.0.2.tar.gz" } ] }