Skip to main content

Named Entity Recognition using Claude Citations

Project description

Encite

Encite is an experimental Python library for named entity recognition (NER) using Anthropic Claude models with citations feature.

Features

  • 🎯 Accurate entity recognition using Anthropic Claude's citations feature
  • ⚙️ Customizable entity types (person, company, location, etc.)
  • 📍 Returns entity character locations in the original text

Installation

pip install encite

Usage

[!TIP] Claude 3.7 Sonnet is recommended for best results.

Here's a simple example of how to use Encite:

export ANTHROPIC_API_KEY=your-api-key
from encite import find_entities
from langchain_anthropic import ChatAnthropic

# Initialize the Claude model
model = ChatAnthropic(model="claude-3-7-sonnet-latest")

# Example text
text = "John Smith works at Apple Inc. in California."

# Extract entities
entities = find_entities(model, text, entity_types=["person", "company"])

# Print results
print(entities)

Expected output:

[
    Entity(entity_type="person", name="John Smith", start_char_index=0, end_char_index=10),
    Entity(entity_type="company", name="Apple Inc", start_char_index=20, end_char_index=29)
]

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

encite-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

encite-0.1.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file encite-0.1.1.tar.gz.

File metadata

  • Download URL: encite-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.13

File hashes

Hashes for encite-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d0a0428b2cbd4e761e9e168102f7a05284163c8bba304c63cf761ff4534eda16
MD5 de6b76b37328119c3eebbc858120ee5e
BLAKE2b-256 4a43ff2ed9e7ac491c7e9e2d99a53bfc2adf3d809b1346b52e59b1f0b3280d2c

See more details on using hashes here.

File details

Details for the file encite-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: encite-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.13

File hashes

Hashes for encite-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bf06e2bfccfaf13caa5dfa637143382d01177bc3de93ec98dd38842a1be084a
MD5 8fb67ecbc6c7c16d3676616931364903
BLAKE2b-256 b2ea28c84931c25f0f04c6c96565d6fb79582f84dedecdb0d3e012367a0f096c

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