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.0.tar.gz (4.5 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.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for encite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a9d35678079a4c0199f7441a34cdd3b6812de7f85ea3887980856a1a20de91bf
MD5 1cc0f3ac84c9938bf756e6302b1aee3f
BLAKE2b-256 c69ad2cb18f13f5904bd10f27d34f6e9bec104a7e56df0013d76a9778d53d10c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for encite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 040c6d6a7ab11251db433058998e837622d1787644347fa3d841a76538d601f6
MD5 ac45f57815915938d70975250d412011
BLAKE2b-256 cab6d4e4392087c746be89ccfbc6784a84116efa10e3c9b98062a0e2453de733

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