当前位置: 首页 > news >正文

零食网站建设描述书wordpress中英切换

零食网站建设描述书,wordpress中英切换,河南外贸网站制作,给你网站你会怎么做的GraphRAG的介绍 目前微软已经开源了GraphRAG的完整项目代码。对于某一些LLM的下游任务则可以使用GraphRAG去增强自己业务的RAG的表现。项目给出了两种使用方式#xff1a; 在打包好的项目状态下运行#xff0c;可进行尝试使用。在源码基础上运行#xff0c;适合为了下游任…GraphRAG的介绍 目前微软已经开源了GraphRAG的完整项目代码。对于某一些LLM的下游任务则可以使用GraphRAG去增强自己业务的RAG的表现。项目给出了两种使用方式 在打包好的项目状态下运行可进行尝试使用。在源码基础上运行适合为了下游任务的微调时使用。 如果需要利用Ollama部署本地大模型的可以参考我的另一篇博客 以下在通过自身的实践之后的给出对这两种方式的使用教程如果还有什么问题在评论区交流。 一、在源码基础上运行便于后续修改 1. 准备环境在终端运行 1创建虚拟环境已安装好anaconda此处建议使用python3.11: conda create -n GraphRAG python3.11 conda activate GraphRAG2. 下载源码并进入目录 git clone https://github.com/microsoft/graphrag.git cd graphrag3. 下载依赖并初始化项目 (1)安装poetry资源包管理工具及相关依赖 pip install poetry poetry install2初始化 poetry run poe index --init --root . 正确运行后此处会在graphrag目录下生成output、prompts、.env、settings.yaml文件 4. 下载并将待检索的文档document放入./input/目录下 mkdir ./input curl https://www.xxx.com/xxx.txt ./input/book.txt #示例可以替换为任何的txt文件5.修改相关配置文件 1修改.env文件默认是隐藏的中的api_key vi .env #进入.env文件并修改为自己的api_key修改后是全局配置后续不需要再次修改了 2修改settings.yaml文件修改其中的使用的llm模型和对应的api_base 提前说明因为GraphRAG需要多次调用大模型和Embedding默认使用的是openai的GPT-4,花费及其昂贵土豪当我没说配置也不需要改 建议大家可以使用其他模型或国产大模型的api 我这里使用的是agicto提供的APIkey(主要是新用户注册可以免费获取到10块钱的调用额度白嫖还是挺爽的)。我在这里主要就修改了API地址和调用模型的名称修改完成后的settings文件完整内容如下 代码行后有标记的为需要修改的地方如果用的是agicto则则不用修改settings.yaml encoding_model: cl100k_base skip_workflows: [] llm:api_key: ${GRAPHRAG_API_KEY}type: openai_chat # or azure_openai_chatmodel: deepseek-chat #修改model_supports_json: false # recommended if this is available for your model.api_base: https://api.agicto.cn/v1 #修改# max_tokens: 4000# request_timeout: 180.0# api_version: 2024-02-15-preview# organization: organization_id# deployment_name: azure_model_deployment_name# tokens_per_minute: 150_000 # set a leaky bucket throttle# requests_per_minute: 10_000 # set a leaky bucket throttle# max_retries: 10# max_retry_wait: 10.0# sleep_on_rate_limit_recommendation: true # whether to sleep when azure suggests wait-times# concurrent_requests: 25 # the number of parallel inflight requests that may be madeparallelization:stagger: 0.3# num_threads: 50 # the number of threads to use for parallel processingasync_mode: threaded # or asyncioembeddings:## parallelization: override the global parallelization settings for embeddingsasync_mode: threaded # or asynciollm:api_key: ${GRAPHRAG_API_KEY}type: openai_embedding # or azure_openai_embeddingmodel: text-embedding-3-small #修改api_base: https://api.agicto.cn/v1 #修改# api_base: https://instance.openai.azure.com# api_version: 2024-02-15-preview# organization: organization_id# deployment_name: azure_model_deployment_name# tokens_per_minute: 150_000 # set a leaky bucket throttle# requests_per_minute: 10_000 # set a leaky bucket throttle# max_retries: 10# max_retry_wait: 10.0# sleep_on_rate_limit_recommendation: true # whether to sleep when azure suggests wait-times# concurrent_requests: 25 # the number of parallel inflight requests that may be made# batch_size: 16 # the number of documents to send in a single request# batch_max_tokens: 8191 # the maximum number of tokens to send in a single request# target: required # or optionalchunks:size: 300overlap: 100group_by_columns: [id] # by default, we dont allow chunks to cross documentsinput:type: file # or blobfile_type: text # or csvbase_dir: inputfile_encoding: utf-8file_pattern: .*\\.txt$cache:type: file # or blobbase_dir: cache# connection_string: azure_blob_storage_connection_string# container_name: azure_blob_storage_container_namestorage:type: file # or blobbase_dir: output/${timestamp}/artifacts# connection_string: azure_blob_storage_connection_string# container_name: azure_blob_storage_container_namereporting:type: file # or console, blobbase_dir: output/${timestamp}/reports# connection_string: azure_blob_storage_connection_string# container_name: azure_blob_storage_container_nameentity_extraction:## llm: override the global llm settings for this task## parallelization: override the global parallelization settings for this task## async_mode: override the global async_mode settings for this taskprompt: prompts/entity_extraction.txtentity_types: [organization,person,geo,event]max_gleanings: 0summarize_descriptions:## llm: override the global llm settings for this task## parallelization: override the global parallelization settings for this task## async_mode: override the global async_mode settings for this taskprompt: prompts/summarize_descriptions.txtmax_length: 500claim_extraction:## llm: override the global llm settings for this task## parallelization: override the global parallelization settings for this task## async_mode: override the global async_mode settings for this task# enabled: trueprompt: prompts/claim_extraction.txtdescription: Any claims or facts that could be relevant to information discovery.max_gleanings: 0community_report:## llm: override the global llm settings for this task## parallelization: override the global parallelization settings for this task## async_mode: override the global async_mode settings for this taskprompt: prompts/community_report.txtmax_length: 2000max_input_length: 8000cluster_graph:max_cluster_size: 10embed_graph:enabled: false # if true, will generate node2vec embeddings for nodes# num_walks: 10# walk_length: 40# window_size: 2# iterations: 3# random_seed: 597832umap:enabled: false # if true, will generate UMAP embeddings for nodessnapshots:graphml: falseraw_entities: falsetop_level_nodes: falselocal_search:# text_unit_prop: 0.5# community_prop: 0.1# conversation_history_max_turns: 5# top_k_mapped_entities: 10# top_k_relationships: 10# max_tokens: 12000global_search:# max_tokens: 12000# data_max_tokens: 12000# map_max_tokens: 1000# reduce_max_tokens: 2000# concurrency: 326.构建GraphRAG的索引耗时较长取决于document的长度 poetry run poe index --root . 成功后如下 ⠋ GraphRAG Indexer ├── Loading Input (InputFileType.text) - 1 files loaded (0 filtered) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 0:00:00 ├── create_base_text_units ├── create_base_extracted_entities ├── create_summarized_entities ├── create_base_entity_graph ├── create_final_entities ├── create_final_nodes ├── create_final_communities ├── join_text_units_to_entity_ids ├── create_final_relationships ├── join_text_units_to_relationship_ids ├── create_final_community_reports ├── create_final_text_units ├── create_base_documents └── create_final_documentsAll workflows completed successfully.7.进行查询 此处GraphRAG提供了两种查询方式 1全局查询 更侧重全文理解 poetry run poe query --root . --method global 本文主要讲了什么 运行成功后可以看到输出结果 2局部查询更侧重细节 poetry run poe query --root . --method local 本文主要讲了什么 运行成功后可以看到输出结果 8. 总结 上述过程为已经验证过的如果报错可以检查是否正确配置api_key及api_base 二、在python包的基础上进行快速尝试 1. 环境安装 pip install graphrag2. 初始化项目 创建一个临时的文件夹graphrag用于存在运行时数据 mkdir ./graphrag/input curl https://www.xxx.com/xxx.txt ./myTest/input/book.txt // 这里是示例代码根据实际情况放入自己要测试的txt文本即可。 cd ./graphrag python -m graphrag.index --init3. 配置相关文件可参考上述的配置文件过程 4. 执行并构建图索引 python -m graphrag.index5.进行查询 1全局查询 python -m graphrag.query --root ../myTest --method global 这篇文章主要讲述了什么内容?2局部查询 python -m graphrag.query --root ../myTest --method local 这篇文章主要讲述了什么内容?总结 通过以上两种方式我们已经尝试了利用源码和python资源包进行配置GraphRAG的方式。大家可以按照自己的需求尝试以上两种方法。如果还有问题欢迎在评论区讨论
http://www.dnsts.com.cn/news/224476.html

相关文章:

  • 教育集团网站设计策划书网架公司需要给设计院提交的资料
  • 成都网站建设公司官网河源网站建设 科技
  • 北京网站建设飞沐蓬莱专业做网站公司
  • 电子商务网站建设和推广2022楼市最新消息
  • 免费建设微网站制作国际购物网站
  • 兰州网络营销网站公司网站介绍范文
  • 网站开发在线课程最近网站不收录
  • 做网站 赚广告费网站开发公司东莞
  • 网站维护与建设百度免费建个人网站
  • 网站开发客户需求繁昌网站建设
  • 网站建设基本流程是什么wordpress音频付费插件
  • 扬中网站哪家做得好做海报图片去哪个网站找 知乎
  • 网站首页的尺寸做多大58同城 网站建设 成都
  • 自适应网站举例贵阳网站制作专业
  • 网站设计基本要求网站设计要注意事项
  • 网站在排版有哪些方法淮北论坛网官网
  • 河南化工厂网站制作优化
  • 网站建设技术的实现怎么做公司网站
  • 如何查询网站建立时间工程技术
  • 怎样建立网站平台wordpress房地产
  • 湛江网站如何制作wordpress 调用子栏目
  • 广州网站开发水平广州亦客网络大庆网站建设
  • 个人网站毕业设计大前端最新网站
  • 制作网站要花多少钱如何东莞市企业网站建设平台
  • 访问国外网站很慢网站落地页如何做
  • 英文网站建设流程做网站需要看什么书
  • 兰州公司做网站安居客网官网入口
  • 网站优化描述设置唐山城乡建设网站
  • 购物网站主页怎么做wordpress应用教程 pdf
  • 广州网站建设 企业网站前期建设