<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.swarma.org/index.php?action=history&amp;feed=atom&amp;title=KnowledgeHierarchy</id>
	<title>KnowledgeHierarchy - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.swarma.org/index.php?action=history&amp;feed=atom&amp;title=KnowledgeHierarchy"/>
	<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=KnowledgeHierarchy&amp;action=history"/>
	<updated>2026-11-02T21:20:22Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.swarma.org/index.php?title=KnowledgeHierarchy&amp;diff=34761&amp;oldid=prev</id>
		<title>13944556914：/* References */</title>
		<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=KnowledgeHierarchy&amp;diff=34761&amp;oldid=prev"/>
		<updated>2024-05-21T07:50:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;References&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2024年5月21日 (二) 07:50的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l141&quot; &gt;第141行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第141行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;category&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;旧词条迁移&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Category&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;待润色&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>13944556914</name></author>
	</entry>
	<entry>
		<id>https://wiki.swarma.org/index.php?title=KnowledgeHierarchy&amp;diff=15287&amp;oldid=prev</id>
		<title>思无涯咿呀咿呀：创建页面，内容为“ =RQ: what is a good question=  ==Zhihu tag tree==  知乎数据抓取  https://github.com/7sDream/zhihu-oauth  https://www.zhihu.com/topic/19776749/organize/entire#…”</title>
		<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=KnowledgeHierarchy&amp;diff=15287&amp;oldid=prev"/>
		<updated>2020-10-15T07:59:45Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“ =RQ: what is a good question=  ==Zhihu tag tree==  知乎数据抓取  https://github.com/7sDream/zhihu-oauth  https://www.zhihu.com/topic/19776749/organize/entire#…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
=RQ: what is a good question=&lt;br /&gt;
&lt;br /&gt;
==Zhihu tag tree==&lt;br /&gt;
&lt;br /&gt;
知乎数据抓取  https://github.com/7sDream/zhihu-oauth&lt;br /&gt;
&lt;br /&gt;
https://www.zhihu.com/topic/19776749/organize/entire#anchor-children-topic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import pandas as pd&lt;br /&gt;
&lt;br /&gt;
# https://github.com/Lynxmac/zhihu_topic_tree/&lt;br /&gt;
with open('/Users/datalab/bigdata/zhihu_topic_tree.txt', 'r', encoding='gb18030') as f:&lt;br /&gt;
    lines = f.readlines()&lt;br /&gt;
&lt;br /&gt;
df_list = []&lt;br /&gt;
for index, line in enumerate(lines):&lt;br /&gt;
    a = line.rstrip().split('─')&lt;br /&gt;
    hierarchy = len(a[0])&lt;br /&gt;
    if index &amp;gt; 312482:&lt;br /&gt;
        hierarchy -= 1&lt;br /&gt;
    sign = a[0][-1]&lt;br /&gt;
    b = a[-1].split('_', maxsplit = 2)&lt;br /&gt;
    ids = b[0]&lt;br /&gt;
    name = '_'.join(b[1:])&lt;br /&gt;
    df_list.append([index, hierarchy, sign, ids, name, line])&lt;br /&gt;
&lt;br /&gt;
df = pd.DataFrame(df_list, columns = ['loc', 'hierarchy', 'sign', 'id', 'name', 'line'])&lt;br /&gt;
&lt;br /&gt;
# clean the hierarchy variable&lt;br /&gt;
new_hierarchy = []&lt;br /&gt;
for i in df.hierarchy:&lt;br /&gt;
    if i % 3 ==1:&lt;br /&gt;
        new_hierarchy.append(i)&lt;br /&gt;
    elif i%3 ==2:&lt;br /&gt;
        new_hierarchy.append(i-1)&lt;br /&gt;
    elif i%3 ==0:&lt;br /&gt;
        new_hierarchy.append(i-2)&lt;br /&gt;
        &lt;br /&gt;
df['new_hierarchy'] = new_hierarchy&lt;br /&gt;
df['good_hierarchy'] = [(i-1)/3 + 1 for i in new_hierarchy]&lt;br /&gt;
&lt;br /&gt;
# add missing id for level 1 topics&lt;br /&gt;
id_list = [(29855, 19778298, '「形而上」话题'), &lt;br /&gt;
 (178555,19560891,'产业'),&lt;br /&gt;
 (190122, 19618774, '学科'),&lt;br /&gt;
 (223661, 19778287, '实体'),&lt;br /&gt;
 (312482, 19778317,'生活、艺术、文化与活动')]&lt;br /&gt;
&lt;br /&gt;
for i in id_list:&lt;br /&gt;
    df['id'][i[0]] = i[1]&lt;br /&gt;
    df['name'][i[0]] = i[2]&lt;br /&gt;
&lt;br /&gt;
# delete wrong ids&lt;br /&gt;
error_id_index = []&lt;br /&gt;
for k, i in enumerate(df.id):&lt;br /&gt;
    try:&lt;br /&gt;
        j = int(i)&lt;br /&gt;
    except:&lt;br /&gt;
        error_id_index.append(k)&lt;br /&gt;
len(error_id_index)&lt;br /&gt;
&lt;br /&gt;
df = df.drop(error_id_index)&lt;br /&gt;
df['id'] = [int(i) for i in df.id]&lt;br /&gt;
&lt;br /&gt;
# construct network&lt;br /&gt;
# it takes around 3 hours&lt;br /&gt;
# search for the nearest high level neighbor and link together&lt;br /&gt;
&lt;br /&gt;
from flownetwork.flownetwork import flushPrint&lt;br /&gt;
&lt;br /&gt;
net = []&lt;br /&gt;
for i in df.index:&lt;br /&gt;
    if i%100 ==0:&lt;br /&gt;
        flushPrint(i)&lt;br /&gt;
    ids = df['id'][i]&lt;br /&gt;
    hierarchy = df['good_hierarchy'][i]&lt;br /&gt;
    loc = df['loc'][i]&lt;br /&gt;
    if hierarchy == 1:&lt;br /&gt;
        net.append(('root', ids))&lt;br /&gt;
    else:&lt;br /&gt;
        upper_hierarchy = hierarchy - 1&lt;br /&gt;
        upper_nodes = df[df['good_hierarchy'] == upper_hierarchy]&lt;br /&gt;
        upper_node_loc = [j for j in upper_nodes['loc'] if (loc - j) &amp;gt; 0][-1]&lt;br /&gt;
        upper_node_id = df['id'][df['loc'] == upper_node_loc]&lt;br /&gt;
        net.append(( int(upper_node_id), ids))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==StackOverflow tag network==&lt;br /&gt;
&lt;br /&gt;
StackOverflow using tags to organize raised questions, see the tags here: https://stackoverflow.com/tags&lt;br /&gt;
&lt;br /&gt;
Given a tag, such as javascript, you can see the tagged questions: https://stackoverflow.com/questions/tagged/javascript&lt;br /&gt;
&lt;br /&gt;
Note that, stackoverflow also demonstrates the related tags for a tag. For example, the javascript tag is related to &lt;br /&gt;
&lt;br /&gt;
'''Related Tags'''&lt;br /&gt;
&lt;br /&gt;
*       jquery × 518122&lt;br /&gt;
* 	html × 317264&lt;br /&gt;
* 	css × 146448&lt;br /&gt;
* 	angularjs × 116430&lt;br /&gt;
* 	php × 111251&lt;br /&gt;
* 	node.js × 92095&lt;br /&gt;
* 	ajax × 88493&lt;br /&gt;
* 	json × 58117&lt;br /&gt;
* 	html5 × 51808&lt;br /&gt;
* 	reactjs × 51308&lt;br /&gt;
* 	arrays × 49362&lt;br /&gt;
* 	asp.net × 31550&lt;br /&gt;
* 	regex × 28362&lt;br /&gt;
* 	twitter-bootstrap × 24516&lt;br /&gt;
* 	angular × 24174&lt;br /&gt;
* 	c# × 23339&lt;br /&gt;
* 	forms × 22346&lt;br /&gt;
* 	google-chrome × 21292&lt;br /&gt;
* 	d3.js × 21232&lt;br /&gt;
* 	dom × 19442&lt;br /&gt;
* 	google-maps × 18658&lt;br /&gt;
* 	typescript × 18244&lt;br /&gt;
* 	java × 17724&lt;br /&gt;
* 	canvas × 17054&lt;br /&gt;
* 	express × 16103&lt;br /&gt;
&lt;br /&gt;
==Quora==&lt;br /&gt;
&lt;br /&gt;
https://www.quora.com/topic/Computer-Science&lt;br /&gt;
&lt;br /&gt;
https://github.com/tapaswenipathak/pyQTopic/blob/master/qtopic/pyqtopics.py&lt;br /&gt;
&lt;br /&gt;
https://github.com/csu/quora-api&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
[[Category:所有人]]&lt;br /&gt;
[[Category:计算传播学]]&lt;br /&gt;
[[User:Wangchj04]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:旧词条迁移]]&lt;/div&gt;</summary>
		<author><name>思无涯咿呀咿呀</name></author>
	</entry>
</feed>