DocArray 0.21.0版本发布!新增OpenSearch后端存储,支持Redis后端存储的多语言文本搜索!...

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

9ac81e167010123bb6420a1740e7ba61.png

github.com/docarray/docarray

DocArray 是一个用于处理、传输和存储多模态数据的 Python 工具包。DocArray 提供便捷的多模态数据处理功能具备基于 Protobuf 提供高性能的网络传输性能同时也为多种向量存储方案提供统一的 API 接口。

💡 DocArray 于 2022 年 1 月在开源 Apache 许可证 2.0 下发布。目前它是 LF AI & Data Foundation 下的沙盒项目。

🌟 GitHub: https://github.com/docarray

🧑‍🤝‍🧑 Discord社区: https://discord.gg/WaMp6PVPgR

📖 官方文档https://docarray.jina.ai/

此版本包含 3 项新功能7 项错误修正和 5 项文档改进。

新功能

📦 OpenSearch 后端存储(#853)

现在 DocArray 增加了一个新的后端存储OpenSearch您可以使用 OpenSearch 后端存储对 Document 进行索引并对它们进行 ANN 搜索

from docarray import Document, DocumentArray
import numpy as np

# Connect to OpenSearch instance
n_dim = 3

da = DocumentArray(
    storage='opensearch',
    config={'n_dim': n_dim},
)

# Index Documents
with da:
    da.extend(
        [
            Document(id=f'r{i}', embedding=i * np.ones(n_dim))
            for i in range(10)
        ]
    )

# Perform ANN search
np_query = np.ones(n_dim) * 8
results = da.find(np_query, limit=10)

此外OpenSearch 后端存储还支持 过滤查询按文本搜索 和 按标签搜索

有关其用法的更多信息请参阅 官方文档[1]

🎨 增加 Point Cloud 显示的颜色(#961)

现在您可以在 point cloud 数据中包含颜色信息可以使用 display_point_cloud_tensor()可视化

coords = np.load('a_red_motorbike/coords.npy')
colors = np.load('a_red_motorbike/coord_colors.npy')

doc = Document(
    tensor=coords,
    chunks=DocumentArray([Document(tensor=colors, name='point_cloud_colors')])
)
doc.display()

2749520aeee2e9ea2dd48721db50932b.png

🌎 支持 Redis 后端存储的多语言文本搜索(#953)

Redis 后端存储现在支持各种支持的语言的文本搜索。要设置所需语言请在 Redis 配置中更改语言参数

da = DocumentArray(
    storage='redis',
    config={
        'n_dim': 128,
        'index_text': True,
        'language': 'chinese',
    },
)

错误修正 🐞

1. 用空格替换换行符来修复图像中的显示(#963)

当文档字段中包含字符串'\n'doc.plot()会导致渲染错误。这次修复了这些错误将'\n'渲染为空格。

2. 修正to_pydantic_model()中不需要的强制转换(#949)

此错误导致当调用 to_pydantic_model()to_dict() 时所有形式为 'Infinity' 的字符串都会被强制转换为字符串 'inf'。现在已经修复这些字符串将保留不变。

3. 在索引上而不是查询上计算相关文档(#950)

embed_and_evaluate()方法中每个标签的相关文档数量原先是基于 document 自身计算的。这不一般正确因此在此修复之后根据索引数据中的文档计算量。

4. 删除列表类型偏移索引创建(#936)

当文档存储禁用了列表行为的功能时它不再创建 id 映射的偏移量这提高了性能。

5. 添加对远程音频文件的支持(#933)

从远程 URL 加载音频文件会导致 FileNotFoundError现在已经修复。

6. 查询运算符$exists与标签不正确(#911)(#923)

在修复之前$exists 会将 false-y 值(如 0[])视为不存在。现在已经修复。

7. 从单例列表中的数据类获取文档(#1018)

当使用 dataclass 创建多模态 Document 时即使相应字段被注释为 List[...]单例的列表也被视为单个元素。现在我们已经考虑了这种情况即使对于单一输入访问这样的字段也将是产生 DocumentArray。

文档改进 📗

  • 新增 DocArray Discord[2]社区链接(#1010)

  • 减少版本以避免部署超时(#977)

  • 修正数据管理部分在文档中未出现(#967)

  • 在侧边栏中链接到 OpenSearch 文档(#960)

  • 将“多模态”修改为“数据类型”(#934)

贡献者 🤟

我们要感谢本次发布的所有贡献者

  • Jay Bhambhani (@jay-bhambhani)

  • Alvin Prayuda (@alphinside)

  • Johannes Messner (@JohannesMessner)

  • samsja (@samsja)

  • Marco Luca Sbodio (@marcosbodio)

  • Anne Yang (@AnneYang720)

  • Michael Günther (@guenthermi)

  • AlaeddineAbdessalem (@alaeddine-13)

  • Han Xiao (@hanxiao)

  • Alex Cureton-Griffiths (@alexcg1)

  • Charlotte Gerhaher (@anna-charlotte)

参考资料

[1]

官方文档: https://docarray.jina.ai/advanced/document-store/opensearch/

[2]

Discord: https://discord.gg/WaMp6PVPgR

更多技术文章

⚖️ 模型微调低预算高期望

🌪 开箱即用的云原生多模态系统解决方案

📖 Jina AI 创始人肖涵博士解读多模态AI的范式变革

🎨 语音生成图像任务|🚀 模型微调神器 Finetuner

👬 在 Jina AI 社区连接、分享、共创

238730344fda6b075e9fd5e0acea7f7a.png

点击“阅读原文”即刻加入活动

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: redis

“DocArray 0.21.0版本发布!新增OpenSearch后端存储,支持Redis后端存储的多语言文本搜索!...” 的相关文章