メインコンテンツまでスキップ
バージョン: User Guides (Cloud)

Decompounder

decompounder フィルターは、指定された辞書に基づいて複合語を個々の構成要素に分割し、複合語の一部を検索しやすくします。このフィルターは、ドイツ語のように複合語を頻繁に使用する言語で特に役立ちます。

設定

decompounder フィルターは、Zilliz Cloud のカスタムフィルターです。これを使用するには、フィルター設定で "type": "decompounder" を指定し、認識する単語構成要素の辞書を提供する word_list パラメーターを指定します。

analyzer_params = {
"tokenizer": "standard",
"filter":[{
"type": "decompounder", # Specifies the filter type as decompounder
"word_list": ["dampf", "schiff", "fahrt", "brot", "backen", "automat"],
}],
}

decompounder フィルターは、以下の設定可能なパラメーターを受け入れます。

パラメーター

説明

word_list

複合語を分割するために使用される単語コンポーネントのリスト。この辞書は、複合語が個々の単語に分解される方法を決定します。

decompounder フィルターは、トークナイザーによって生成された用語に対して動作するため、トークナイザーと組み合わせて使用する必要があります。Zilliz Cloud で利用可能なトークナイザーのリストについては、トークナイザー Reference を参照してください。

analyzer_params を定義した後、コレクションスキーマを定義する際に VARCHAR フィールドに適用できます。これにより、Zilliz Cloud は、指定されたアナライザーを使用してそのフィールドのテキストを処理し、効率的なトークン化とフィルタリングを行うことができます。詳細については、使用例 を参照してください。

アナライザー設定をコレクションスキーマに適用する前に、run_analyzer メソッドを使用してその動作を確認してください。

アナライザー設定

analyzer_params = {
"tokenizer": "standard",
"filter":[{
"type": "decompounder", # Specifies the filter type as decompounder
"word_list": ["dampf", "schiff", "fahrt", "brot", "backen", "automat"],
}],
}

run_analyzer を使用した検証

from pymilvus import (
MilvusClient,
)

client = MilvusClient(uri="YOUR_CLUSTER_ENDPOINT")

# Sample text to analyze
sample_text = "dampfschifffahrt brotbackautomat"

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

期待される出力

['dampf', 'schiff', 'fahrt', 'brotbackautomat']