|
@@ -11,16 +11,18 @@ class AsyncGraphExpansion:
|
|
|
|
|
|
# ========== 共现 co-occurrence ==========
|
|
|
async def co_occurrence(
|
|
|
- self,
|
|
|
- seed_name: str,
|
|
|
- seed_label: str,
|
|
|
- other_names: Optional[List[str]] = None,
|
|
|
- limit: int = 500,
|
|
|
+ self,
|
|
|
+ seed_name: str,
|
|
|
+ seed_label: str,
|
|
|
+ other_names: Optional[List[str]] = None,
|
|
|
+ limit: int = 500,
|
|
|
) -> List[str]:
|
|
|
"""
|
|
|
找与种子要素共现的 chunk
|
|
|
"""
|
|
|
- REL_ANY = ":HAS_ENTITY|HAS_CONCEPT|HAS_TOPIC" # 非弃用:只在第一个关系类型前加冒号
|
|
|
+ REL_ANY = (
|
|
|
+ ":HAS_ENTITY|HAS_CONCEPT|HAS_TOPIC" # 非弃用:只在第一个关系类型前加冒号
|
|
|
+ )
|
|
|
|
|
|
async with self.driver.session(database=self.database) as session:
|
|
|
if not other_names:
|