Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
CSDN 统一标签设计
提交
1d7bbf98
C
CSDN 统一标签设计
项目概览
CSDN 技术社区
/
CSDN 统一标签设计
通知
1653
Star
104
Fork
104
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
9
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
4
Wiki
分析
仓库
DevOps
项目成员
Pages
C
CSDN 统一标签设计
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
9
Issue
9
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
4
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1d7bbf98
编写于
6月 07, 2021
作者:
F
feilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加带版本标签集
上级
5dd23caa
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
1389 addition
and
21 deletion
+1389
-21
doc/ai.md
doc/ai.md
+58
-0
src/dataset/infoq.tag.json
src/dataset/infoq.tag.json
+3
-0
src/tag_source/infoq.py
src/tag_source/infoq.py
+42
-21
versions/category_tag_v_1.0.json
versions/category_tag_v_1.0.json
+1286
-0
未找到文件。
doc/ai.md
0 → 100644
浏览文件 @
1d7bbf98
"图像处理",
"计算机视觉",
"自然语言处理",
"语音识别",
"机器翻译",
"机器学习",
"神经网络",
"深度学习",
"迁移学习",
"强化学习",
"集成学习",
"联邦学习",
"人机对话",
"知识图谱",
"图计算",
"情感分析",
"目标检测",
"目标跟踪",
"生成对抗网络",
"协同过滤",
"语言模型",
"智能推荐",
"tensorflow",
"pytorch",
"oneflow",
"opencv",
"keras",
"caffe",
"sklearn",
"mxnet",
"mlnet",
"mllib",
"paddlepaddle",
"jittor",
"deeplearning4j",
"mindspore",
"cnn",
"rnn",
"lstm",
"gru",
"dnn",
"mnn",
"alexnet",
"googlenet",
"deepfm",
"boosting",
"tensorrt",
"yolo",
"elmo",
"transformer",
"word2vec",
"doc2vec",
"glove",
"xlnet",
"bert",
"nnlm",
"lda主题模型",
"deepdive",
src/dataset/infoq.tag.json
0 → 100644
浏览文件 @
1d7bbf98
[
]
\ No newline at end of file
src/tag_source/infoq.py
浏览文件 @
1d7bbf98
...
...
@@ -11,42 +11,63 @@ from scrapy.settings import Settings
class
InfoQSpider
(
scrapy
.
Spider
):
name
=
"infoq_tags"
allowed_domains
=
[
"infoq.cn"
]
start_urls
=
[
'https://www.infoq.cn/
topics
'
]
start_urls
=
[
'https://www.infoq.cn/
public/v1/topic/getList
'
]
custom_settings
=
{
'ITEM_PIPELINES'
:{
'tag_source.infoq.TagPipeline'
:
301
},
'LOG_LEVEL'
:
'INFO'
'LOG_LEVEL'
:
'INFO'
,
'COOKIES_ENABLED'
:
True
,
}
def
__init__
(
self
):
self
.
page_count
=
0
self
.
totgal_pages
=
654
def
start_requests
(
self
):
# 浏览器用户代理
headers
=
{
'User-Agent'
:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36 Edg/90.0.818.41'
}
# 指定cookies
cookies
=
{
'LF_ID'
:
'1596546004203-7769949-7289805'
,
'GRID'
:
'8ed2875-174b7fd-6ad9862-31c4b7f'
,
'SERVERID'
:
'3431a294a18c59fc8f5805662e2bd51e|1619058525|1619058010'
}
urls
=
[
'https://www.infoq.cn/public/v1/topic/getList'
]
for
url
in
urls
:
yield
scrapy
.
Request
(
url
=
url
,
headers
=
headers
,
cookies
=
cookies
,
callback
=
self
.
parse
)
def
parse
(
self
,
response
):
self
.
page_count
+=
1
print
(
response
.
body
)
tags
=
response
.
css
(
'.navigation-list'
)
print
(
tags
)
for
tag
in
tags
:
name
=
tag
.
xpath
(
'h2/a/text()'
).
get
()
desc
=
tag
.
xpath
(
'p/text()'
).
get
()
star
=
tag
.
xpath
(
'div/strong/text()'
).
get
()
with
open
(
'test.html'
,
'w'
)
as
f
:
f
.
write
(
response
.
text
)
# tags = response.css('li>div>.title')
# print(tags)
# for tag in tags:
# name = tag.xpath('h2/a/text()').get()
# desc = tag.xpath('p/text()').get()
# star = tag.xpath('div/strong/text()').get()
yield
{
'name'
:
name
,
'desc'
:
desc
,
'star'
:
star
}
#
yield {
#
'name': name,
#
'desc': desc,
#
'star': star
#
}
next_page_list
=
response
.
css
(
'.next'
)
if
len
(
next_page_list
)
>
0
:
next_page_item
=
next_page_list
[
len
(
next_page_list
)
-
1
]
next_page
=
next_page_item
.
css
(
'a::attr(href)'
).
get
()
print
(
'next_page:'
,
next_page
)
yield
response
.
follow
(
next_page
,
callback
=
self
.
parse
,
dont_filter
=
True
)
#
next_page_list = response.css('.next')
#
if len(next_page_list)>0:
#
next_page_item = next_page_list[len(next_page_list)-1]
#
next_page = next_page_item.css('a::attr(href)').get()
#
print('next_page:', next_page)
#
yield response.follow(next_page, callback=self.parse, dont_filter=True)
class
TagPipeline
(
object
):
def
open_spider
(
self
,
spider
):
self
.
file
=
open
(
'dataset/
segmentfault
.tag.json'
,
'w'
)
self
.
file
=
open
(
'dataset/
infoq
.tag.json'
,
'w'
)
self
.
file
.
write
(
'[
\n
'
)
self
.
count
=
0
self
.
tags
=
{}
...
...
versions/category_tag_v_1.0.json
0 → 100644
浏览文件 @
1d7bbf98
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录