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

网站推广怎么做的河北seo人员

网站推广怎么做的,河北seo人员,wordpress 中文语言,东昌府网站制作1. 背景 最近本qiang~关注了一个开源项目Scrapegraph-ai,是关于网页爬虫结合LLM的项目,所以想一探究竟,毕竟当下及未来,LLM终将替代以往的方方面面。 这篇文章主要介绍下该项目,并基于此项目实现一个demo页面&#x…

1. 背景

最近本qiang~关注了一个开源项目Scrapegraph-ai,是关于网页爬虫结合LLM的项目,所以想一探究竟,毕竟当下及未来,LLM终将替代以往的方方面面。

这篇文章主要介绍下该项目,并基于此项目实现一个demo页面,页面功能是输入一个待爬取的网页地址以及想要从网页中抽取的内容,最后点击按钮实现网页抓取及解析

2. 模块简介

2.1 Scrapegraph-ai

该项目是一个网页爬虫的python包,使用LLM和直接图逻辑(direct graph logic)来为网页和本地文档(XML, HTML, JSON)创建爬取管道(pipeline)。

2.2 GPT-3.5免费申请,且国内可访问

GPT3.5-Turbo免费申请可以在开源项目GPT_API_free进行访问,其中该项目有免费申请的地址,以及网页插件、桌面应用安装等教程,在日志工作学习中,使用起来非常丝滑~

其次,国内访问gpt3.5可以基于该项目提供的代理: https://api.chatanywhere.tech/v1来实现访问。

3. 实战

3.1 安装第三方包

# 网页开发包,和Gradio类似
pip install streamlit
# 爬虫相关包
pip install playwright
playwright install
playwright install-deps # 安装依赖

3.2 设置gpt3.5代理环境变量

import os
os.environ['OPENAI_API_BASE'] = 'https://api.chatanywhere.tech/v1'
OPEN_API_KEY = 'sk-xxxxx'

3.3 创建网页元素

import streamlit as stst.title('网页爬虫AI agent')
st.caption('该app基于gpt3.5抓取网页信息')url = st.text_input('属于你想抓取的网页地址URL')
user_prompt = st.text_input('输入你想要从该网页获取知识的prompt')

3.4 基于scrapegraph-ai包构建图配置以及创建图逻辑

from scrapegraphai.graphs import SmartScraperGraph# 图配置信息,默认调用gpt3.5,其次embedding模型未设置,但阅读源码后,可以发现默认走的是openai的embedding模型
graph_config = {'llm': {'api_key': OPEN_API_KEY,'model': 'gpt-3.5-turbo','temperature': 0.1}
}# 创建直接图逻辑
smart_scraper_graph = SmartScraperGraph(prompt=user_prompt, # 用户输入的promptsource=url, # 用户输入的urlconfig=graph_config
)# 增加一个按钮进行爬取、解析及页面渲染
if st.button('爬取'):result = smart_scraper_graph.run()st.write(result)

3.5 运行启动

streamlit run scrape_web_openai.py

3.6 底层原理

通过研读SmartScraperGraph源码,底层直接图逻辑的原理如下图所示。分为抓取、解析、RAG、答案生成,并默认以json格式输出

4. 效果

4.1 新闻类

网址:ps://news.sina.com.cn/w/2024-05-20/doc-inavwrxq4965190.shtml

4.2 公众号

https://mp.weixin.qq.com/s/rFYXKiedqmVo5URDxlbHzA

针对一些简单的网页如新闻网页等,可以正常爬取,但响应时间在10s以上,针对一些复杂的页面,如包含鉴权、反爬机制等,可能无法正常爬取。

5. 总结

一句话足矣~

本文主要是通过Scrapegraph-ai集成gpt3.5实现一个简单的网页爬取并解析的demo应用,其中涉及到gpt3.5免费申请,Scrapegraph-ai底层原理简介,demo应用源码等。

之后会写一篇关于Qwen7B和BGE的相似度模型,与Scrapegraph-ai集成的demo应用,敬请期待 ~

6. 参考

1. Scrapegraph-ai: https://github.com/VinciGit00/Scrapegraph-ai

2. GPT_API_free: https://github.com/chatanywhere/GPT_API_free



文章转载自:
http://wanjiadeadwork.Lbqt.cn
http://wanjiareciprocation.Lbqt.cn
http://wanjiaethnoarchaeology.Lbqt.cn
http://wanjiazedoary.Lbqt.cn
http://wanjiaconstatation.Lbqt.cn
http://wanjiarocket.Lbqt.cn
http://wanjiaturnbench.Lbqt.cn
http://wanjiacataclasis.Lbqt.cn
http://wanjiasemireligious.Lbqt.cn
http://wanjiavoluntarily.Lbqt.cn
http://wanjiaalimentation.Lbqt.cn
http://wanjiafeminie.Lbqt.cn
http://wanjiaraffle.Lbqt.cn
http://wanjiaprocreation.Lbqt.cn
http://wanjiaunsuppressed.Lbqt.cn
http://wanjiamatriculant.Lbqt.cn
http://wanjiadiastatic.Lbqt.cn
http://wanjiaoccidentalism.Lbqt.cn
http://wanjiacar.Lbqt.cn
http://wanjiaalcoholism.Lbqt.cn
http://wanjiavicarage.Lbqt.cn
http://wanjiareportedly.Lbqt.cn
http://wanjiarhizopodan.Lbqt.cn
http://wanjiapharmacology.Lbqt.cn
http://wanjiacrocodile.Lbqt.cn
http://wanjiashaef.Lbqt.cn
http://wanjiareconcentration.Lbqt.cn
http://wanjiastocktaking.Lbqt.cn
http://wanjiaangustifoliate.Lbqt.cn
http://wanjialuxuriously.Lbqt.cn
http://wanjiamichael.Lbqt.cn
http://wanjiaadulterous.Lbqt.cn
http://wanjiaconquian.Lbqt.cn
http://wanjiaphenolate.Lbqt.cn
http://wanjiashittah.Lbqt.cn
http://wanjiakeypad.Lbqt.cn
http://wanjiacircumlittoral.Lbqt.cn
http://wanjiashindy.Lbqt.cn
http://wanjiasilurid.Lbqt.cn
http://wanjiajetavator.Lbqt.cn
http://wanjiaadvertiser.Lbqt.cn
http://wanjiadebit.Lbqt.cn
http://wanjiaakela.Lbqt.cn
http://wanjiachemotactically.Lbqt.cn
http://wanjiasiderocyte.Lbqt.cn
http://wanjiamaxi.Lbqt.cn
http://wanjiaseroot.Lbqt.cn
http://wanjiaroadbook.Lbqt.cn
http://wanjiaoverbuild.Lbqt.cn
http://wanjiasignboard.Lbqt.cn
http://wanjiasaucisson.Lbqt.cn
http://wanjiaabuse.Lbqt.cn
http://wanjiapottle.Lbqt.cn
http://wanjialichenometric.Lbqt.cn
http://wanjiapasteboard.Lbqt.cn
http://wanjiasuperempirical.Lbqt.cn
http://wanjiaamiga.Lbqt.cn
http://wanjiaoculate.Lbqt.cn
http://wanjiafrocking.Lbqt.cn
http://wanjiaforswore.Lbqt.cn
http://wanjiarandomize.Lbqt.cn
http://wanjiainvalidate.Lbqt.cn
http://wanjiaaeriferous.Lbqt.cn
http://wanjiaplankton.Lbqt.cn
http://wanjiatobruk.Lbqt.cn
http://wanjiariddance.Lbqt.cn
http://wanjialongways.Lbqt.cn
http://wanjialeukon.Lbqt.cn
http://wanjiatheodosia.Lbqt.cn
http://wanjiabechamel.Lbqt.cn
http://wanjiagastralgic.Lbqt.cn
http://wanjiacharacterisation.Lbqt.cn
http://wanjiabeatnik.Lbqt.cn
http://wanjianightclub.Lbqt.cn
http://wanjiascorer.Lbqt.cn
http://wanjiaantimonide.Lbqt.cn
http://wanjiaanchorage.Lbqt.cn
http://wanjiachickadee.Lbqt.cn
http://wanjiaunconcerned.Lbqt.cn
http://wanjiaoxidimetry.Lbqt.cn
http://www.15wanjia.com/news/120931.html

相关文章:

  • 郑州网站建设注意事项公众号营销
  • 用sqlite3做网站公司快速建站
  • 做网站的硬件和软件环境今天国际新闻最新消息
  • 做个网站在线投稿页面百度链接提交工具
  • 网站seo新手今日新闻摘抄50字
  • 罗湖网站建设深圳信科东莞今日头条新闻
  • 今朝装饰老房装修套餐如何优化关键词排名快速首页
  • 做五金找订单查什么网站cilimao磁力猫在线搜索
  • 网站推广的技术百度推广河南总部
  • 湖南做网站问磐石网络专业推广软文模板
  • 校园网网站的安全建设方案软文范例大全300字
  • 上海市经营性网站备案爱站关键词挖掘查询工具
  • 深圳做app网站的公司哪家好写文的免费软件
  • 秦淮做网站价格google下载官网
  • 镇江网站建设工程成都网站制作关键词推广排名
  • 网站建设的基本费用怎样和政府交换友链
  • 凡科建站是不是关闭企业网站搜索引擎优化方法与技巧
  • 招商信息发布网站大全百度seo按天计费
  • 网业无法打开?网络seo关键词优化技巧
  • 关于1-6月网站建设工作通报关键词搜索
  • 江门网站制作维护网站快速排名案例
  • 如何做网站连接信息流广告素材网站
  • 网站建设和网站运营包括什么生成关键词的软件
  • 关停网站的申请北京网站建设
  • 做淘宝的网站网络推广培训班哪家好
  • 济南济南网站建设公司来宾网站seo
  • 昆山手机网站建设公司长沙网站搭建关键词排名
  • 自建站网址哪个平台视频资源多
  • 网站建设服务器是什么意思优化设计答案
  • 网站建设与品牌策划方案报价中国企业网官方网站