Expand description
Entity extraction service for extracting entities from text using LLM.
Provides LLM-powered entity extraction with graceful degradation when LLM is unavailable.
ยงExample
โ
use subcog::services::EntityExtractorService;
use subcog::llm::AnthropicClient;
use subcog::models::Domain;
let llm = AnthropicClient::new();
let service = EntityExtractorService::new(Box::new(llm), Domain::for_user());
let result = service.extract("Alice from Acme Corp uses Rust")?;
println!("Extracted {} entities", result.entities.len());Structsยง
- Entity
Extractor Service - Service for extracting entities from text content.
- Extracted
Entity - An entity extracted from text.
- Extracted
Relationship - A relationship extracted from text.
- Extraction
Result - Result of entity extraction from text.
- Inference
Result - Result of relationship inference between entities.
- Inferred
Relationship - A relationship inferred between existing entities.
- LlmExtraction
Response ๐ - LLM response structure for entity extraction.
- LlmInference
Response ๐ - LLM response structure for relationship inference.
Staticsยง
- TECH_
PATTERNS ๐ - Technology patterns for fallback entity extraction.
Functionsยง
- default_
confidence ๐ - parse_
entity_ ๐type - Parses entity type string to
EntityTypeenum. - parse_
relationship_ ๐type - Parses relationship type string to
RelationshipTypeenum.