如何使用Property Graph Index分析中文文本?需要重新定义prompt吗?
vddsk6oq1#
是的,您需要重新定义 prompt 以使用 Property Graph Index 分析中文文本。可以通过自定义 TextToCypherRetriever 类中的 text_to_cypher_template 参数来处理不同的语言,包括中文。您可以定义一个适用于中文文本的 text_to_cypher_template1(https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/indices/property_graph/sub_retrievers/text_to_cypher.py)。
TextToCypherRetriever
text_to_cypher_template
1条答案
按热度按时间vddsk6oq1#
是的,您需要重新定义 prompt 以使用 Property Graph Index 分析中文文本。可以通过自定义
TextToCypherRetriever
类中的text_to_cypher_template
参数来处理不同的语言,包括中文。您可以定义一个适用于中文文本的
text_to_cypher_template
1(https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/indices/property_graph/sub_retrievers/text_to_cypher.py)。