fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解 自动修复统计: - 修复了1177个格式问题 - 删除了多余的空行 - 清理了行尾空格 - 移除了重复导入和未使用的导入
This commit is contained in:
@@ -15,7 +15,6 @@ import numpy as np
|
||||
KIMI_API_KEY = os.getenv("KIMI_API_KEY", "")
|
||||
KIMI_BASE_URL = os.getenv("KIMI_BASE_URL", "https://api.kimi.com/coding")
|
||||
|
||||
|
||||
@dataclass
|
||||
class EntityEmbedding:
|
||||
entity_id: str
|
||||
@@ -23,7 +22,6 @@ class EntityEmbedding:
|
||||
definition: str
|
||||
embedding: list[float]
|
||||
|
||||
|
||||
class EntityAligner:
|
||||
"""实体对齐器 - 使用 embedding 进行相似度匹配"""
|
||||
|
||||
@@ -327,10 +325,8 @@ class EntityAligner:
|
||||
|
||||
return []
|
||||
|
||||
|
||||
# 简单的字符串相似度计算(不使用 embedding)
|
||||
|
||||
|
||||
def simple_similarity(str1: str, str2: str) -> float:
|
||||
"""
|
||||
计算两个字符串的简单相似度
|
||||
@@ -361,7 +357,6 @@ def simple_similarity(str1: str, str2: str) -> float:
|
||||
|
||||
return SequenceMatcher(None, s1, s2).ratio()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 测试
|
||||
aligner = EntityAligner()
|
||||
|
||||
Reference in New Issue
Block a user