Skip to content
/ encite Public

Named Entity Recognition using Claude Citations

License

Notifications You must be signed in to change notification settings

vbarda/encite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
]

About

Named Entity Recognition using Claude Citations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages