メインコンテンツまでスキップ

Standard Tokenizer

Zilliz Cloud の standard tokenizer は、スペースと句読点に基づいてテキストを分割するため、ほとんどの言語に適しています。

Configuration

standard tokenizer を使用して analyzer を設定するには、analyzer_paramstokenizerstandard に設定します。

python
analyzer_params = {
"tokenizer": "standard",
}

standard tokenizer は、1 つ以上の filter と組み合わせて使用できます。たとえば、次のコードは standard tokenizer と lowercase filter を使用する analyzer を定義しています。

python
analyzer_params = {
"tokenizer": "standard",
"filter": ["lowercase"]
}
📘注意

より簡単に設定するには、standard tokenizer と lowercase filter を組み合わせた standard analyzer を使用することもできます。

analyzer_params を定義した後、collection schema を定義する際にそれらを VARCHAR フィールドへ適用できます。これにより Zilliz Cloud は、そのフィールド内のテキストを指定された analyzer を使って処理し、効率的な tokenization と filtering を行えます。詳細については、使用例 を参照してください。

Examples

analyzer 設定を collection schema に適用する前に、run_analyzer メソッドを使用してその動作を確認してください。

Analyzer configuration

python
analyzer_params = {
"tokenizer": "standard",
"filter": ["lowercase"]
}

Verification using run_analyzer

python
from pymilvus import (
MilvusClient,
)

client = MilvusClient(
uri="YOUR_CLUSTER_ENDPOINT",
token="YOUR_CLUSTER_TOKEN"
)

# Sample text to analyze
sample_text = "The Milvus vector database is built for scale!"

# Run the standard analyzer with the defined configuration
result = client.run_analyzer(sample_text, analyzer_params)
print("English analyzer output:", result)

Expected output

sql
['the', 'milvus', 'vector', 'database', 'is', 'built', 'for', 'scale']