1 Star 0 Fork 0

chenzhenguo / aca

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

运行说明

概述

本代码是微软-清华开放学术精准画像大赛的解决方案,我们团队是这次比赛的初赛No.4,决赛No.2。
整理后的可执行代码在code文件夹,其他的文件可以无视了喵。
This repo is the No.2 solution to Open Academic Data Challenge 2017.
Clean code in the code folder, please ignore other files.

Task1:

task1程序,使用python3,入口是final_1.py文件,但是由于爬虫的不稳定性,比赛中还用到了其他代码,下面会有所说明。

  • final_1.py 程序入口
  • crawler.py 爬虫模块,负责三部分,爬取搜索页面,爬取(认定的)主页并存储,爬取网页上的图片并存储
  • data_io.py 数据读取输出模块
  • utility.py 一些小工具,包括识别email的正则表达式,以及email图片的过滤器,这里设置email图片的代码没有写进final_1.py
  • pagehome.py 判断用户主页的模块,这里用到的xgb模型存储在./model/good_model.dat
  • loc_pos.py 判断用户location 和position的模块
  • first.py 包含判断email,生成答案文件等函数

./final/文件夹存储爬取到的主页html,./head/文件夹存储头像图片数据。./output/存储中间暂存以及最终的结果task1_ans.txt 对于学者的多项属性,我们实现了不同的方法,为了尽可能提高分数,会对这些进行加权模型融合,但是考虑到效率问题,不推荐这么做。

Task2:

环境要求:

  1. python 2.7
  2. gensim
  3. Networkx

原始文件需放在 ./raw_data 文件夹下,包含以下文件: (注:因 papers.txt 文件较大,没有放在文件夹中,请自行添加。) raw_data:

  1. papers.txt
  2. training.txt
  3. task2_test_final.txt
  4. labels.txt

运行顺序:

  1. python create_file.py
  2. python create_citenet.py
  3. python expand_paper.py
  4. python expand_author_press.py
  5. python task2_main.py

程序结果: 最终结果在task2_out里面,

Task3:

  1. Python 版本:2.7.13
  2. Python package: sci-learn, numpy, scipy, random, csv, pickle。均为截至2017年10月8号的最新版。task3相关代码:task3.py,ILearner.py,Paper.py
  3. 保证代码所在路径下有./data/task3/文件夹,同时,在task3文件夹中应有任务3的训练集train.csv、验证集validation.csv、训练集test.csv以及数据集papers.txt。考虑到papers.txt文件过大,不适宜放在邮件附件中,所以还请手动复制到相应目录。
  4. 运行:在代码所在路径,执行python task3.py命令。
  5. 结果:在上述task3文件夹中,output3_validation.txt是任务三的验证集输出;output3_final.txt是任务三的测试集输出。
MIT License Copyright (c) 2018 lunar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

2017开放学术精准画像大赛 第二名解题方案 No.2 solution of Open Academic Data Challenge 2017 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/chenzhenguo/aca.git
git@gitee.com:chenzhenguo/aca.git
chenzhenguo
aca
aca
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891