โมดูลสร้างเวกเตอร์และการสร้างเวกเตอร์ฝังอัตโนมัติ
เรียนรู้ว่าโมดูลสร้างเวกเตอร์ของ Weaviate เปลี่ยนออบเจ็กต์ข้อมูลของคุณเป็นเวกเตอร์โดยอัตโนมัติขณะนำเข้าอย่างไร และวิธีกำหนดค่าแยกตามคลาสและพร็อพเพอร์ตี
โมดูลสร้างเวกเตอร์และการสร้างเวกเตอร์ฝังอัตโนมัติ เป็นบทเรียน Vector Databases: Pinecone, Weaviate & pgvector ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Vector Databases: Pinecone, Weaviate & pgvector และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Vector Databases: Pinecone, Weaviate & pgvector มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Who Creates the Vectors?
Vector search needs every object to have a vector. You can compute embeddings yourself, or let Weaviate do it via a vectorizer module that embeds objects automatically on import.
What Is a Vectorizer Module?
A vectorizer is a pluggable module (e.g. text2vec-openai, text2vec-cohere, text2vec-huggingface) that Weaviate calls to convert text into vectors. You choose it when defining a class.
Configuring a Vectorizer
The vectorizer is set in the class schema.
class_def = {
'class': 'Article',
'vectorizer': 'text2vec-openai',
'properties': [
{'name': 'title', 'dataType': ['text']},
{'name': 'body', 'dataType': ['text']}
]
}
print(class_def['vectorizer'])Auto-Embedding on Import
With a vectorizer set, you import plain objects and Weaviate embeds them for you. No need to call an embedding API yourself.
- Send object properties
- Module generates the vector
- Object stored with its vector
Choosing Which Properties to Embed
Not every property should influence the vector. You can skip properties (like IDs or timestamps) so only meaningful text contributes to the embedding.
prop = {
'name': 'sku',
'dataType': ['text'],
'moduleConfig': {'text2vec-openai': {'skip': True}}
}
print('skip embedding:', prop['moduleConfig']['text2vec-openai']['skip'])Including Property Names
By default Weaviate can prepend the property name to its value before embedding. Disabling 'vectorizePropertyName' keeps the vector focused on content rather than field labels.
Bring Your Own Vectors
You can also set vectorizer to 'none' and supply precomputed vectors at import. Useful when you already run a custom embedding pipeline or need a model Weaviate does not host.
Module Configuration
Each vectorizer accepts options in moduleConfig, such as the model name or dimensions. Set them at the class level to control how embeddings are produced.
module_config = {
'text2vec-openai': {'model': 'text-embedding-3-small', 'type': 'text'}
}
print(module_config['text2vec-openai']['model'])Consistency at Query Time
The same vectorizer embeds your query so it lives in the same space as stored objects. This is why mixing models or changing the vectorizer after import breaks search consistency.
Auto vs Manual Trade-offs
When to use each:
- Auto-embedding — simplest, less code, Weaviate manages calls
- Manual vectors — full control, custom models, batch pre-processing
Putting It Together
Pick a vectorizer per class, skip irrelevant properties, configure the model, and let Weaviate auto-embed on import. Or set 'none' to bring your own vectors. Keep the vectorizer consistent between import and query.
Quick Check
Test your understanding of vectorizers.
Recap
You learned that Weaviate vectorizer modules auto-embed objects on import. Configure the module per class, skip non-meaningful properties, set the model in moduleConfig, or use 'none' to bring your own vectors. Keep the vectorizer consistent between import and query for valid search.
เรียนรู้ Vector Databases: Pinecone, Weaviate & pgvector ด้วย AI tutor — ฟรี
เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป
- คอร์ส
- 12
- บทเรียน
- 48
คำถามที่พบบ่อย
บทเรียน “โมดูลสร้างเวกเตอร์และการสร้างเวกเตอร์ฝังอัตโนมัติ” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “โมดูลสร้างเวกเตอร์และการสร้างเวกเตอร์ฝังอัตโนมัติ” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Vector Databases: Pinecone, Weaviate & pgvector ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Vector Databases: Pinecone, Weaviate & pgvector มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “โมดูลสร้างเวกเตอร์และการสร้างเวกเตอร์ฝังอัตโนมัติ”
เรียนรู้ว่าโมดูลสร้างเวกเตอร์ของ Weaviate เปลี่ยนออบเจ็กต์ข้อมูลของคุณเป็นเวกเตอร์โดยอัตโนมัติขณะนำเข้าอย่างไร และวิธีกำหนดค่าแยกตามคลาสและพร็อพเพอร์ตี คุณปฏิบัติ Vector Databases: Pinecone, Weaviate & pgvector ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Vector Databases: Pinecone, Weaviate & pgvector หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Vector Databases: Pinecone, Weaviate & pgvector บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “โมดูลสร้างเวกเตอร์และการสร้างเวกเตอร์ฝังอัตโนมัติ” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Vector Databases: Pinecone, Weaviate & pgvector นี้ได้ไหม
ได้ บทเรียน Vector Databases: Pinecone, Weaviate & pgvector ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- การกำหนดสคีมา Weaviate
- การนำเข้าออบเจ็กต์ข้อมูล
- คำค้น GraphQL ใน Weaviate
- โมดูลสร้างเวกเตอร์และการสร้างเวกเตอร์ฝังอัตโนมัติ