Merge branch 'main' of git.kaiyuancloud.cn:yumoqing/llmengine
This commit is contained in:
commit
b7f7541734
29
llmengine/base_connection.py
Normal file
29
llmengine/base_connection.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
from abc import ABC, abstractmethod
|
||||||
|
from typing import Dict
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
connection_pathMap = {}
|
||||||
|
|
||||||
|
def connection_register(connection_key, Klass):
|
||||||
|
"""为给定的连接键注册一个连接类"""
|
||||||
|
global connection_pathMap
|
||||||
|
connection_pathMap[connection_key] = Klass
|
||||||
|
logger.info(f"Registered {connection_key} with class {Klass}")
|
||||||
|
|
||||||
|
def get_connection_class(connection_path):
|
||||||
|
"""根据连接路径查找对应的连接类"""
|
||||||
|
global connection_pathMap
|
||||||
|
logger.debug(f"connection_pathMap: {connection_pathMap}")
|
||||||
|
klass = connection_pathMap.get(connection_path)
|
||||||
|
if klass is None:
|
||||||
|
logger.error(f"{connection_path} has not mapping to a connection class")
|
||||||
|
raise Exception(f"{connection_path} has not mapping to a connection class")
|
||||||
|
return klass
|
||||||
|
|
||||||
|
class BaseConnection(ABC):
|
||||||
|
@abstractmethod
|
||||||
|
async def handle_connection(self, action: str, params: Dict = None) -> Dict:
|
||||||
|
"""处理数据库操作,根据 action 执行创建集合等"""
|
||||||
|
pass
|
431
llmengine/connection.py
Normal file
431
llmengine/connection.py
Normal file
@ -0,0 +1,431 @@
|
|||||||
|
import milvus_connection
|
||||||
|
from traceback import format_exc
|
||||||
|
import argparse
|
||||||
|
import logging
|
||||||
|
from aiohttp import web
|
||||||
|
from llmengine.base_connection import get_connection_class
|
||||||
|
from appPublic.registerfunction import RegisterFunction
|
||||||
|
from appPublic.log import debug, exception
|
||||||
|
from ahserver.serverenv import ServerEnv
|
||||||
|
from ahserver.webapp import webserver
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
helptext = """Milvus Connection Service API (using pymilvus Collection API):
|
||||||
|
|
||||||
|
1. Create Collection Endpoint:
|
||||||
|
path: /v1/createcollection
|
||||||
|
method: POST
|
||||||
|
headers: {"Content-Type": "application/json"}
|
||||||
|
data: {
|
||||||
|
"db_type": "textdb"
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
- Success: HTTP 200, {"status": "success", "collection_name": "ragdb_textdb", "message": "集合 ragdb_textdb 创建成功"}
|
||||||
|
- Error: HTTP 400, {"status": "error", "collection_name": "ragdb_textdb", "message": "<error message>"}
|
||||||
|
|
||||||
|
2. Delete Collection Endpoint:
|
||||||
|
path: /v1/deletecollection
|
||||||
|
method: POST
|
||||||
|
headers: {"Content-Type": "application/json"}
|
||||||
|
data: {
|
||||||
|
"db_type": "textdb"
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
- Success: HTTP 200, {"status": "success", "collection_name": "ragdb_textdb", "message": "集合 ragdb_textdb 删除成功"}
|
||||||
|
- Error: HTTP 400, {"status": "error", "collection_name": "ragdb_textdb", "message": "<error message>"}
|
||||||
|
|
||||||
|
3. Insert File Endpoint:
|
||||||
|
path: /v1/insertfile
|
||||||
|
method: POST
|
||||||
|
headers: {"Content-Type": "application/json"}
|
||||||
|
data: {
|
||||||
|
"file_path": "/path/to/file.txt",
|
||||||
|
"userid": "user1",
|
||||||
|
"db_type": "textdb"
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
- Success: HTTP 200, {"status": "success", "document_id": "<uuid>", "collection_name": "ragdb_textdb", "message": "文件 /path/to/file.txt 成功嵌入并处理三元组"}
|
||||||
|
- Error: HTTP 400, {"status": "error", "document_id": "<uuid>", "collection_name": "ragdb_textdb", "message": "<error message>"}
|
||||||
|
|
||||||
|
4. Delete File Endpoint:
|
||||||
|
path: /v1/deletefile
|
||||||
|
method: POST
|
||||||
|
headers: {"Content-Type": "application/json"}
|
||||||
|
data: {
|
||||||
|
"db_type": "textdb",
|
||||||
|
"userid": "user1",
|
||||||
|
"filename": "test.txt"
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
- Success: HTTP 200, {"status": "success", "collection_name": "ragdb_textdb", "message": "成功删除 X 条记录,userid=user1, filename=test.txt"}
|
||||||
|
- Error: HTTP 400, {"status": "error", "collection_name": "ragdb_textdb", "message": "<error message>"}
|
||||||
|
|
||||||
|
5. Fused Search Query Endpoint:
|
||||||
|
path: /v1/fusedsearchquery
|
||||||
|
method: POST
|
||||||
|
headers: {"Content-Type": "application/json"}
|
||||||
|
data: {
|
||||||
|
"query": "苹果公司在北京开设新店",
|
||||||
|
"userid": "user1",
|
||||||
|
"db_type": "textdb",
|
||||||
|
"file_paths": ["/path/to/file.txt"],
|
||||||
|
"limit": 5,
|
||||||
|
"offset": 0,
|
||||||
|
"use_rerank": true
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
- Success: HTTP 200, [
|
||||||
|
{
|
||||||
|
"text": "<完整文本内容>",
|
||||||
|
"distance": 0.95,
|
||||||
|
"source": "fused_query_with_triplets",
|
||||||
|
"rerank_score": 0.92, // 若 use_rerank=true
|
||||||
|
"metadata": {
|
||||||
|
"userid": "user1",
|
||||||
|
"document_id": "<uuid>",
|
||||||
|
"filename": "test.txt",
|
||||||
|
"file_path": "/path/to/file.txt",
|
||||||
|
"upload_time": "2025-06-27T15:58:00",
|
||||||
|
"file_type": "txt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
...
|
||||||
|
]
|
||||||
|
- Error: HTTP 400, {"status": "error", "message": "<error message>"}
|
||||||
|
|
||||||
|
6. Search Query Endpoint:
|
||||||
|
path: /v1/searchquery
|
||||||
|
method: POST
|
||||||
|
headers: {"Content-Type": "application/json"}
|
||||||
|
data: {
|
||||||
|
"query": "知识图谱的知识融合是什么?",
|
||||||
|
"userid": "user1",
|
||||||
|
"db_type": "textdb",
|
||||||
|
"file_paths": ["/path/to/file.txt"],
|
||||||
|
"limit": 5,
|
||||||
|
"offset": 0,
|
||||||
|
"use_rerank": true
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
- Success: HTTP 200, [
|
||||||
|
{
|
||||||
|
"text": "<完整文本内容>",
|
||||||
|
"distance": 0.95,
|
||||||
|
"source": "vector_query",
|
||||||
|
"rerank_score": 0.92, // 若 use_rerank=true
|
||||||
|
"metadata": {
|
||||||
|
"userid": "user1",
|
||||||
|
"document_id": "<uuid>",
|
||||||
|
"filename": "test.txt",
|
||||||
|
"file_path": "/path/to/file.txt",
|
||||||
|
"upload_time": "2025-06-27T15:58:00",
|
||||||
|
"file_type": "txt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
...
|
||||||
|
]
|
||||||
|
- Error: HTTP 400, {"status": "error", "message": "<error message>"}
|
||||||
|
|
||||||
|
7. List User Files Endpoint:
|
||||||
|
path: /v1/listuserfiles
|
||||||
|
method: POST
|
||||||
|
headers: {"Content-Type": "application/json"}
|
||||||
|
data: {
|
||||||
|
"userid": "testuser2"
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
- Success: HTTP 200, [
|
||||||
|
{
|
||||||
|
"filename": "test.txt",
|
||||||
|
"file_path": "/path/to/file.txt",
|
||||||
|
"db_type": "textdb",
|
||||||
|
"upload_time": "2025-06-27T15:58:00",
|
||||||
|
"file_type": "txt"
|
||||||
|
},
|
||||||
|
...
|
||||||
|
]
|
||||||
|
- Error: HTTP 400, {"status": "error", "message": "<error message>"}
|
||||||
|
|
||||||
|
8. Connection Endpoint (for compatibility):
|
||||||
|
path: /v1/connection
|
||||||
|
method: POST
|
||||||
|
headers: {"Content-Type": "application/json"}
|
||||||
|
data: {
|
||||||
|
"action": "<initialize|get_params|create_collection|delete_collection|insert_document|delete_document|fused_search|search_query|list_user_files>",
|
||||||
|
"params": {...}
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
- Success: HTTP 200, {"status": "success", ...}
|
||||||
|
- Error: HTTP 400, {"status": "error", "message": "<error message>"}
|
||||||
|
|
||||||
|
9. Docs Endpoint:
|
||||||
|
path: /v1/docs
|
||||||
|
method: GET
|
||||||
|
response: This help text
|
||||||
|
"""
|
||||||
|
|
||||||
|
def init():
|
||||||
|
rf = RegisterFunction()
|
||||||
|
rf.register('createcollection', create_collection)
|
||||||
|
rf.register('deletecollection', delete_collection)
|
||||||
|
rf.register('insertfile', insert_file)
|
||||||
|
rf.register('deletefile', delete_file)
|
||||||
|
rf.register('fusedsearchquery', fused_search_query)
|
||||||
|
rf.register('searchquery', search_query)
|
||||||
|
rf.register('listuserfiles', list_user_files)
|
||||||
|
rf.register('connection', handle_connection)
|
||||||
|
rf.register('docs', docs)
|
||||||
|
|
||||||
|
async def docs(request, params_kw, *params, **kw):
|
||||||
|
return web.Response(text=helptext, content_type='text/plain')
|
||||||
|
|
||||||
|
async def not_implemented(request, params_kw, *params, **kw):
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "功能尚未实现"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=501)
|
||||||
|
|
||||||
|
async def create_collection(request, params_kw, *params, **kw):
|
||||||
|
debug(f'{params_kw=}')
|
||||||
|
se = ServerEnv()
|
||||||
|
engine = se.engine
|
||||||
|
db_type = params_kw.get('db_type')
|
||||||
|
if db_type is None:
|
||||||
|
debug(f'db_type 未提供')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "db_type 参数未提供"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
try:
|
||||||
|
result = await engine.handle_connection("create_collection", {"db_type": db_type})
|
||||||
|
debug(f'{result=}')
|
||||||
|
return web.json_response(result, dumps=lambda obj: json.dumps(obj, ensure_ascii=False))
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'创建集合失败: {str(e)}')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"collection_name": f"ragdb_{db_type}",
|
||||||
|
"message": str(e)
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
|
||||||
|
async def delete_collection(request, params_kw, *params, **kw):
|
||||||
|
debug(f'{params_kw=}')
|
||||||
|
se = ServerEnv()
|
||||||
|
engine = se.engine
|
||||||
|
db_type = params_kw.get('db_type')
|
||||||
|
if db_type is None:
|
||||||
|
debug(f'db_type 未提供')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "db_type 参数未提供"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
try:
|
||||||
|
result = await engine.handle_connection("delete_collection", {"db_type": db_type})
|
||||||
|
debug(f'{result=}')
|
||||||
|
return web.json_response(result, dumps=lambda obj: json.dumps(obj, ensure_ascii=False))
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'删除集合失败: {str(e)}')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"collection_name": f"ragdb_{db_type}",
|
||||||
|
"message": str(e)
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
|
||||||
|
async def insert_file(request, params_kw, *params, **kw):
|
||||||
|
debug(f'{params_kw=}')
|
||||||
|
se = ServerEnv()
|
||||||
|
engine = se.engine
|
||||||
|
file_path = params_kw.get('file_path')
|
||||||
|
userid = params_kw.get('userid')
|
||||||
|
db_type = params_kw.get('db_type')
|
||||||
|
if not all([file_path, userid, db_type]):
|
||||||
|
debug(f'file_path, userid 或 db_type 未提供')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "file_path, userid 或 db_type 未提供"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
try:
|
||||||
|
result = await engine.handle_connection("insert_document", {
|
||||||
|
"file_path": file_path,
|
||||||
|
"userid": userid,
|
||||||
|
"db_type": db_type
|
||||||
|
})
|
||||||
|
debug(f'{result=}')
|
||||||
|
return web.json_response(result, dumps=lambda obj: json.dumps(obj, ensure_ascii=False))
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'插入文件失败: {str(e)}')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"document_id": "",
|
||||||
|
"collection_name": f"ragdb_{db_type}",
|
||||||
|
"message": str(e)
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
|
||||||
|
async def delete_file(request, params_kw, *params, **kw):
|
||||||
|
debug(f'{params_kw=}')
|
||||||
|
se = ServerEnv()
|
||||||
|
engine = se.engine
|
||||||
|
db_type = params_kw.get('db_type')
|
||||||
|
userid = params_kw.get('userid')
|
||||||
|
filename = params_kw.get('filename')
|
||||||
|
if not all([db_type, userid, filename]):
|
||||||
|
debug(f'db_type, userid 或 filename 未提供')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "db_type, userid 或 filename 未提供"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
try:
|
||||||
|
result = await engine.handle_connection("delete_document", {
|
||||||
|
"db_type": db_type,
|
||||||
|
"userid": userid,
|
||||||
|
"filename": filename
|
||||||
|
})
|
||||||
|
debug(f'{result=}')
|
||||||
|
return web.json_response(result, dumps=lambda obj: json.dumps(obj, ensure_ascii=False))
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'删除文件失败: {str(e)}')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"collection_name": f"ragdb_{db_type}",
|
||||||
|
"message": str(e)
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
|
||||||
|
async def fused_search_query(request, params_kw, *params, **kw):
|
||||||
|
debug(f'{params_kw=}')
|
||||||
|
se = ServerEnv()
|
||||||
|
engine = se.engine
|
||||||
|
query = params_kw.get('query')
|
||||||
|
userid = params_kw.get('userid')
|
||||||
|
db_type = params_kw.get('db_type')
|
||||||
|
file_paths = params_kw.get('file_paths')
|
||||||
|
limit = params_kw.get('limit', 5)
|
||||||
|
offset = params_kw.get('offset', 0)
|
||||||
|
use_rerank = params_kw.get('use_rerank', True)
|
||||||
|
if not all([query, userid, db_type, file_paths]):
|
||||||
|
debug(f'query, userid, db_type 或 file_paths 未提供')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "query, userid, db_type 或 file_paths 未提供"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
try:
|
||||||
|
result = await engine.handle_connection("fused_search", {
|
||||||
|
"query": query,
|
||||||
|
"userid": userid,
|
||||||
|
"db_type": db_type,
|
||||||
|
"file_paths": file_paths,
|
||||||
|
"limit": limit,
|
||||||
|
"offset": offset,
|
||||||
|
"use_rerank": use_rerank
|
||||||
|
})
|
||||||
|
debug(f'{result=}')
|
||||||
|
return web.json_response(result, dumps=lambda obj: json.dumps(obj, ensure_ascii=False))
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'融合搜索失败: {str(e)}')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": str(e)
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
|
||||||
|
async def search_query(request, params_kw, *params, **kw):
|
||||||
|
debug(f'{params_kw=}')
|
||||||
|
se = ServerEnv()
|
||||||
|
engine = se.engine
|
||||||
|
query = params_kw.get('query')
|
||||||
|
userid = params_kw.get('userid')
|
||||||
|
db_type = params_kw.get('db_type')
|
||||||
|
file_paths = params_kw.get('file_paths')
|
||||||
|
limit = params_kw.get('limit', 5)
|
||||||
|
offset = params_kw.get('offset', 0)
|
||||||
|
use_rerank = params_kw.get('use_rerank', True)
|
||||||
|
if not all([query, userid, db_type, file_paths]):
|
||||||
|
debug(f'query, userid, db_type 或 file_paths 未提供')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "query, userid, db_type 或 file_paths 未提供"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
try:
|
||||||
|
result = await engine.handle_connection("search_query", {
|
||||||
|
"query": query,
|
||||||
|
"userid": userid,
|
||||||
|
"db_type": db_type,
|
||||||
|
"file_paths": file_paths,
|
||||||
|
"limit": limit,
|
||||||
|
"offset": offset,
|
||||||
|
"use_rerank": use_rerank
|
||||||
|
})
|
||||||
|
debug(f'{result=}')
|
||||||
|
return web.json_response(result, dumps=lambda obj: json.dumps(obj, ensure_ascii=False))
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'纯向量搜索失败: {str(e)}')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": str(e)
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
|
||||||
|
async def list_user_files(request, params_kw, *params, **kw):
|
||||||
|
debug(f'{params_kw=}')
|
||||||
|
se = ServerEnv()
|
||||||
|
engine = se.engine
|
||||||
|
userid = params_kw.get('userid')
|
||||||
|
if not userid:
|
||||||
|
debug(f'userid 未提供')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "userid 参数未提供"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
try:
|
||||||
|
result = await engine.handle_connection("list_user_files", {
|
||||||
|
"userid": userid
|
||||||
|
})
|
||||||
|
debug(f'{result=}')
|
||||||
|
return web.json_response(result, dumps=lambda obj: json.dumps(obj, ensure_ascii=False))
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'查询用户文件列表失败: {str(e)}')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": str(e)
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
|
||||||
|
async def handle_connection(request, params_kw, *params, **kw):
|
||||||
|
debug(f'{params_kw=}')
|
||||||
|
se = ServerEnv()
|
||||||
|
engine = se.engine
|
||||||
|
try:
|
||||||
|
data = await request.json()
|
||||||
|
action = data.get('action')
|
||||||
|
if not action:
|
||||||
|
debug(f'action 未提供')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": "action 参数未提供"
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
result = await engine.handle_connection(action, data.get('params', {}))
|
||||||
|
debug(f'{result=}')
|
||||||
|
return web.json_response(result, dumps=lambda obj: json.dumps(obj, ensure_ascii=False))
|
||||||
|
except Exception as e:
|
||||||
|
debug(f'处理连接操作失败: {str(e)}')
|
||||||
|
return web.json_response({
|
||||||
|
"status": "error",
|
||||||
|
"message": str(e)
|
||||||
|
}, dumps=lambda obj: json.dumps(obj, ensure_ascii=False), status=400)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(prog="Milvus Connection Service")
|
||||||
|
parser.add_argument('-w', '--workdir')
|
||||||
|
parser.add_argument('-p', '--port', default='8888')
|
||||||
|
parser.add_argument('connection_path')
|
||||||
|
args = parser.parse_args()
|
||||||
|
logger.debug(f"Arguments: {args}")
|
||||||
|
Klass = get_connection_class(args.connection_path)
|
||||||
|
se = ServerEnv()
|
||||||
|
se.engine = Klass()
|
||||||
|
workdir = args.workdir or os.getcwd()
|
||||||
|
port = args.port
|
||||||
|
debug(f'{args=}')
|
||||||
|
webserver(init, workdir, port)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
174
llmengine/kgc.py
Normal file
174
llmengine/kgc.py
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
from py2neo import Graph, Node, Relationship
|
||||||
|
from typing import Set, List, Dict, Tuple
|
||||||
|
|
||||||
|
# 配置日志
|
||||||
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class KnowledgeGraph:
|
||||||
|
def __init__(self, triples: List[Dict], document_id: str):
|
||||||
|
self.triples = triples
|
||||||
|
self.document_id = document_id
|
||||||
|
self.g = Graph("bolt://10.18.34.18:7687", auth=('neo4j', '261229..wmh'))
|
||||||
|
logger.info(f"开始构建知识图谱,document_id: {self.document_id}, 三元组数量: {len(triples)}")
|
||||||
|
|
||||||
|
def _normalize_label(self, entity_type: str) -> str:
|
||||||
|
"""规范化实体类型为 Neo4j 标签"""
|
||||||
|
if not entity_type or not entity_type.strip():
|
||||||
|
return 'Entity'
|
||||||
|
entity_type = re.sub(r'[^\w\s]', '', entity_type.strip())
|
||||||
|
words = entity_type.split()
|
||||||
|
label = '_'.join(word.capitalize() for word in words if word)
|
||||||
|
return label or 'Entity'
|
||||||
|
|
||||||
|
def _clean_relation(self, relation: str) -> Tuple[str, str]:
|
||||||
|
"""清洗关系,返回 (rel_type, rel_name)"""
|
||||||
|
relation = relation.strip()
|
||||||
|
if not relation:
|
||||||
|
return 'RELATED_TO', '相关'
|
||||||
|
if relation.startswith('<') and relation.endswith('>'):
|
||||||
|
cleaned_relation = relation[1:-1]
|
||||||
|
rel_name = cleaned_relation
|
||||||
|
rel_type = re.sub(r'[^\w\s]', '', cleaned_relation).replace(' ', '_').upper()
|
||||||
|
else:
|
||||||
|
rel_name = relation
|
||||||
|
rel_type = re.sub(r'[^\w\s]', '', relation).replace(' ', '_').upper()
|
||||||
|
if 'instance of' in relation.lower():
|
||||||
|
rel_type = 'INSTANCE_OF'
|
||||||
|
rel_name = '实例'
|
||||||
|
elif 'subclass of' in relation.lower():
|
||||||
|
rel_type = 'SUBCLASS_OF'
|
||||||
|
rel_name = '子类'
|
||||||
|
elif 'part of' in relation.lower():
|
||||||
|
rel_type = 'PART_OF'
|
||||||
|
rel_name = '部分'
|
||||||
|
logger.debug(f"处理关系: {relation} -> {rel_type} ({rel_name})")
|
||||||
|
return rel_type, rel_name
|
||||||
|
|
||||||
|
def read_nodes(self) -> Tuple[Dict[str, Set], Dict[str, List], List[Dict]]:
|
||||||
|
"""从三元组列表中读取节点和关系"""
|
||||||
|
nodes_by_label = {}
|
||||||
|
relations_by_type = {}
|
||||||
|
triples = []
|
||||||
|
|
||||||
|
try:
|
||||||
|
for triple in self.triples:
|
||||||
|
if not all(key in triple for key in ['head', 'head_type', 'type', 'tail', 'tail_type']):
|
||||||
|
logger.warning(f"无效三元组: {triple}")
|
||||||
|
continue
|
||||||
|
head, relation, tail, head_type, tail_type = (
|
||||||
|
triple['head'], triple['type'], triple['tail'], triple['head_type'], triple['tail_type']
|
||||||
|
)
|
||||||
|
head_label = self._normalize_label(head_type)
|
||||||
|
tail_label = self._normalize_label(tail_type)
|
||||||
|
logger.debug(f"实体类型: {head_type} -> {head_label}, {tail_type} -> {tail_label}")
|
||||||
|
|
||||||
|
if head_label not in nodes_by_label:
|
||||||
|
nodes_by_label[head_label] = set()
|
||||||
|
if tail_label not in nodes_by_label:
|
||||||
|
nodes_by_label[tail_label] = set()
|
||||||
|
nodes_by_label[head_label].add(head)
|
||||||
|
nodes_by_label[tail_label].add(tail)
|
||||||
|
|
||||||
|
rel_type, rel_name = self._clean_relation(relation)
|
||||||
|
if rel_type not in relations_by_type:
|
||||||
|
relations_by_type[rel_type] = []
|
||||||
|
relations_by_type[rel_type].append({
|
||||||
|
'head': head,
|
||||||
|
'tail': tail,
|
||||||
|
'head_label': head_label,
|
||||||
|
'tail_label': tail_label,
|
||||||
|
'rel_name': rel_name
|
||||||
|
})
|
||||||
|
|
||||||
|
triples.append({
|
||||||
|
'head': head,
|
||||||
|
'relation': relation,
|
||||||
|
'tail': tail,
|
||||||
|
'head_type': head_type,
|
||||||
|
'tail_type': tail_type
|
||||||
|
})
|
||||||
|
|
||||||
|
logger.info(f"读取节点: {sum(len(nodes) for nodes in nodes_by_label.values())} 个")
|
||||||
|
logger.info(f"读取关系: {sum(len(rels) for rels in relations_by_type.values())} 条")
|
||||||
|
return nodes_by_label, relations_by_type, triples
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"读取三元组失败: {str(e)}")
|
||||||
|
raise RuntimeError(f"读取三元组失败: {str(e)}")
|
||||||
|
|
||||||
|
def create_node(self, label: str, nodes: Set[str]):
|
||||||
|
"""创建节点,包含 document_id 属性"""
|
||||||
|
count = 0
|
||||||
|
for node_name in nodes:
|
||||||
|
query = f"MATCH (n:{label} {{name: '{node_name}', document_id: '{self.document_id}'}}) RETURN n"
|
||||||
|
try:
|
||||||
|
if self.g.run(query).data():
|
||||||
|
continue
|
||||||
|
node = Node(label, name=node_name, document_id=self.document_id)
|
||||||
|
self.g.create(node)
|
||||||
|
count += 1
|
||||||
|
logger.debug(f"创建节点: {label} - {node_name} (document_id: {self.document_id})")
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"创建节点失败: {label} - {node_name}, 错误: {str(e)}")
|
||||||
|
logger.info(f"创建 {label} 节点: {count}/{len(nodes)} 个")
|
||||||
|
return count
|
||||||
|
|
||||||
|
def create_relationship(self, rel_type: str, relations: List[Dict]):
|
||||||
|
"""创建关系"""
|
||||||
|
count = 0
|
||||||
|
total = len(relations)
|
||||||
|
seen_edges = set()
|
||||||
|
for rel in relations:
|
||||||
|
head, tail, head_label, tail_label, rel_name = (
|
||||||
|
rel['head'], rel['tail'], rel['head_label'], rel['tail_label'], rel['rel_name']
|
||||||
|
)
|
||||||
|
edge_key = f"{head_label}:{head}###{tail_label}:{tail}###{rel_type}"
|
||||||
|
if edge_key in seen_edges:
|
||||||
|
continue
|
||||||
|
seen_edges.add(edge_key)
|
||||||
|
|
||||||
|
query = (
|
||||||
|
f"MATCH (p:{head_label} {{name: '{head}', document_id: '{self.document_id}'}}), "
|
||||||
|
f"(q:{tail_label} {{name: '{tail}', document_id: '{self.document_id}'}}) "
|
||||||
|
f"CREATE (p)-[r:{rel_type} {{name: '{rel_name}'}}]->(q)"
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
self.g.run(query)
|
||||||
|
count += 1
|
||||||
|
logger.debug(f"创建关系: {head} -[{rel_type}]-> {tail} (document_id: {self.document_id})")
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"创建关系失败: {query}, 错误: {str(e)}")
|
||||||
|
logger.info(f"创建 {rel_type} 关系: {count}/{total} 条")
|
||||||
|
return count
|
||||||
|
|
||||||
|
def create_graphnodes(self):
|
||||||
|
"""创建所有节点"""
|
||||||
|
nodes_by_label, _, _ = self.read_nodes()
|
||||||
|
total = 0
|
||||||
|
for label, nodes in nodes_by_label.items():
|
||||||
|
total += self.create_node(label, nodes)
|
||||||
|
logger.info(f"总计创建节点: {total} 个")
|
||||||
|
return total
|
||||||
|
|
||||||
|
def create_graphrels(self):
|
||||||
|
"""创建所有关系"""
|
||||||
|
_, relations_by_type, _ = self.read_nodes()
|
||||||
|
total = 0
|
||||||
|
for rel_type, relations in relations_by_type.items():
|
||||||
|
total += self.create_relationship(rel_type, relations)
|
||||||
|
logger.info(f"总计创建关系: {total} 条")
|
||||||
|
return total
|
||||||
|
|
||||||
|
def export_data(self):
|
||||||
|
"""导出节点到文件,包含 document_id"""
|
||||||
|
nodes_by_label, _, _ = self.read_nodes()
|
||||||
|
os.makedirs('dict', exist_ok=True)
|
||||||
|
for label, nodes in nodes_by_label.items():
|
||||||
|
with open(f'dict/{label.lower()}.txt', 'w', encoding='utf-8') as f:
|
||||||
|
f.write('\n'.join(f"{name}\t{self.document_id}" for name in sorted(nodes)))
|
||||||
|
logger.info(f"导出 {label} 节点到 dict/{label.lower()}.txt: {len(nodes)} 个")
|
||||||
|
return
|
1136
llmengine/milvus_connection.py
Normal file
1136
llmengine/milvus_connection.py
Normal file
File diff suppressed because it is too large
Load Diff
71
test/connection/conf/config.json
Normal file
71
test/connection/conf/config.json
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
"filesroot": "$[workdir]$/files",
|
||||||
|
"logger": {
|
||||||
|
"name": "llmengine",
|
||||||
|
"levelname": "info",
|
||||||
|
"logfile": "$[workdir]$/logs/llmengine.log"
|
||||||
|
},
|
||||||
|
"website": {
|
||||||
|
"paths": [
|
||||||
|
["$[workdir]$/wwwroot", ""]
|
||||||
|
],
|
||||||
|
"client_max_size": 10000,
|
||||||
|
"host": "0.0.0.0",
|
||||||
|
"port": 8888,
|
||||||
|
"coding": "utf-8",
|
||||||
|
"indexes": [
|
||||||
|
"index.html",
|
||||||
|
"index.ui"
|
||||||
|
],
|
||||||
|
"startswiths": [
|
||||||
|
{
|
||||||
|
"leading": "/idfile",
|
||||||
|
"registerfunction": "idfile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"leading": "/v1/connection",
|
||||||
|
"registerfunction": "connection"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"leading": "/v1/createcollection",
|
||||||
|
"registerfunction": "createcollection"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"leading": "/v1/deletecollection",
|
||||||
|
"registerfunction": "deletecollection"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"leading": "/v1/insertfile",
|
||||||
|
"registerfunction": "insertfile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"leading": "/v1/deletefile",
|
||||||
|
"registerfunction": "deletefile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"leading": "/v1/fusedsearchquery",
|
||||||
|
"registerfunction": "fusedsearchquery"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"leading": "/docs",
|
||||||
|
"registerfunction": "docs"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"processors": [
|
||||||
|
[".tmpl", "tmpl"],
|
||||||
|
[".app", "app"],
|
||||||
|
[".ui", "bui"],
|
||||||
|
[".dspy", "dspy"],
|
||||||
|
[".md", "md"]
|
||||||
|
],
|
||||||
|
"rsakey_oops": {
|
||||||
|
"privatekey": "$[workdir]$/conf/rsa_private_key.pem",
|
||||||
|
"publickey": "$[workdir]$/conf/rsa_public_key.pem"
|
||||||
|
},
|
||||||
|
"session_max_time": 3000,
|
||||||
|
"session_issue_time": 2500,
|
||||||
|
"session_redis_notuse": {
|
||||||
|
"url": "redis://127.0.0.1:6379"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
test/connection/dict/cel.txt
Normal file
1
test/connection/dict/cel.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
实体 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
209
test/connection/dict/concept.txt
Normal file
209
test/connection/dict/concept.txt
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
285 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
498–514 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Chinese knowledge graphs 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
GY 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Joint Conf. on Artificial Intelligence 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KGE模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Knowledge Graph Embedding Technology Research 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Personalized entity recommendation 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
RJ. Relation embedding with dihedral group in knowledge graph 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransD学 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransE模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ZH, Hovy E. An interpretable knowledge transfer model 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Zhu ZB 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
architecture 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
dimensionality reduction 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
embedding 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
embedding model of entities and relationships in knowledge bases 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
embedding models for relation 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
embeddings 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
embeddings approach 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph completion 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph database 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph embedding 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph embedding based question answering 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph embeddings 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph link prediction 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph network 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph representation learning 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graph. 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
graphs 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
knowledge base completion 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
∑ 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
⊕c 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
事实集合 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
于戈 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
交互嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
人 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
人工智能 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
优惠推荐任务 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
会士 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
传统模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
似然 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
信息与动态 KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
偏差 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
偏置向量传输多向语义 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
元组 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
元组关联的实体对 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
元组学习知识 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
全局损失函数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关系 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关系-尾实体对建模 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关系向量 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关系向量和时间数字 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关联的矩阵 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
典 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
动态KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
动态知识图谱嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
动态知识图谱嵌入的学习过程 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
势超曲面 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
单层神经网络模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
单词输入神经网络 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
卷 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
卷积层 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
卷积提取特征 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
卷积神经网络 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
卷积神经网络模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
卷积过滤器 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
双曲几何模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
双曲空间 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
可感知时间间隔的动态知识图谱嵌入方法 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
可扩展性 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
可解释性 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
向量化操作 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
向量空间 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
噪音和矛盾的问题 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
图 7 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
图谱嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
型将关系和实体表示 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
基于相似性匹配的评分函数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
基于知识图谱嵌入的问答 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
基于知识图谱的问答 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
基于距离的模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
复嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
复数嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
复杂关系 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
复杂关系建模 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
复杂语义关联 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多关系知识图 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多层感知机 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多步关系路径 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多源信息 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
头实体嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
孙相会 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
定量分析 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体与关系嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体区分度 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体名称歧义性 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体嵌入向量服从正态分布 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体推荐框架 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体空间 r r Mrhi wrwti+(1,i=1,2,3) h3t1 h2 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实数字段 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
对称关系 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
嵌入三元组 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
嵌入技术 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
庞加莱球 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
引文知识图 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
张天成 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
张量分解 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
张量分量分解 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
张量层数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
张量神经网络模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
影矩阵 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
循环相关性 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
态 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
感知知识图谱嵌入方法 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
扩展模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
投影向量 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
投影矩阵 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
投影矩阵堆叠 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
挑战与展望 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
旋转模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
旋转矩阵 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
普通向量空间 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
智能中的概率推理 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
更新门 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
树状结构 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
模 型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
欧几里德范数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
欧拉公式 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
欧拉角 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
正则化项 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
流形 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
滤波器器 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
田雪 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
的知识图谱嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
相似性评分函数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
相关调查 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入技术 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入的应用 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识类型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
矩阵分解 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
矩阵的第ij项 2 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
神经关系提取框架 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
神经网络 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
神经网络模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
种基本符号 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
种被广泛采用的知识表示方法 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
等 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
简单问题 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
类 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
类 型的关系 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
类别 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
类比结构 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
级联 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
线性方式 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
线性模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
组 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
结构信息 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
结构化 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
结构化信息 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
结构化信息的知识表示模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
统一框架 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
统计关系学习 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
美国总统 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
翻译原理 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
翻译模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
能量函数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
自然语言处理 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
融合多源信息的知识图谱嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
融合实体描述的知识表示模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
表示学习模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
认知智能 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
训练语料库 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
评分函数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
识图谱嵌入的方法 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
识的语义表示 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
词向量 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
语义匹配模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
调查 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
谱表示 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
超平 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
超链接 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
距离函数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
软件学报 2023年 第 34卷 第 1期 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
软件学报 2023年第 34卷 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
软件学报 2023年第 34卷第 1期 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
远程监督 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
连接 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
连接头实体 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
链接 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
阵W和尾实体 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
阶Horn子句 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
隐藏层 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
集候选实体 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
静态子KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
静态知识图谱 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
非结构模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
面临的挑战 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
项目和数据稀疏性等问题 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
预测缺失链 接 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
高斯词嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
高维 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
黑盒神经模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
10
test/connection/dict/date.txt
Normal file
10
test/connection/dict/date.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
1097 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
2010 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
2012 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
2013 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
2016 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
2021 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
2023 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
2023年 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
<time> 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Annu 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
8
test/connection/dict/dis.txt
Normal file
8
test/connection/dict/dis.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
32th 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
5α 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
An C 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
MuRP 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
fr(h;t);r(m;1h”;mr 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
入相邻子KG之间的时间间隔 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入技术研究综述 279 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
6
test/connection/dict/eve.txt
Normal file
6
test/connection/dict/eve.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Joints 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
V, B, 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
W 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Wikipediaの学习 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
t 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
t-TransE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
16
test/connection/dict/loc.txt
Normal file
16
test/connection/dict/loc.txt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
1901787@stu.neu.edu.cn 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
5 Lt4 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
<concept> 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
La Palma 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
New York 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
R-GCN[80]模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Sun B, Han XP, Sun 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Sydney 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Vancouver 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Wikipedia组织的 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
learning 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
r(h r) 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
欧式空间(零曲率空间) 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
沈阳 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
矩阵W 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
77
test/connection/dict/media.txt
Normal file
77
test/connection/dict/media.txt
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<misc> 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Adcock AB 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
AlexNet 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Bollacker KD 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
CNN 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
CP 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Chinese knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ComplEx 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Connecting language and knowledge bases with 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ConvE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ConvE模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
DBLP 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
DL 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
DY 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
GPG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
GRU 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
GRU的模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
HypER模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
IJCAI 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
INDSCAL 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
JD 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
JMLR 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KEQA 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KGE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KGE技术 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
LM 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Le P, Dymetman M.Le P.LsTM-based mixture-of 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Learning entity and relation 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Learning sequence encoders 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Networks and Machine Learning 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
QA-KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Quaternion knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
RESCAL 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
STransE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Tensor factorization 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransE[15] 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransE在 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransE学习实体和关系 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransG模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
blocking 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
embedding model 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
instance of the 55th 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
knowledge graph 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
modeling 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
never-ending language learning 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
probabilistic logic programming 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
question answering 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
relation extraction 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
三向张量分解的新型关系学习方法 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
使用事实进行知识图谱嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关系 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关系DirectorOf 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
动态 KGE方法 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
区块链 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
基于知识图谱嵌入的问答框架(KEQA 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多源信息学习: 随着网络技术的快速发展, 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
大规模知识图谱中 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
学习模型RPJE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
学习结 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
对话生成 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
对话系统 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
对齐 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
现有知识 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
相似度 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知 识 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入技术研究综述 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入技术研究综述 283 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识库 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
神 经网络架构 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
结构性质学习 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
网络 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
软件学报 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
静态知识 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
115
test/connection/dict/misc.txt
Normal file
115
test/connection/dict/misc.txt
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
4种类型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
<dis> 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Continuous Vector Space Models and Their Compositionality 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ConvKB 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
CrossE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Dettmers T, Minervini P, Stenetorp P 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
GRU 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
HypER 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ITransF 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Jinf.computer.in. 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KG2E 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KGE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KGE框架 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KG嵌 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KG推理 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KRL模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
LFM模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
M ̈obius 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
MF 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
MLP 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
MuRP 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
NAM 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
NTN 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Neural knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Poincare[88] 2017 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Point-Wise空间 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
QA-KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
QQ 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ReLU 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
SE模型 (h;r;t) h 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
SLM模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
SSE模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
SSP模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Semantic Web 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TDG2E 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TX 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TorusE模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TranSparse 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransE[15] 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransE模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransG模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransMS模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
TransR模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Xu CR 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
entity description 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
geometry of knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
hierarchical types 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
instance of the 12th ACM Int’l Conf. 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
knowledge graphs 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
knowledge representation 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
link prediction 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
question 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
semantic 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
vector space 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
三元 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
三元组 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
不适定 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
人工神经网络 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
关系模式 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
卷积神经网络 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
双线 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
可解释性 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
四元数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
图 8 MLP, NTN, NAM (DNN)和NAM (RMNN 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
复杂模式 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多关系图嵌入的评分函数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多层非线性特征学习 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多步推理 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
多语 言和多模态 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
头实体 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
子KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
定义几 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体类别信息 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
实体类型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
层次化规律 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
张量乘法則 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
张量分解 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
形式的三元组 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
投影向量 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
拓扑结构.2 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
文本对齐来自动标记训练实例.DS 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
时间感知超 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
权重矩阵 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
流形的原理 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
深度神经网络 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
相似度 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
相似性 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱三元组 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识表示学习 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
矩阵-向量乘法 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
神经网络模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
稀疏知识图谱 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
空间紧致性的条件 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
系的索引 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
紧李群 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
细粒度属性 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
维度条目之间的全局关系 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
编码模型也可以 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
编码语义匹配 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
评分函数 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
语义匹配模型 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
超网络H 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
距离学习结构嵌入 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
连续向量空间 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
逻辑规则 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
高斯空间 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
黎曼流形 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
3
test/connection/dict/num.txt
Normal file
3
test/connection/dict/num.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
5 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
的 概率分布的论理学 ca_XX , . 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
27
test/connection/dict/org.txt
Normal file
27
test/connection/dict/org.txt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
Associates 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Associates Inc. 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Association for Computational Linguistics 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Battglia PWM 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
CCF 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Chang JJ 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Connectivist 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Dai 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Feng等人 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
GTK 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ICANN 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
JM.LSTM 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Jointal 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KG 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
KGE 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
LTM 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
PN. 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Sullivan 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Sun 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
WW. 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Wikipedia组织 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
geographies understanding 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
relational 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
东北大学 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
未来方向 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
系の 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
表 5 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
36
test/connection/dict/per.txt
Normal file
36
test/connection/dict/per.txt
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<org> 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
An B 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Battaglia PW, Hamrick JB, Bapst V 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Bordes等人 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Chen MH 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Chen Z 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Daiber J 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Feng J 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Guo L. 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Guo S 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Ji GL 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Jin, 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Leblay J 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Lei K, Chen 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Lei等人 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Lin等人 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Mintz 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Niu 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Niu GL 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Springer 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Tang 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
WY, Mo KX, Zhang Y, Peng XZ, Yang Q 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Wang Q 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Wang Z 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Yang F 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ZH, Li L, Xu W. CFO 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
ZHANG Tian-Cheng1 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Zhang DX, Yuan B 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Zhang W 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
geddy 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
learning and Learning enth. 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
trans 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
上的优化目标 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
函数定义为: 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
张天成 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
比尔·克林顿 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
7
test/connection/dict/time.txt
Normal file
7
test/connection/dict/time.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
32d 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
<loc> 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Annutal 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
knowledgebase 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
t 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
第几维的 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
词语 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
2
test/connection/dict/triplet.txt
Normal file
2
test/connection/dict/triplet.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
instance of 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
part of 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
17
test/connection/dict/unk.txt
Normal file
17
test/connection/dict/unk.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<dis> 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Jin J, Wan HY, Lin YF. Knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Tay Y, Luu, Hui SC, Brauer F. Random semantic tensor ensemble for scalable knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
Text-enhanced representation learning for knowledge 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
convolutional network 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
distance metric learning 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
link prediction 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
relation attention mechanism 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
trans encyclopedia 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
全连接 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
深度知识感知网络 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入技术研究综述 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入技术研究综述 293 h 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入技术研究综述 299 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
知识图谱嵌入技术研究综述 301 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
维度条目 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
||||||
|
融合实体类别信息的知识图谱表示学习方法 611674ee-1d01-4f39-b0dc-bca896dce7cc
|
0
test/connection/logs/llmengine.log
Normal file
0
test/connection/logs/llmengine.log
Normal file
3
test/connection/start.sh
Executable file
3
test/connection/start.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
export CONFIG_PATH=/share/wangmeihua/rag/conf/milvusconfig.yaml
|
||||||
|
CUDA_VISIBLE_DEVICES=7 /share/vllm-0.8.5/bin/python -m llmengine.connection -p 8888 Milvus
|
Loading…
Reference in New Issue
Block a user