Doris 是一款功能强大的自然语言处理 (NLP) 工具,专门为数据查询和分析而设计。它能够将复杂的自然语言查询转化为高效的 SQL 语句,同时还能提供专业的数据分析服务,极大地提升了数据处理的效率和便捷性。
Doris 是一款专为数据查询和分析打造的自然语言处理工具,能将自然语言查询转化为 SQL 并提供数据分析服务。以下是快速上手的步骤:
# 克隆仓库
git clone https://github.com/your-repository.git
cd Doris
# 安装依赖项
pip install -r requirements.txt
# 启动服务
python start_server.py
# 克隆仓库
git clone https://github.com/your-repository.git
cd Doris
# 安装依赖项
pip install -r requirements.txt
# 启动服务
python start_server.py
# 配置数据库连接信息
configuresettings --database-settings
# 执行单表查询
doristool query "显示所有客户的联系信息"
# 执行跨表联合查询
doristool join-query "计算每个销售代表的季度销售额"
parse_query --query="显示2022年每位销售代表的总销售额"
find_similar_examples --query="显示2022年每位销售代表的总销售额"
generate_sql --query="显示2022年每位销售代表的总销售额"
exec_query --sql="SELECT SUM(sales) AS total_sales, representative_id FROM sales GROUP BY representative_id;"
analyze_query_result --resultsetId=123
编辑 config/database_config.json 文件:
{
"host": "localhost",
"port": 3306,
"user": "root",
"password": "your_password",
"databases": ["sales", "customer"]
}
编辑 config/logging_settings.json 文件:
{
"log_level": "INFO",
"log_file": "doris.log"
}
常见错误及解决方案:
欢迎通过提交问题或拉取请求为项目贡献力量。请参考 CONTRIBUTING.md 文件了解具体流程。
编辑 config/database_config.json 文件,可对数据库的连接信息进行配置,包括主机地址、端口、用户名、密码以及所使用的数据库列表。
{
"host": "localhost",
"port": 3306,
"user": "root",
"password": "your_password",
"databases": ["sales", "customer"]
}
编辑 config/logging_settings.json 文件,可对日志的级别和存储文件进行设置。
{
"log_level": "INFO",
"log_file": "doris.log"
}
在使用 Doris 过程中,可能会遇到一些常见错误,以下是相应的解决方案:
欢迎广大开发者为 Doris 项目贡献力量,可通过提交问题或拉取请求的方式参与。具体流程请参考 CONTRIBUTING.md 文件。
该项目遵循 MIT 许可证,具体内容如下:
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Doris 提供以下主要工具:
parse_query:解析自然语言查询find_similar_examples:获取相似查询示例generate_sql:生成优化 SQL 语句exec_query:执行 SQL 查询analyze_query_result:分析查询结果开始
|
v
接收自然语言查询
|
v
parse_query
|
v
find_similar_examples(可选)
|
v
generate_sql
|
v
exec_query
|
v
analyze_query_result
|
v
输出结果和分析报告
doristool query "显示所有客户的联系信息"
doristool join-query "计算每个销售代表的季度销售额"
from doris import DorisClient
client = DorisClient()
result = client.query("显示过去一年的订单总量")
print(result)
感谢使用 Doris!如需帮助,请随时联系维护团队。