Skip to main content

pipowl 🦉

Open Semantic Tools for Python

PyPI version License Downloads

pipowl: 目標:快速、穩定的 embedding 相似度工具

v1.6.0

pipowl 提供:

SemanticOwl

輕量語意編碼器(使用 SentenceTransformer)

LangOwl

語意搜尋(top-k + cosine similarity)


安裝

pip install pipowl

使用方式

① 叫出 LangOwl(像叫一隻貓頭鷹出來)

from pipowl.lang import LangOwl

lang = LangOwl()
② 準備一些要比對的句子清單

corpus = [
    "我今天真的好累",
    "我覺得今天狀態不太好",
    "今天的天氣真的很好",
]
③ 丟一句話進去,看哪句最像

results = lang.topk("我今天真的很想睡覺,因為工作太累了", corpus)
④ 印出結果(分數+句子)

for text, score in results:
    print(score, text)    

總結

pipowl 是一個用來「比較句子語意相似度」的小工具。

你只要給它兩個東西:

你的句子(要查的)

你的一組句子(要比的)

它就會告訴你「哪一句最像」。

輸出示例

0.903 我今天真的好累
0.882 我覺得今天狀態不太好
0.834 今天的天氣真的很好

快速試用(Quickstart)

quickstart.py

  • py -m quickstart
from pipowl.lang import LangOwl

# 叫出語意偵探 LangOwl
lang = LangOwl()

# 準備一組你想比較的句子清單
corpus = [
    "我今天真的好累",
    "我覺得今天狀態不太好",
    "今天的天氣真的很好",
]

# 互動式輸入
while True:
    query = input("請輸入句子: ")

    results = lang.topk(query, corpus)

    print("\n相似結果:")
    for text, score in results:
        print(f"{score:.3f} | {text}")
    print()

minimal.py

from pipowl.lang import LangOwl

lang = LangOwl()
results = lang.topk("我很累", ["我好累", "我想吃飯"])
print(results)

Metadata

Release files for pipowl 1.6.0

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

Source distribution (sdist)

Source distribution for pipowl 1.6.0
File Size Uploaded Provenance Actions
pipowl-1.6.0.tar.gz 8.0 kB Without provenance Details for pipowl-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pipowl 1.6.0
File Interpreter ABI Platform Actions
pipowl-1.6.0-py3-none-any.whl Python 3 none any Details for pipowl-1.6.0-py3-none-any.whl

Total release size: 15.3 kB

Release files / pipowl-1.6.0.tar.gz

Download URL pipowl-1.6.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
29c61a33177e47e3f33ee4bbbe2032c67875710f088493dc1c9a8fdb33613e71
BLAKE2b-256 checksum
How to use checksums
9202850766c2d75a8b291b23237f29a6f808261812a36d51b032818c09e52658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / pipowl-1.6.0-py3-none-any.whl

Download URL pipowl-1.6.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a87f56efd90ef30018d74fe6e14929957d248add4ae2da925941533b29bd94c3
BLAKE2b-256 checksum
How to use checksums
3097dfcbebf622bb750bfe2628b430f0f5835b9e307af028d8b813d6bfaa12d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for pipowl 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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