未加星标

TagOverflow―Correlating Tags in Stackoverflow

字体大小 | |
[数据库(综合) 所属分类 数据库(综合) | 发布者 店小二05 | 时间 2018 | 作者 红领巾 ] 0人收藏点击收藏

In this post I want to show how to use the Jaccard procedure in the Neo4j-Graph-Algorithms library to achieve that. We imported the whole dump of StackOverflow into Neo4j, ran the algorithms and then visualized the results using Neo4j Browser and the large graph visualization tool Graphistry.

In September we had the opportunity of running the GraphConnect “Buzzword-Bingo” GraphHack in the offices of StackOverflow in New York which was really cool. I was impressed that the folks there really went through with what Joel Spolsky published many years ago as a better office layout for software companies (and probably other companies too). Lots of open space and rooms to discuss but a private, hexagon, glass-walled office for every team member, an individualized thinking and working place.


TagOverflow―Correlating Tags in Stackoverflow
Invidual offices at StackOverflow
TagOverflow―Correlating Tags in Stackoverflow
The “StackExchange-Wall”

For the hackathon we chose the project and team name “TagOverflow” .

Data Model andImport

The StackOverflow data model is pretty straightforward, Users posting Questions and Answers , one of which is accepted . Each question is also tagged with one or more Tags .


TagOverflow―Correlating Tags in Stackoverflow
Simple StackOverflow GraphModel

For the import we:

downloaded the StackOverflow dump from the internet archive extracted it using 7zip converted the XML files we’re interested in into CSV’s for nodes and relationships import the data using the Neo4j bulk importer in a few minutes create some indexes and constraints in another few minutes

Then the Neo4j Graph Database of StackOverflow was ready to be used.

The import steps are all documented in the GitHub repository , we already covered the process a while ago at the 10M question celebration .

Our test instance is currently available as a Neo4j Cloud instance:

https://1cec42ea.databases.neo4j.io/browser/ with user “stackoverflow” password “stackoverflow”

for a read-only user.

Data Exploration

We used Google’s Colab Notebooks to work within the Hackathon team which worked really well. It’s like Google docs for python Notebooks, i.e. you have customizable sharing settings and everyone can edit and run cells from their own computer. Thanks to Leo from Graphistry for reminding me of that really cool tool.

We connected to Neo4j using the py2neo library which builds upon the Neo4j Python driver and has some nice support for Pandas and Numpy.

graph = Graph("bolt://1cec42ea.databases.neo4j.io", auth=("stackoverflow", "stackoverflow"),secure=True)

For data exploration we first ran a query that showed how much data of each type we had in our graph.

result = {"label": [], "count": []} for label in graph.run("CALL db.labels()").to_series(): query = f"MATCH (:`{label}`) RETURN count(*) as count" count = graph.run(query).to_data_frame().iloc[0]['count'] result["label"].append(label) result["count"].append(count) nodes_df = pd.DataFrame(data=result) nodes_df.sort_values("count")

本文数据库(综合)相关术语:系统安全软件

分页:12
转载请注明
本文标题:TagOverflow―Correlating Tags in Stackoverflow
本站链接:https://www.codesec.net/view/620811.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(综合) | 评论(0) | 阅读(13)