PDF and Web Content Query Package
This package provides functionality to process PDF files and web pages, allowing users to query their content using natural language processing techniques.
Table of Contents
Features
- Process PDF files and answer queries about their content
- Crawl web pages and answer queries about their content
- Utilizes advanced embedding techniques for accurate content matching
Installation
To install this package, run:
pip install semanticbot
Replace semanticbot with the actual name of your package.
Usage
Processing a PDF
To process a PDF file and query its content:
from your_package_name import process_pdf
pdf_path = "path/to/your/file.pdf"
query = "What is the main topic of this document?"
results = process_pdf(pdf_path, query)
for chunk, similarity in results:
print(f"Similarity: {similarity}")
print(f"Text chunk: {chunk}
")
Crawling and Querying a Web Page
To crawl a web page and query its content:
from your_package_name import crawl_and_query
url = "https://example.com"
query = "What are the key features of the product?"
results = crawl_and_query(url, query)
for chunk, similarity in results:
print(f"Similarity: {similarity}")
print(f"Text chunk: {chunk}
")
How It Works
- For PDFs: The package extracts text content from the file.
- For Web Pages: It crawls the specified URL and extracts the text content.
- The extracted text is split into manageable chunks.
- The package uses HuggingFace's BGE embeddings to convert text chunks and the query into vector representations.
- Cosine similarity is used to find the most relevant text chunks for the given query.
- The top 5 most relevant chunks are returned along with their similarity scores.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for semanticbot 0.5.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 |
|---|---|---|---|---|
| semanticbot-0.5.1.tar.gz | 3.8 kB | Without provenance | Details for semanticbot-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| semanticbot-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for semanticbot-0.5.1-py3-none-any.whl |
Total release size: 9.2 kB
Release files / semanticbot-0.5.1.tar.gz
| Download URL | semanticbot-0.5.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cf801b087bdf1a270d967ae7a2ba83f9ff858d4c7e31f03c82fa3b2240b6fde
|
|
BLAKE2b-256 checksum How to use checksums |
8fa0aa743792db0ad63bea175356b8c605145215e750adeecae4ff3b9254b2e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|
Release files / semanticbot-0.5.1-py3-none-any.whl
| Download URL | semanticbot-0.5.1-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64bfe26cbd22fb48011b6a384be967b32fadf03235b877f48782d896a9f6c585
|
|
BLAKE2b-256 checksum How to use checksums |
48780e20048210aae393e09ebf5d04052037a7777ff2307f8794fba0b8c9943a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|
Security for semanticbot 0.5.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.