Skip to main content

LittleKnow 轻量知识库模块

概述

LittleKnow 是一个基于 BM2.5 算法的文本检索系统,它能够对知识库中的内容进行高效检索。系统支持添加文本知识、进行网络搜索以及查询特定文本。

功能特点

  • 文本知识添加:用户可以向知识库中添加文本,以供检索使用。
  • 网络搜索:系统能够根据用户输入的关键词进行网络搜索,获取相关信息。
  • 文本查询:用户可以查询知识库中与特定文本相关的信息,系统支持返回前K个最相关结果。

使用方法

1. 初始化知识库

首先,需要创建一个 LittleKnow 实例,并指定知识库的名称。

lk = LittleKnow(know_name="大语言模型测试知识库2")

2. 添加文本知识

将文本添加到知识库中,以便后续检索。

lk.add_know(text)

3. 进行网络搜索

使用 know_net_work_search 方法,根据用户输入的关键词进行网络搜索。

res = lk.know_net_work_search("大语言模型")
print(res)

4. 查询知识库

使用 query 方法查询知识库中与特定文本相关的信息,可以通过 top_k 参数指定返回结果的数量。

results = lk.query("模型主体为4层FSMN结构", top_k=5)

技术细节

  • BM2.5 算法:BM2.5(Best Matching 2.5)是一种基于概率的文本检索算法,它能够根据文本的相关性对搜索结果进行排序。

应用场景

LittleKnow 适用于需要大量文本检索和知识管理的场景,例如企业知识库、在线帮助系统等。

注意事项

  • 确保输入的文本格式正确,以避免检索错误。
  • 网络搜索功能依赖于网络环境,可能受到网络速度和稳定性的影响。

版本信息

  • 当前文档描述的是 LittleKnow 系统的使用和功能,适用于版本 2.5。

联系我们

如有任何问题或需要技术支持,请联系我们的客服团队。

Metadata

Release files for LittleKnow 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for LittleKnow 1.0.2
File Size Uploaded
littleknow-1.0.2.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for LittleKnow 1.0.2
File Interpreter ABI Platform
littleknow-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / littleknow-1.0.2.tar.gz

Download URL littleknow-1.0.2.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
215589bdbe0d5c307d378e8bbd54c67192db1f8d6c6d80be6c05350316f0a34b
BLAKE2b-256 checksum
How to use checksums
275e4f343ab7d53152fedf709f238e7cee8b584d89f9244d1afee2d1bae700ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.11 Windows/10

Release files / littleknow-1.0.2-py3-none-any.whl

Download URL littleknow-1.0.2-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a56da4b5c66d98aca0d471442022f6b3a3893be4f5023eb19db41a9e2275103
BLAKE2b-256 checksum
How to use checksums
131accf382888cee8ddfda772ac7ffd3589efba36f9806411768f3816dd52e07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.11 Windows/10

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page