milvus client run_analyzer error: 'str' object has no attribute '_get_connection' #41908
Unanswered
zhu3359
asked this question in
Q&A and General discussion
Replies: 1 comment 2 replies
-
run_analyzer() is not a static method, it should be called on a MilvusClient object.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
want to get a chinese sentence tokenizer result like https://milvus.io/docs/chinese-analyzer.md
run the code and get an error : /miniconda3/lib/python3.12/site-packages/pymilvus/milvus_client/milvus_client.py", line 1739, in run_analyzer
return self._get_connection().run_analyzer(
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute '_get_connection'
code is like :
from pymilvus import MilvusClient,DataType, connections, db
if name == "main":
analyzer_params = {
"type": "chinese",
}
sample_text = "Milvus 是一个高性能、可扩展的向量数据库"
result = MilvusClient.run_analyzer(sample_text, analyzer_params)
print("Chinese analyzer output:", result)
Beta Was this translation helpful? Give feedback.
All reactions