Cncharonly

cncharonly 필터는 중국어 이외의 문자가 포함된 토큰을 제거합니다. 이 필터는 중국어 텍스트에만 집중하여 다른 문자, 숫자 또는 기호가 포함된 토큰을 모두 걸러내고자 할 때 유용합니다.

구성

cncharonly 필터는 Milvus에 내장되어 있습니다. 이를 사용하려면 analyzer_params 내의 filter 섹션에 이름을 지정하기만 하면 됩니다.

analyzer_params = {
    "tokenizer": "standard",
    "filter": ["cncharonly"],
}
Map<String, Object> analyzerParams = new HashMap<>();
analyzerParams.put("tokenizer", "standard");
analyzerParams.put("filter", Collections.singletonList("cncharonly"));
const analyzer_params = {
    "tokenizer": "standard",
    "filter": ["cncharonly"],
};
analyzerParams = map[string]any{"tokenizer": "standard", "filter": []any{"cncharonly"}}
# restful
analyzerParams='{
  "tokenizer": "standard",
  "filter": [
    "cncharonly"
  ]
}'

cncharonly 필터는 토큰화 도구에서 생성된 용어에 대해 작동하므로 토큰화 도구와 함께 사용해야 합니다. Milvus에서 사용할 수 있는 토큰라이저 목록은 표준 토큰라이저와 그 자매 페이지를 참조하세요.

analyzer_params 을 정의한 후 컬렉션 스키마를 정의할 때 VARCHAR 필드에 적용할 수 있습니다. 이렇게 하면 Milvus가 지정된 분석기를 사용하여 해당 필드의 텍스트를 처리하여 효율적인 토큰화 및 필터링을 수행할 수 있습니다. 자세한 내용은 사용 예시를 참조하세요.

예제

분석기 구성을 컬렉션 스키마에 적용하기 전에 run_analyzer 메서드를 사용하여 그 동작을 확인하세요.

분석기 구성

analyzer_params = {
    "tokenizer": "standard",
    "filter": ["cncharonly"],
}
Map<String, Object> analyzerParams = new HashMap<>();
analyzerParams.put("tokenizer", "standard");
analyzerParams.put("filter", Collections.singletonList("cncharonly"));
// javascript
analyzerParams = map[string]any{"tokenizer": "standard", "filter": []any{"cncharonly"}}
# restful

다음을 사용하여 확인 run_analyzerCompatible with Milvus 2.5.11+

# Sample text to analyze
sample_text = "Milvus 是 LF AI & Data Foundation 下的一个开源项目,以 Apache 2.0 许可发布。"

# Run the standard analyzer with the defined configuration
result = MilvusClient.run_analyzer(sample_text, analyzer_params)
print(result)
// java
// javascript
// go
# restful

예상 출력

['是', '下的一个开源项目', '以', '许可发布']

번역DeepL

관리형 Milvus를 무료로 사용해 보세요

Zilliz Cloud는 번거로움이 없으며, Milvus 기반으로 10배 더 빠릅니다.

시작하기
피드백

이 페이지가 도움이 되었나요?