(ECD) เป็นการใช้งานที่มีน้ำหนักเบาและเพิ่มประสิทธิภาพของ Chromadb ที่ออกแบบมาสำหรับการฝังเอกสารหลายรูปแบบ สร้างขึ้นโดยเฉพาะสำหรับท่อ RAG ที่รวดเร็ว (การเรียกคืน-เพิ่มการรวมตัวกัน) เครื่องมือนี้เครื่องมือนี้จัดการกับข้อความรูปภาพและเอกสารผสมสื่อได้อย่างราบรื่นด้วยการตั้งค่าน้อยที่สุด
หมายเหตุ : การพึ่งพาและข้อกำหนดบรรจุภัณฑ์อยู่ภายใต้การพัฒนาที่ใช้งานอยู่
requirements.txt # Install Xcode Command Line Tools
xcode-select --install
# Install Homebrew
/bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh ) "git clone https://github.com/yourusername/EasyChromaDirectories.git
cd EasyChromaDirectories
pip install -r requirements.txt- ประกาศการพัฒนา : การจัดการแพ็คเกจและการแก้ไขการพึ่งพากำลังได้รับการปรับปรุงอย่างแข็งขัน อาจจำเป็นต้องตั้งค่าด้วยตนเองบางอย่าง
from easychromadb import DocumentEncoder
encoder = DocumentEncoder ( collection_name = "assets" ) # Process a single document
encoder . process_file ( "path/to/document.txt" )
# Process an entire directory
encoder . process_directory ( "path/to/documents/" ) results = encoder . query ( "your search query here" )
for result in results :
print ( f"Document: { result . name } " )
print ( f"Similarity: { result . score } " )ไม่จำเป็นต้องมีประสบการณ์ Python! ใช้คำสั่งง่ายๆเหล่านี้เพื่อจัดการเอกสารของคุณ:
# Process a directory of documents
python Chromav4_Encode_documents.py your_directory/
# Example:
python Chromav4_Encode_documents.py assets_ChromaDB_Vec/ # List all documents in the collection
python Chromav4_Encode_documents.py your_directory/ --list
# Example output:
# Collection: assets
# Total Documents: 6
# +-----+----------------+--------+---------------+
# | # | ID | Type | Name |
# +=====+================+========+===============+
# | 1 | txt_0_2288d1ca | TEXT | doc1.txt |
# | 2 | txt_1_c2ecec13 | TEXT | doc2.txt |
# ... # Search with a query and specify number of results
python Chromav4_Encode_documents.py your_directory/ --query " your search query " --n_results 2
# Example:
python Chromav4_Encode_documents.py assets_ChromaDB_Vec/ --query " Why is the sky blue? " --n_results 2 # Partial word matching
python Chromav4_Encode_documents.py your_directory/ --query " Who's the _____ uncle " --n_results 1
# Image and text combined search
python Chromav4_Encode_documents.py your_directory/ --query " Find similar images and text about nature "CLI จะโดยอัตโนมัติ:
โครงการรวมถึงการทดสอบที่ครอบคลุม:
เรียกใช้การทดสอบโดยใช้:
pytest test_Chromav4_Encode_documents.pyยินดีต้อนรับ! โปรดทำตามขั้นตอนเหล่านี้:
git checkout -b feature/amazing-feature )git commit -m 'Add amazing feature' )git push origin feature/amazing-feature )โครงการนี้ได้รับอนุญาตภายใต้ Apache License 2.0 - ดูไฟล์ใบอนุญาตสำหรับรายละเอียด
สร้างด้วย❤สำหรับชุมชนการประมวลผลเอกสาร