Skip to main content

A minimal client for entity-fishing service.

Project description

http://img.shields.io/:license-apache-blue.svg https://travis-ci.org/hirmeos/entity-fishing-client-python.svg?branch=master

Python client to query the Entity Fishing service API developed in the context of the EU H2020 HIRMEOS project (WP3). For more information about entity-fishing, please check the Entity Fishing Documentation.

Installation

The client can be installed using pip:

pip install entity-fishing-client

Usage

from nerd import nerd
client = nerd.NerdClient()

client.disambiguateText(
    "Linux is a name that broadly denotes a family of free and open-source software operating systems (OS) built around the Linux kernel."
)

With the following example response:

 (
     {u'entities': [
         {
             u'domains': [u'Computer_Science'],
             u'nerd_score': 0.3753,
             u'nerd_selection_score': 0.7268,
             u'offsetEnd': 5,
             u'offsetStart': 0,
             u'rawName': u'Linux',
             u'type': u'PERSON',
             u'wikidataId': u'Q388',
             u'wikipediaExternalRef': 6097297
         },
         {
             u'domains': [u'Computer_Science'],
             u'nerd_score': 0.7442,
             u'nerd_selection_score': 0.85,
             u'offsetEnd': 78,
             u'offsetStart': 49,
             u'rawName': u'free and open-source software',
             u'wikidataId': u'Q506883',
             u'wikipediaExternalRef': 1721496
         },
         {
             u'domains': [u'Electrotechnology', u'Electronics',
             u'Computer_Science'],
             u'nerd_score': 0.7442,
             u'nerd_selection_score': 0.4487,
             u'offsetEnd': 96,
             u'offsetStart': 79,
             u'rawName': u'operating systems',
             u'wikidataId': u'Q9135',
             u'wikipediaExternalRef': 22194
         },
         {
             u'domains': [
                 u'Electrotechnology', u'Electronics', u'Computer_Science'
             ],
             u'nerd_score': 0.7442,
             u'nerd_selection_score': 0.4487,
             u'offsetEnd': 100,
             u'offsetStart': 98,
             u'rawName': u'operating systems',
             u'wikidataId': u'Q9135',
             u'wikipediaExternalRef': 22194
         },
         {
             u'domains': [u'Electronics', u'Computer_Science'],
             u'nerd_score': 0.743,
             u'nerd_selection_score': 0.8383,
             u'offsetEnd': 131,
             u'offsetStart': 119,
             u'rawName': u'Linux kernel',
             u'wikidataId': u'Q14579',
             u'wikipediaExternalRef': 21347315
         }
     ],
     u'global_categories': [
         {u'category': u'Finnish inventions',
         u'page_id': 27421536,
         u'source': u'wikipedia-en',
         u'weight': 0.09684039970133569},
        {u'category': u'Free software programmed in C',
         u'page_id': 11241711,
         u'source': u'wikipedia-en',
         u'weight': 0.06433942787438053},
        {u'category': u'Unix variants',
         u'page_id': 10429397,
         u'source': u'wikipedia-en',
         u'weight': 0.09684039970133569},
        {u'category': u'Operating systems',
         u'page_id': 693664,
         u'source': u'wikipedia-en',
         u'weight': 0.12888888710813473},
        {u'category': u'Free software',
         u'page_id': 693287,
         u'source': u'wikipedia-en',
         u'weight': 0.06444444355406737},
        {u'category': u'Free system software',
         u'page_id': 6721544,
         u'source': u'wikipedia-en',
         u'weight': 0.06433942787438053},
        {u'category': u'Software licenses',
         u'page_id': 703100,
         u'source': u'wikipedia-en',
         u'weight': 0.06444444355406737},
        {u'category': u'Linux kernel',
         u'page_id': 13215678,
         u'source': u'wikipedia-en',
         u'weight': 0.06433942787438053},
        {u'category': u'Monolithic kernels',
         u'page_id': 10730969,
         u'source': u'wikipedia-en',
         u'weight': 0.06433942787438053},
        {u'category': u'1991 software',
         u'page_id': 11167446,
         u'source': u'wikipedia-en',
         u'weight': 0.09684039970133569},
        {u'category': u'Linus Torvalds',
         u'page_id': 53479567,
         u'source': u'wikipedia-en',
         u'weight': 0.09684039970133569}
     ],
     u'language': {u'conf': 0.9999973266294648, u'lang': u'en'},
     u'nbest': False,
     u'onlyNER': False,
     u'runtime': 107,
     u'sentences': [{u'offsetEnd': 132, u'offsetStart': 0}],
     u'text': u'Linux is a name that broadly denotes a family of free and open-source software operating systems (OS) built around the Linux kernel.'
     },
     200
)

Todo

The following methods are missing from this client:

  • termDisambiguation

  • queryDisambiguation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

entity-fishing-client-0.5.1.tar.gz (7.4 kB view details)

Uploaded Source

File details

Details for the file entity-fishing-client-0.5.1.tar.gz.

File metadata

  • Download URL: entity-fishing-client-0.5.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for entity-fishing-client-0.5.1.tar.gz
Algorithm Hash digest
SHA256 4a16b2ea6f98a49e4233647c8e155197e0c6d0c8068d672fe9357d6ebd53126e
MD5 6186c988707aa7055f9d640d0a2feec8
BLAKE2b-256 19c300b4cfcdc5ef6e7450ec3543cfe23d866ff7f677728f951324a4f83bc9af

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page