A simple Python library
Project description
sololib
一个 Python 工具包,提供多样化的对话语料生成功能。
安装
pip install sololib
功能
语料生成
生成多样化的对话模板,支持中英文混合:
import sololib
# 生成多轮对话
conversation = sololib.get_random_conversation()
# 返回: [("How do I learn Python?", "programming"), ("Can you tell me more?", "programming")]
# 生成单个随机问题
question = sololib.generate_single_question()
# 返回: "What's the best way to learn Django as a beginner?"
# 批量生成问题
questions = sololib.generate_questions(10)
# 返回: 10 个随机问题列表
统计信息
# 获取语料库统计
stats = sololib.get_corpus_stats()
# 返回:
# {
# "question_templates": {"en": 465, "cn": 117, "total": 582},
# "followup_templates": {"en": 30, "cn": 10, "total": 40},
# "estimated_combinations": 1850503,
# ...
# }
# 估计不重复组合数
combos = sololib.estimate_combinations() # ~185 万
核心函数
| 函数 | 说明 |
|---|---|
get_random_conversation(n=1) |
生成 n 组多轮对话 |
generate_single_question() |
生成单个随机问题 |
generate_questions(n=10) |
批量生成 n 个问题 |
get_corpus_stats() |
获取语料库统计信息 |
estimate_combinations() |
估算不重复组合数 |
数据规模
- 英文问题模板: 465 条
- 中文问题模板: 117 条
- 追问模板: 40 条
- 估计组合数: 1,850,503+
覆盖领域:烹饪、编程、健身、旅行、书籍、音乐、宠物、科学、职业、情感等。
开发
# 克隆仓库
git clone https://github.com/iding2959/sololib.git
cd sololib
# 安装开发依赖
uv sync --all-extras --dev
# 运行测试
uv run sololib
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sololib-0.2.0.tar.gz.
File metadata
- Download URL: sololib-0.2.0.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d74c65f6e7882dec7f2656122530116a2c9d959c1ffd7cecfa4fbcd06765ab7
|
|
| MD5 |
d5f21a9ca6872f97c554cfbfe40ccec3
|
|
| BLAKE2b-256 |
e44ab0f9829970fd75faa2a8f77dbc5d1b771345b0b7a440f7c6ae99ffdaa428
|
Provenance
The following attestation bundles were made for sololib-0.2.0.tar.gz:
Publisher:
sololibpypi.yml on iding2959/sololib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sololib-0.2.0.tar.gz -
Subject digest:
3d74c65f6e7882dec7f2656122530116a2c9d959c1ffd7cecfa4fbcd06765ab7 - Sigstore transparency entry: 1184333608
- Sigstore integration time:
-
Permalink:
iding2959/sololib@af079283409ed258cbcb50801d37a9217fc1d976 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/iding2959
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sololibpypi.yml@af079283409ed258cbcb50801d37a9217fc1d976 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sololib-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sololib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed4a7fb07a06ff4ec09518ece9f9365bba04f596ad5b7af169fdb4bc1c2f2395
|
|
| MD5 |
41066c8707833a0a08de6bfaf7199e9b
|
|
| BLAKE2b-256 |
2b0eddf292710a44cd51d82c8bd3e8b92366cb6e727e2d3d100ba88da64e2aae
|
Provenance
The following attestation bundles were made for sololib-0.2.0-py3-none-any.whl:
Publisher:
sololibpypi.yml on iding2959/sololib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sololib-0.2.0-py3-none-any.whl -
Subject digest:
ed4a7fb07a06ff4ec09518ece9f9365bba04f596ad5b7af169fdb4bc1c2f2395 - Sigstore transparency entry: 1184333674
- Sigstore integration time:
-
Permalink:
iding2959/sololib@af079283409ed258cbcb50801d37a9217fc1d976 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/iding2959
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sololibpypi.yml@af079283409ed258cbcb50801d37a9217fc1d976 -
Trigger Event:
push
-
Statement type: