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

SBOM & vulnerability check

Install the SBOM dependencies:

uv sync --extra sbom

Generate a CycloneDX SBOM from the current environment:

uv run cyclonedx-py environment -o sbom.cdx.json --output-format json

Audit dependencies for known vulnerabilities:

uv run pip-audit --format json --output audit-report.json

To fail on any known vulnerability (useful in CI):

uv run pip-audit --strict

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.8.52.tar.gz (9.5 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.8.52-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyannotators_entityfishing-1.8.52.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","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.8.52.tar.gz
Algorithm Hash digest
SHA256 10aa57bda299110066ea0fa4347b89894a4c273a53df79cd4fde0591b042f946
MD5 8c33f4ffe922fe1eeb1fdddb59451e90
BLAKE2b-256 e35164137d2a9c018534e2d2dd553784ded30f9d514ca34878282cf8d4a401b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyannotators_entityfishing-1.8.52-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","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.8.52-py3-none-any.whl
Algorithm Hash digest
SHA256 332acd7441defdfa2a530781f3ecb1f1061e53002ed5f257c631f427f782e5dc
MD5 14b57681168285781ed1fe2685c038a2
BLAKE2b-256 147b90a1ab4bd7d99a714b8024a06a98fb4b38ca21511beb0fa4360468c0e5dd

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