CreateVectorDatabase
✖
CreateVectorDatabase
更多信息和选项


- CreateVectorDatabase 初始化一个新的向量数据库来存储和管理高维数据,以实现高效的搜索和检索.
- 向量数据库的典型应用包括推荐系统、图像和文本检索以及大数据集中的相似性搜索.
- data 可取的值包括:
-
{vec1,…} 向量列表 {vec1val1,…} 向量列表和关联的值 {vec1,…}{val1,…} 向量和值之间的规则 - 标量列表被解释为一维向量列表. »
- 可接受的 vali 的形式包括:
-
"string" 字符串标签 <"tag1"v1,… > 标签和元数据值组成的关联 - 数据库 name 必须是字符串.
- 可指定以下选项:
-
DistanceFunction CosineDistance 如何计算向量距离 FeatureExtractor Identity 如何将输入转换为向量 GeneratedAssetLocation $GeneratedAssetLocation 将数据库保存到何处 OverwriteTarget Automatic 是否覆盖现有位置 WorkingPrecision Automatic 数值精度 - DistanceFunction 可取的值包括 EuclideanDistance、SquaredEuclideanDistance、CosineDistance、JaccardDissimilarity 和 HammingDistance.
- WorkingPrecision 可能的设置包括:
-
"Integer8" 从 到 127 的有符号 8 位整数
"Real32" 单精度实数 (32 bit) "Real64" 双精度实数 (64 bit)
范例
打开所有单元关闭所有单元基本范例 (2)常见实例总结
创建一个空的 VectorDatabaseObject:

https://wolfram.com/xid/0pnajhbwasn3fjtq-4h10mh


https://wolfram.com/xid/0pnajhbwasn3fjtq-57z7wu


https://wolfram.com/xid/0pnajhbwasn3fjtq-y98n6a

范围 (5)标准用法实例范围调查
数据源 (3)
元数据 (2)

https://wolfram.com/xid/0pnajhbwasn3fjtq-9rm8gd


https://wolfram.com/xid/0pnajhbwasn3fjtq-uqpcyy

将带有标签的元数据指定为 Association:

https://wolfram.com/xid/0pnajhbwasn3fjtq-zz51od


https://wolfram.com/xid/0pnajhbwasn3fjtq-gfw643

选项 (10)各选项的常用值和功能
DistanceFunction (1)

https://wolfram.com/xid/0pnajhbwasn3fjtq-iwbp6n

默认情况下,使用 EuclideanDistance:

https://wolfram.com/xid/0pnajhbwasn3fjtq-gc2leo

FeatureExtractor (1)
只有向量可以被存储在数据库中;指定可以提取图像特征的 FeatureExtractor:

https://wolfram.com/xid/0pnajhbwasn3fjtq-el8sik


https://wolfram.com/xid/0pnajhbwasn3fjtq-9n2qrl

GeneratedAssetLocation (3)

https://wolfram.com/xid/0pnajhbwasn3fjtq-l1r3rm


https://wolfram.com/xid/0pnajhbwasn3fjtq-y7pgm0


https://wolfram.com/xid/0pnajhbwasn3fjtq-zwx4c9


https://wolfram.com/xid/0pnajhbwasn3fjtq-qki0up


https://wolfram.com/xid/0pnajhbwasn3fjtq-jdp7zb


https://wolfram.com/xid/0pnajhbwasn3fjtq-k9yd6q


https://wolfram.com/xid/0pnajhbwasn3fjtq-nt2k9v

OverwriteTarget (2)

https://wolfram.com/xid/0pnajhbwasn3fjtq-hakd8q

如果采用默认设置 OverwriteTargetAutomatic,将生成一个新的数据库名称以避免冲突:

https://wolfram.com/xid/0pnajhbwasn3fjtq-1zmjtm

要强制覆盖,请使用 OverwriteTargetTrue:

https://wolfram.com/xid/0pnajhbwasn3fjtq-xq3cz9

用 OverwriteTargetFalse 进行检查:

https://wolfram.com/xid/0pnajhbwasn3fjtq-h0x4j0


OverwriteTargetFalse 还将防止在不同位置重复使用相同的数据库名称:

https://wolfram.com/xid/0pnajhbwasn3fjtq-hr7372



https://wolfram.com/xid/0pnajhbwasn3fjtq-kwd9r5


https://wolfram.com/xid/0pnajhbwasn3fjtq-g9gcg5


用 OverwriteTargetTrue 覆盖现有文件:

https://wolfram.com/xid/0pnajhbwasn3fjtq-77ufhe

WorkingPrecision (3)

https://wolfram.com/xid/0pnajhbwasn3fjtq-0lrwh7


https://wolfram.com/xid/0pnajhbwasn3fjtq-cw4iup


https://wolfram.com/xid/0pnajhbwasn3fjtq-6foce

https://wolfram.com/xid/0pnajhbwasn3fjtq-f4r5i0


https://wolfram.com/xid/0pnajhbwasn3fjtq-nmjf3s


https://wolfram.com/xid/0pnajhbwasn3fjtq-l9bcnn

属性和关系 (1)函数的属性及与其他函数的关联
可能存在的问题 (4)常见隐患和异常行为

https://wolfram.com/xid/0pnajhbwasn3fjtq-u38tg4



https://wolfram.com/xid/0pnajhbwasn3fjtq-u48omw



https://wolfram.com/xid/0pnajhbwasn3fjtq-cs503c


https://wolfram.com/xid/0pnajhbwasn3fjtq-sx9pcw

使用 DeleteObject 删除错误生成的 VectorDatabaseObject:

https://wolfram.com/xid/0pnajhbwasn3fjtq-efa0ka

https://wolfram.com/xid/0pnajhbwasn3fjtq-dxjj4r

或者,使用选项 OverwriteTargetTrue 来覆盖旧数据库:

https://wolfram.com/xid/0pnajhbwasn3fjtq-kb1hbk

OverwriteTarget -> False 会显示错误消息,而不是增加一个递增数字:

https://wolfram.com/xid/0pnajhbwasn3fjtq-3xv24k



https://wolfram.com/xid/0pnajhbwasn3fjtq-c9jibc


https://wolfram.com/xid/0pnajhbwasn3fjtq-wacmr


https://wolfram.com/xid/0pnajhbwasn3fjtq-jt4t6u

https://wolfram.com/xid/0pnajhbwasn3fjtq-m3xs4g


https://wolfram.com/xid/0pnajhbwasn3fjtq-p2bf1r


https://wolfram.com/xid/0pnajhbwasn3fjtq-d0mrc0


https://wolfram.com/xid/0pnajhbwasn3fjtq-lcdzeu

Wolfram Research (2024),CreateVectorDatabase,Wolfram 语言函数,https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.
文本
Wolfram Research (2024),CreateVectorDatabase,Wolfram 语言函数,https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.
Wolfram Research (2024),CreateVectorDatabase,Wolfram 语言函数,https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.
CMS
Wolfram 语言. 2024. "CreateVectorDatabase." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.
Wolfram 语言. 2024. "CreateVectorDatabase." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.
APA
Wolfram 语言. (2024). CreateVectorDatabase. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/CreateVectorDatabase.html 年
Wolfram 语言. (2024). CreateVectorDatabase. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/CreateVectorDatabase.html 年
BibTeX
@misc{reference.wolfram_2025_createvectordatabase, author="Wolfram Research", title="{CreateVectorDatabase}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/CreateVectorDatabase.html}", note=[Accessed: 02-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_createvectordatabase, organization={Wolfram Research}, title={CreateVectorDatabase}, year={2024}, url={https://reference.wolfram.com/language/ref/CreateVectorDatabase.html}, note=[Accessed: 02-April-2025
]}