BabelPy


NameBabelPy JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/fbngrm/babelpy
SummaryBabelFy API Client
upload_time2017-12-12 12:25:04
maintainer
docs_urlNone
authorFabian Grimme
requires_python
licenseGPL
keywords nlp computational_linguistics entities wikipedia dbpedia linguistics
VCS
bugtrack_url
requirements wheel
Travis-CI No Travis.
coveralls test coverage No coveralls.
            BabelFy API Client
======================

Python `BabelFy <http://babelfy.org>`_ entity tagger. Can be used as a library or command-line tool. Compatible with
both Python 2.7 as well as Python 3.

Installation
---------------

::

    pip install babelpy

or clone this github repository and run ``python setup.py install``, optionally prepend the commands with ``sudo`` for
global installation.

Usage
-------

Add your Babelfy API Key to the config file or provide it as an argument.


Use as command-line tool
~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

    babelpy [-h] [-t  | -tf ] [-e] [-ae] [-m] [-am] [-p] [-ex]

**Options**::

    -h,  --help                 show a help message and exit
    -key --api-key              BabelFy API key
    -t   --text                 text to be annotated by BabelFy API
    -tf  --text-file            path to the file containing the input text
    -e,  --entities             get entity data
    -ae  --all-entities         get entity and non-entity data
    -m   --merged-entities      get merged entities only
    -am  --all-merged-entities  get all merged entities
    -p   --print                dump all babelfy data to stdout
    -ex  --export               filename of the output file

**Example**::

    babelpy -tf ~/data/fashion.txt -am -ex ~/data/fashion.json

See ``babelpy -h`` for help.

Use as a library
~~~~~~~~~~~~~~~~~~~~

.. code-block:: python


    from babelfy import BabelfyClient


    # Instantiate BabelFy client.
    params = dict()
    params['lang'] = LANG
    babel_client = BabelfyClient(API_KEY, params)

    # Babelfy sentence.
    babel_client.babelfy(TEXT_TO_BE_BABELFIED)

    # Get entity data.
    print(babel_client.entities)

    # Get entity and non-entity data.
    print(babel_client.all_entities)

    # Get merged entities only.
    print(babel_client.merged_entities)

    # Get all merged entities.
    babel_client.all_merged_entities

Run Tests with ``python tests/run_tests.py``

License
-----------

GNU - GPL 3.0

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fbngrm/babelpy",
    "name": "BabelPy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "nlp computational_linguistics entities wikipedia dbpedia linguistics",
    "author": "Fabian Grimme",
    "author_email": "fbngrm@googlemail.com",
    "download_url": "https://files.pythonhosted.org/packages/09/03/93430ae2c3011b9eb0ae179d58612be8e094e04e920686a1ffb7740e27ce/BabelPy-1.0.1.tar.gz",
    "platform": "",
    "description": "BabelFy API Client\n======================\n\nPython `BabelFy <http://babelfy.org>`_ entity tagger. Can be used as a library or command-line tool. Compatible with\nboth Python 2.7 as well as Python 3.\n\nInstallation\n---------------\n\n::\n\n    pip install babelpy\n\nor clone this github repository and run ``python setup.py install``, optionally prepend the commands with ``sudo`` for\nglobal installation.\n\nUsage\n-------\n\nAdd your Babelfy API Key to the config file or provide it as an argument.\n\n\nUse as command-line tool\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n    babelpy [-h] [-t  | -tf ] [-e] [-ae] [-m] [-am] [-p] [-ex]\n\n**Options**::\n\n    -h,  --help                 show a help message and exit\n    -key --api-key              BabelFy API key\n    -t   --text                 text to be annotated by BabelFy API\n    -tf  --text-file            path to the file containing the input text\n    -e,  --entities             get entity data\n    -ae  --all-entities         get entity and non-entity data\n    -m   --merged-entities      get merged entities only\n    -am  --all-merged-entities  get all merged entities\n    -p   --print                dump all babelfy data to stdout\n    -ex  --export               filename of the output file\n\n**Example**::\n\n    babelpy -tf ~/data/fashion.txt -am -ex ~/data/fashion.json\n\nSee ``babelpy -h`` for help.\n\nUse as a library\n~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n\n    from babelfy import BabelfyClient\n\n\n    # Instantiate BabelFy client.\n    params = dict()\n    params['lang'] = LANG\n    babel_client = BabelfyClient(API_KEY, params)\n\n    # Babelfy sentence.\n    babel_client.babelfy(TEXT_TO_BE_BABELFIED)\n\n    # Get entity data.\n    print(babel_client.entities)\n\n    # Get entity and non-entity data.\n    print(babel_client.all_entities)\n\n    # Get merged entities only.\n    print(babel_client.merged_entities)\n\n    # Get all merged entities.\n    babel_client.all_merged_entities\n\nRun Tests with ``python tests/run_tests.py``\n\nLicense\n-----------\n\nGNU - GPL 3.0\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "BabelFy API Client",
    "version": "1.0.1",
    "split_keywords": [
        "nlp",
        "computational_linguistics",
        "entities",
        "wikipedia",
        "dbpedia",
        "linguistics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "9f36c7d8ef68cf14c10884dcb704f041",
                "sha256": "e2a11aebfa70049f1cd4460623af33539f3841a12e2a4338a4424e45acc23e38"
            },
            "downloads": -1,
            "filename": "BabelPy-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9f36c7d8ef68cf14c10884dcb704f041",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8035,
            "upload_time": "2017-12-12T12:25:04",
            "upload_time_iso_8601": "2017-12-12T12:25:04.583029Z",
            "url": "https://files.pythonhosted.org/packages/09/03/93430ae2c3011b9eb0ae179d58612be8e094e04e920686a1ffb7740e27ce/BabelPy-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2017-12-12 12:25:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "fbngrm",
    "github_project": "babelpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "wheel",
            "specs": [
                [
                    "==",
                    "0.24.0"
                ]
            ]
        }
    ],
    "lcname": "babelpy"
}
        
Elapsed time: 0.01466s