停止詞
stop
篩選器會從標記化文字中移除指定的停止詞,有助於剔除常見、意義較小的字詞。您可以使用stop_words
參數設定停止詞清單。
設定
length
篩選器是 Milvus 的自訂篩選器。要使用它,請在過濾器設定中指定"type": "stop"
,以及提供停用字清單的stop_words
參數。
analyzer_params = {
"tokenizer": "standard",
"filter":[{
"type": "stop", # Specifies the filter type as stop
"stop_words": ["of", "to", "_english_"], # Defines custom stop words and includes the English stop word list
}],
}
stop
過濾器接受下列可設定的參數。
參數 | 說明 |
---|---|
| 要從標記化中移除的詞彙清單。預設使用預先定義的 |
stop
過濾器會對 tokenizer 產生的詞彙進行操作,因此必須與 tokenizer 結合使用。
定義analyzer_params
之後,您可以在定義集合模式時,將它們套用到VARCHAR
欄位。這可讓 Milvus 使用指定的分析器來處理該欄位中的文字,以進行有效率的標記化和過濾。詳情請參閱範例使用。
輸出範例
以下是stop
過濾器如何處理文字的範例。
原始文字。
"The stop filter allows control over common stop words for text processing."
預期輸出(含stop_words: ["the", "over", "_english_"]
)。
["The", "stop", "filter", "allows", "control", "common", "stop", "words", "text", "processing"]