langchain-jieba
An integration package connecting Jieba and LangChain
Jieba link extractor
Description
langchain_community.graph_vectorstores support storing texts and their relationships in a vector database in the form of a knowledge graph.But the
recommended extractor such as KeybertLinkExtractor works better in an English environment,while it performs poorly in a Chinese environment.
JiebaLinkExtractor extract keywords from texts depend on jieba.analyse lib, which more suitable in a Chinese environment.
Installation
%pip install langchain_jieba
Usage
extract from single text
from langchain_jieba import JiebaLinkExtractor
extractor = JiebaLinkExtractor()
results = extractor.extract_one("小明硕士毕业于中国科学院计算所,后在日本京都大学深造")
print(f"results={results}")
results={Link(kind='kw', direction='bidir', tag='日本京都大学'), Link(kind='kw', direction='bidir', tag='计算所'), Link(kind='kw', direction='bidir', tag='小明')}
extract from multiple texts
from langchain_jieba import JiebaLinkExtractor
CONTENT1 = '小明硕士毕业于中国科学院计算所,后在日本京都大学深造'
CONTENT2 = '我来到北京清华大学'
extractor = JiebaLinkExtractor()
results = list(extractor.extract_many([CONTENT1, CONTENT2]))
print(f"results[0]={results[0]}")
print(f"results[1]={results[1]}")
results[0]={Link(kind='kw', direction='bidir', tag='日本京都大学'), Link(kind='kw', direction='bidir', tag='计算所'), Link(kind='kw', direction='bidir', tag='小明')} results[1]={Link(kind='kw', direction='bidir', tag='清华大学'), Link(kind='kw', direction='bidir', tag='来到'), Link(kind='kw', direction='bidir', tag='北京')}
Metadata
Release files for langchain-jieba 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_jieba-0.1.1.tar.gz | 4.2 kB | Without provenance | Details for langchain_jieba-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_jieba-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for langchain_jieba-0.1.1-py3-none-any.whl |
Total release size: 9.0 kB
Release files / langchain_jieba-0.1.1.tar.gz
| Download URL | langchain_jieba-0.1.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d996a0992d6d7f9a85231ea0d814960fb48cf8fd4742e33980f2204fc835a06e
|
|
BLAKE2b-256 checksum How to use checksums |
5d66eb1f1bb2195489dd1dc6e2813f7e54ef7d831a33bad3a604d17718684112
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.11.11 Windows/10
|
Release files / langchain_jieba-0.1.1-py3-none-any.whl
| Download URL | langchain_jieba-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c65bb14450d5f17918da86a0fdaf6fbd9bfbea3348a8da0aa9c07637b7b5b9b8
|
|
BLAKE2b-256 checksum How to use checksums |
7b8b7c514bcd04857e4affce9f7e8e21b7ec80d2592a858f924e64f4152d7358
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.11.11 Windows/10
|
Security for langchain-jieba 0.1.1
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.