图
通过 graph
参数启用图存储。此组件需要安装 graph extras 扩展包。
启用后,将使用嵌入索引构建图网络。图节点与每次嵌入索引操作(索引/更新插入/删除)同步。图边在每次完成索引/更新插入/删除嵌入索引调用时,使用嵌入索引创建。
后端
backend: networkx|rdbms|custom
设置图后端。默认为 networkx
。
通过将此参数设置为可完全解析的类字符串来添加自定义图存储引擎。
rdbms
后端有以下附加设置。
rdbms
url: database url connection string, alternatively can be set via the
GRAPH_URL environment variable
schema: database schema to store graph - defaults to being
determined by the database
nodes: table to store node data, defaults to `nodes`
edges: table to store edge data, defaults to `edges`
批次大小
batchsize: int
批次查询大小,用于查询嵌入索引 - 默认为 256。
限制
limit: int
每次嵌入查询返回的最大结果数 - 默认为 15。
最小分数
minscore: float
考虑嵌入查询匹配所需的最小分数 - 默认为 0.1。
近似
approximate: boolean
为 true 时,仅对没有边的节点运行查询 - 默认为 true。
主题
topics:
algorithm: community detection algorithm (string), options are
louvain (default), greedy, lpa
level: controls number of topics (string), options are best (default) or first
resolution: controls number of topics (int), larger values create more
topics (int), defaults to 100
labels: scoring index method used to build topic labels (string)
options are bm25 (default), tfidf, sif
terms: number of frequent terms to use for topic labels (int), defaults to 4
stopwords: optional list of stop words to exclude from topic labels
categories: optional list of categories used to group topics, allows
granular topics with broad categories grouping topics
启用主题建模。默认值经过调整,以便在大多数情况下(除了类别)无需更改这些值。这些参数适用于需要完全控制社区检测过程的高级用例。
复制属性
copyattributes: boolean|list
在 insert
方法中从输入字典复制这些属性。如果设置为 True
,则复制所有属性。否则,只有此列表中指定的属性会作为属性复制到图中。