Format entire codebase with ruff and add type hints across all modules: - Apply ruff formatting to all Python files (121 files, 17K insertions) - Add type hints to function signatures throughout lightrag core and API - Update test suite with improved type annotations and docstrings - Add pyrightconfig.json for static type checking configuration - Create prompt_optimized.py and test_extraction_prompt_ab.py test files - Update ruff.toml and .gitignore for improved linting configuration - Standardize code style across examples, reproduce scripts, and utilities
29 lines
670 B
Python
29 lines
670 B
Python
"""
|
|
Entity Resolution Module for LightRAG
|
|
|
|
Provides automatic entity deduplication using a 3-layer approach:
|
|
1. Case normalization (exact match)
|
|
2. Fuzzy string matching (typos)
|
|
3. Vector similarity + LLM verification (semantic matches)
|
|
"""
|
|
|
|
from .config import DEFAULT_CONFIG, EntityResolutionConfig
|
|
from .resolver import (
|
|
ResolutionResult,
|
|
fuzzy_similarity,
|
|
get_cached_alias,
|
|
resolve_entity,
|
|
resolve_entity_with_vdb,
|
|
store_alias,
|
|
)
|
|
|
|
__all__ = [
|
|
'DEFAULT_CONFIG',
|
|
'EntityResolutionConfig',
|
|
'ResolutionResult',
|
|
'fuzzy_similarity',
|
|
'get_cached_alias',
|
|
'resolve_entity',
|
|
'resolve_entity_with_vdb',
|
|
'store_alias',
|
|
]
|