2

markdown-crawler:一个多线程Python网络爬虫

 1 year ago
source link: https://www.jdon.com/71817.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

markdown-crawler:一个多线程Python网络爬虫 - 极道

这是一个多线程网络爬虫,可以爬行网站并为每个页面创建 markdown 文件。它主要是为大型语言模型文档解析而创建的,以简化 RAG 用例的大型文档的分块和处理。Markdown 本质上是人类可读的,并保持文档结构,同时保持较小的占用空间。

  • 多线程支持以加快爬行速度
  •  从上次停下的地方继续抓
  •  设置您想要爬行的子项的最大深度
  •  支持表格、图像等。
  •  验证 URL、HTML、文件路径
  • 配置有效基本路径或基本域的列表
  • 使用BeautifulSoup解析HTML
  •  详细日志记录选项
  •  即用型 CLI 界面

用例场景:

  • RAG(检索增强生成)-我的主要用例,用它来标准化大型文档和按标题、段落或句子的块
  • LLM 微调 - 作为第一步创建大型 Markdown 文件语料库,并利用gpt-3.5-turbo或Mistral-7B提取问答对
  • 代理知识 - 将其与autogen结合用于专家代理,例如,如果您希望重建视频游戏或电影的知识语料库,请使用它来生成给定的专家语料库
  • 代理/LLM 工具 - 使用它进行在线 RAG 学习,以便您的聊天机器人继续学习。使用 SERP 并通过 markdown-crawler 抓取 + 索引前 N 个结果

安装包
pip install markdown-crawler

执行 CLI
markdown-crawler -t 5 -d 3 -b ./markdown https://en.wikipedia.org/wiki/Morty_Smith

  • Python 3.x
  • BeautifulSoup4
  • requests
  • markdownify

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK