fdfdtest


Namefdfdtest JSON
Version 1.7 PyPI version JSON
download
home_pagehttps://gitee.com/hustai/Fourth-Dimension
SummaryYantu tools for python
upload_time2023-11-09 06:40:47
maintainer
docs_urlNone
authoryantu-tech
requires_python>=3.8
licenseMIT License
keywords python yantu 中文
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 什么是第四维度?
Fourth-Dimension是言图科技提供的以Python语言编写的应用程序库,以实现对Yantu API便捷访问。它包括一个用于初始化的API资源的预定义类集,可以方便地访问Yantu API,以高效地使用言图私域知识库、言图文档问答等功能。此外,Fourth-Dimension还提供了一套本地部署方法。

## 产品特点
可在线使用Yantu API或本地部署专属知识库,自定义embedding和答案生成模型,根据自己的需求进行定制和优化。

## 主要功能
* 简单高效,用户只需配置专属密钥即可使用yantu API
* 高度定制化和数据安全的私域知识库
* 言图智能业务机器人
* 基于私域知识库的文档问答
* 简单易用的本地化部署流程

## 存储/检索方式
* elasticsearch
* faiss
* elasticsearch+Faiss

## 答案生成模型
* gpt-3.5-turbo-16k

## 版本说明
* Python 3.8
* Elasticsearch 7.17.7
* Faiss 1.7.4


## 如何安装
### 创建虚拟环境
确保存在可用的虚拟环境,若没有可根据以下命令进行创建
```
conda create --name 您的虚拟环境名 python=3.8
```

### 安装第四维度  
通过pip安装:
```
pip install Fourth-Dimension
```
或通过源码安装:
```
pip setup.py install
```


### 本地部署
#### Elasticsearch


#### BGE


## 配置文件说明
```text
{
  //文档文本存储方式
  "word_storage": "elasticsearch",
  //文档向量存储方式
  "embedding_storage": "faiss_process",
  //检索方式选择
  "search_select": "elasticsearch",
  //embedding模型
  "embedding_model": "bge-large-zh-v1.5",
  //答案生成模型
  "answer_generation_model": "gpt-3.5-turbo-16k",
  //文档划分设置
  "para_config": {
    //文档划分段落长度
    "chunk_size": 500,
    //文档划分重叠度
    "overlap": 20
  },
  //召回设置
  "recall_config": {
    //指定使用多少召回结果进行答案生成
    "top_k": 10
  },
  //Elasticsearch设置
  "elasticsearch_setting": {
    "host": "localhost",
    "port": 9200,
    //若存在安全认证,则填写用户名和密码
    "username": "",
    "password": "",
    //Elasticsearch分词器
    "analyzer": "standard"
  },
  //Faiss设置
  "faiss_setting": {
    //索引方式
    "retrieval_way": "IndexFlatL2"
  }
}
```

## 示例代码
```python
import fourth_dimension

answer = fourth_dimension.query("您的问题", '文档路径')
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitee.com/hustai/Fourth-Dimension",
    "name": "fdfdtest",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "python,yantu,\u4e2d\u6587",
    "author": "yantu-tech",
    "author_email": "GuoHuai Wu <wu466687121@qq.com>",
    "download_url": "https://files.pythonhosted.org/packages/5c/c6/38ec40efa5a463908ebe4e53fe8d1f34c8c7d7a273689aab2291356d6f85/fdfdtest-1.7.tar.gz",
    "platform": null,
    "description": "## \u4ec0\u4e48\u662f\u7b2c\u56db\u7ef4\u5ea6\uff1f\r\nFourth-Dimension\u662f\u8a00\u56fe\u79d1\u6280\u63d0\u4f9b\u7684\u4ee5Python\u8bed\u8a00\u7f16\u5199\u7684\u5e94\u7528\u7a0b\u5e8f\u5e93\uff0c\u4ee5\u5b9e\u73b0\u5bf9Yantu API\u4fbf\u6377\u8bbf\u95ee\u3002\u5b83\u5305\u62ec\u4e00\u4e2a\u7528\u4e8e\u521d\u59cb\u5316\u7684API\u8d44\u6e90\u7684\u9884\u5b9a\u4e49\u7c7b\u96c6\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8bbf\u95eeYantu API\uff0c\u4ee5\u9ad8\u6548\u5730\u4f7f\u7528\u8a00\u56fe\u79c1\u57df\u77e5\u8bc6\u5e93\u3001\u8a00\u56fe\u6587\u6863\u95ee\u7b54\u7b49\u529f\u80fd\u3002\u6b64\u5916\uff0cFourth-Dimension\u8fd8\u63d0\u4f9b\u4e86\u4e00\u5957\u672c\u5730\u90e8\u7f72\u65b9\u6cd5\u3002\r\n\r\n## \u4ea7\u54c1\u7279\u70b9\r\n\u53ef\u5728\u7ebf\u4f7f\u7528Yantu API\u6216\u672c\u5730\u90e8\u7f72\u4e13\u5c5e\u77e5\u8bc6\u5e93\uff0c\u81ea\u5b9a\u4e49embedding\u548c\u7b54\u6848\u751f\u6210\u6a21\u578b\uff0c\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u8fdb\u884c\u5b9a\u5236\u548c\u4f18\u5316\u3002\r\n\r\n## \u4e3b\u8981\u529f\u80fd\r\n* \u7b80\u5355\u9ad8\u6548\uff0c\u7528\u6237\u53ea\u9700\u914d\u7f6e\u4e13\u5c5e\u5bc6\u94a5\u5373\u53ef\u4f7f\u7528yantu API\r\n* \u9ad8\u5ea6\u5b9a\u5236\u5316\u548c\u6570\u636e\u5b89\u5168\u7684\u79c1\u57df\u77e5\u8bc6\u5e93\r\n* \u8a00\u56fe\u667a\u80fd\u4e1a\u52a1\u673a\u5668\u4eba\r\n* \u57fa\u4e8e\u79c1\u57df\u77e5\u8bc6\u5e93\u7684\u6587\u6863\u95ee\u7b54\r\n* \u7b80\u5355\u6613\u7528\u7684\u672c\u5730\u5316\u90e8\u7f72\u6d41\u7a0b\r\n\r\n## \u5b58\u50a8/\u68c0\u7d22\u65b9\u5f0f\r\n* elasticsearch\r\n* faiss\r\n* elasticsearch+Faiss\r\n\r\n## \u7b54\u6848\u751f\u6210\u6a21\u578b\r\n* gpt-3.5-turbo-16k\r\n\r\n## \u7248\u672c\u8bf4\u660e\r\n* Python 3.8\r\n* Elasticsearch 7.17.7\r\n* Faiss 1.7.4\r\n\r\n\r\n## \u5982\u4f55\u5b89\u88c5\r\n### \u521b\u5efa\u865a\u62df\u73af\u5883\r\n\u786e\u4fdd\u5b58\u5728\u53ef\u7528\u7684\u865a\u62df\u73af\u5883\uff0c\u82e5\u6ca1\u6709\u53ef\u6839\u636e\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u521b\u5efa\r\n```\r\nconda create --name \u60a8\u7684\u865a\u62df\u73af\u5883\u540d python=3.8\r\n```\r\n\r\n### \u5b89\u88c5\u7b2c\u56db\u7ef4\u5ea6  \r\n\u901a\u8fc7pip\u5b89\u88c5\uff1a\r\n```\r\npip install Fourth-Dimension\r\n```\r\n\u6216\u901a\u8fc7\u6e90\u7801\u5b89\u88c5\uff1a\r\n```\r\npip setup.py install\r\n```\r\n\r\n\r\n### \u672c\u5730\u90e8\u7f72\r\n#### Elasticsearch\r\n\r\n\r\n#### BGE\r\n\r\n\r\n## \u914d\u7f6e\u6587\u4ef6\u8bf4\u660e\r\n```text\r\n{\r\n  //\u6587\u6863\u6587\u672c\u5b58\u50a8\u65b9\u5f0f\r\n  \"word_storage\": \"elasticsearch\",\r\n  //\u6587\u6863\u5411\u91cf\u5b58\u50a8\u65b9\u5f0f\r\n  \"embedding_storage\": \"faiss_process\",\r\n  //\u68c0\u7d22\u65b9\u5f0f\u9009\u62e9\r\n  \"search_select\": \"elasticsearch\",\r\n  //embedding\u6a21\u578b\r\n  \"embedding_model\": \"bge-large-zh-v1.5\",\r\n  //\u7b54\u6848\u751f\u6210\u6a21\u578b\r\n  \"answer_generation_model\": \"gpt-3.5-turbo-16k\",\r\n  //\u6587\u6863\u5212\u5206\u8bbe\u7f6e\r\n  \"para_config\": {\r\n    //\u6587\u6863\u5212\u5206\u6bb5\u843d\u957f\u5ea6\r\n    \"chunk_size\": 500,\r\n    //\u6587\u6863\u5212\u5206\u91cd\u53e0\u5ea6\r\n    \"overlap\": 20\r\n  },\r\n  //\u53ec\u56de\u8bbe\u7f6e\r\n  \"recall_config\": {\r\n    //\u6307\u5b9a\u4f7f\u7528\u591a\u5c11\u53ec\u56de\u7ed3\u679c\u8fdb\u884c\u7b54\u6848\u751f\u6210\r\n    \"top_k\": 10\r\n  },\r\n  //Elasticsearch\u8bbe\u7f6e\r\n  \"elasticsearch_setting\": {\r\n    \"host\": \"localhost\",\r\n    \"port\": 9200,\r\n    //\u82e5\u5b58\u5728\u5b89\u5168\u8ba4\u8bc1\uff0c\u5219\u586b\u5199\u7528\u6237\u540d\u548c\u5bc6\u7801\r\n    \"username\": \"\",\r\n    \"password\": \"\",\r\n    //Elasticsearch\u5206\u8bcd\u5668\r\n    \"analyzer\": \"standard\"\r\n  },\r\n  //Faiss\u8bbe\u7f6e\r\n  \"faiss_setting\": {\r\n    //\u7d22\u5f15\u65b9\u5f0f\r\n    \"retrieval_way\": \"IndexFlatL2\"\r\n  }\r\n}\r\n```\r\n\r\n## \u793a\u4f8b\u4ee3\u7801\r\n```python\r\nimport fourth_dimension\r\n\r\nanswer = fourth_dimension.query(\"\u60a8\u7684\u95ee\u9898\", '\u6587\u6863\u8def\u5f84')\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Yantu tools for python",
    "version": "1.7",
    "project_urls": {
        "Homepage": "https://gitee.com/hustai/Fourth-Dimension"
    },
    "split_keywords": [
        "python",
        "yantu",
        "\u4e2d\u6587"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5cc638ec40efa5a463908ebe4e53fe8d1f34c8c7d7a273689aab2291356d6f85",
                "md5": "1d0a4ae4df31ae62b04e52178be7651a",
                "sha256": "409e469ae8662c05533fedcb8ecc57fde1215c0de765f5c9db668cb51b834414"
            },
            "downloads": -1,
            "filename": "fdfdtest-1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "1d0a4ae4df31ae62b04e52178be7651a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 17626,
            "upload_time": "2023-11-09T06:40:47",
            "upload_time_iso_8601": "2023-11-09T06:40:47.593869Z",
            "url": "https://files.pythonhosted.org/packages/5c/c6/38ec40efa5a463908ebe4e53fe8d1f34c8c7d7a273689aab2291356d6f85/fdfdtest-1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-09 06:40:47",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "fdfdtest"
}
        
Elapsed time: 1.29774s