Skip to main content

Annotator based on entity-fishing

Project description

pyannotators-entityfishing

Annotator based on entity-fishing for named entity recognition and disambiguation against Wikidata.

Installation

pip install pyannotators-entityfishing

For noun-form filtering (optional):

pip install pyannotators-entityfishing[spacy]
python -m spacy download en_core_web_sm  # or other language models

Usage

from pymultirole_plugins.v1.schema import Document
from pyannotators_entityfishing.entityfishing import EntityFishingAnnotator, EntityFishingParameters

annotator = EntityFishingAnnotator()
parameters = EntityFishingParameters(
    default_label="ENTITY",
    minSelectorScore=0.3,
)

docs = annotator.annotate(
    [Document(text="Albert Einstein was born in Ulm.", metadata={"language": "en"})],
    parameters,
)

for ann in docs[0].annotations:
    print(f"{ann.start}:{ann.end} {ann.labelName} {ann.terms[0].identifier}")

Development

Install test dependencies:

uv pip install -e ".[test]"

Linting

uv run ruff check src/ tests/
uv run ruff format --check src/ tests/

Testing

uv run pytest

Coverage

uv run pytest --cov=src --cov-report=term-missing

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

pyannotators_entityfishing-1.6.28.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyannotators_entityfishing-1.6.28-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file pyannotators_entityfishing-1.6.28.tar.gz.

File metadata

  • Download URL: pyannotators_entityfishing-1.6.28.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyannotators_entityfishing-1.6.28.tar.gz
Algorithm Hash digest
SHA256 a52c9b10df9188122fd8f6e6f5299d9396c717869c7d5affc8c9506985a579e7
MD5 cab0a13ff704d032945ca5f7f9abe8ab
BLAKE2b-256 5fa1658ff28523eaa7df86a734b7a06ac003fad0858c13075a0c0022541223f3

See more details on using hashes here.

File details

Details for the file pyannotators_entityfishing-1.6.28-py3-none-any.whl.

File metadata

  • Download URL: pyannotators_entityfishing-1.6.28-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pyannotators_entityfishing-1.6.28-py3-none-any.whl
Algorithm Hash digest
SHA256 aaff1afddf6da31fbe2126935fc54657f302697cb464a3d4c48433dd596a024d
MD5 3956e4807df2717971521ee42916d350
BLAKE2b-256 243878603a63384b033e41d6e1629dea5c6f58afeb0a9af9e1bb20dea98367a5

See more details on using hashes here.

Supported by

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