意想不到,用word2vec解读延禧攻略人物关系

2019-10-04 00:10栏目:专项工作
TAG:

图片 1用word2vec解读延禧战略人物关系

缘何采纳Gitee实际不是GitHub

现阶段境内访谈GitHub速度慢,还恐怕被墙,所以Gitee来塑造个人博客。Gitee类似国内版的GitHub,访谈速度有担保。

眼前,不知本人是太忙了,依然尚未观念,未有灵感,写出的文字干干Baba,毫无心思来说。在冬至的字典里,从未想过有那么一天,词穷了,写不出文字。可是,不知为啥,前段时间时时为找话题而搜索枯肠,实在不知该怎么下笔,又该怎么动手。细细想来,神不知鬼不觉本身还是当了16年码农。

初稿来自大伙儿号 无界社区mixlab 链接如下:

情形需求

  • Git
  • NodeJs默许你早就安装了Git和NodeJS

从小学三年级起,蒙受了第三个跟班级走3年的班CEO,也正是大家的语文先生,要是还是不是他教大家,作者信赖自个儿一定不会养成一周写5篇作文的好习惯。初仲春高级中学,相当于因为创作占分比例非常的大,老师须求我们要每十二十七日写读书笔记。为此,境遇肩负认的语文先生,只要大家认真去写,他就能够很认真的帮我们批批、改改、画画。

一. 语言材质筹划
  • 延禧战术剧本
  • 延禧战略小说
  • 剧中人物名称

发轫搭建

打开 shell 终端,输入命令`npm install -g hexo`

$ sudo cnpm install -g hexoPassword:Downloading hexo to /usr/local/lib/node_modules/hexo_tmpCopying /usr/local/lib/node_modules/hexo_tmp/_hexo@3.7.1@hexo to /usr/local/lib/node_modules/hexoInstalling hexo's dependencies to /usr/local/lib/node_modules/hexo/node_modules[1/27] abbrev@^1.0.7 installed at node_modules/_abbrev@1.1.1@abbrev[2/27] archy@^1.0.0 installed at node_modules/_archy@1.0.0@archy[3/27] hexo-i18n@^0.2.1 installed at node_modules/_hexo-i18n@0.2.1@hexo-i18n[4/27] js-yaml@^3.6.1 existed at node_modules/_js-yaml@3.12.0@js-yaml[5/27] bluebird@^3.4.0 installed at node_modules/_bluebird@3.5.1@bluebird[6/27] chalk@^2.3.1 installed at node_modules/_chalk@2.4.1@chalk[7/27] hexo-front-matter@^0.2.2 installed at node_modules/_hexo-front-matter@0.2.3@hexo-front-matter[8/27] minimatch@^3.0.4 installed at node_modules/_minimatch@3.0.4@minimatch[9/27] pretty-hrtime@^1.0.2 installed at node_modules/_pretty-hrtime@1.0.3@pretty-hrtime[10/27] hexo-util@^0.6.3 installed at node_modules/_hexo-util@0.6.3@hexo-util[11/27] hexo-cli@^1.1.0 installed at node_modules/_hexo-cli@1.1.0@hexo-cli[12/27] resolve@^1.5.0 installed at node_modules/_resolve@1.8.1@resolve[13/27] strip-indent@^2.0.0 installed at node_modules/_strip-indent@2.0.0@strip-indent[14/27] strip-ansi@^4.0.0 installed at node_modules/_strip-ansi@4.0.0@strip-ansi[15/27] text-table@^0.2.0 installed at node_modules/_text-table@0.2.0@text-table[16/27] tildify@^1.2.0 existed at node_modules/_tildify@1.2.0@tildify[17/27] titlecase@^1.1.2 installed at node_modules/_titlecase@1.1.2@titlecase[18/27] moment@^2.19.4 installed at node_modules/_moment@2.22.2@moment[19/27] moment-timezone@^0.5.14 installed at node_modules/_moment-timezone@0.5.21@moment-timezone[20/27] hexo-log@^0.2.0 installed at node_modules/_hexo-log@0.2.0@hexo-log[21/27] swig-extras@0.0.1 installed at node_modules/_swig-extras@0.0.1@swig-extras[22/27] lodash@^4.17.5 installed at node_modules/_lodash@4.17.10@lodash[23/27] cheerio@0.22.0 installed at node_modules/_cheerio@0.22.0@cheeriofsevents@1.2.4 download from binary mirror: {"module_name":"fse","module_path":"./lib/binding/{configuration}/{node_abi}-{platform}-{arch}/","remote_path":"./v{version}/","package_name":"{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz","host":"https://cdn.npm.taobao.org/dist/fsevents"}[24/27] nunjucks@^3.1.2 installed at node_modules/_nunjucks@3.1.3@nunjucks[25/27] swig-templates@^2.0.2 installed at node_modules/_swig-templates@2.0.2@swig-templates[26/27] hexo-fs@^0.2.0 installed at node_modules/_hexo-fs@0.2.3@hexo-fs[27/27] warehouse@^2.2.0 installed at node_modules/_warehouse@2.2.0@warehouseexecute post install 2 scripts...[1/2] scripts.postinstall nunjucks@^3.1.2 run "node postinstall-build.js src"[1/2] scripts.postinstall nunjucks@^3.1.2 finished in 109ms[2/2] scripts.install hexo-fs@0.2.3 › chokidar@1.7.0 › fsevents@^1.0.0 run "node install"[fsevents] Success: "/usr/local/lib/node_modules/hexo/node_modules/_fsevents@1.2.4@fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installedPass --update-binary to reinstall or --build-from-source to recompile[2/2] scripts.install hexo-fs@0.2.3 › chokidar@1.7.0 › fsevents@^1.0.0 finished in 306msdeprecate titlecase@^1.1.2 no longer maintainedRecently updated (since 2018-08-01): 1 packages (detail see file /usr/local/lib/node_modules/hexo/node_modules/.recently_updates.txt) 2018-08-06 → resolve@1.8.1 › path-parse@^1.0.5 All packages installed (280 packages installed from npm registry, used 4s, speed 1.65MB/s, json 236, tarball 5.8MB)[hexo@3.7.1] link /usr/local/bin/hexo@ -> /usr/local/lib/node_modules/hexo/bin/hexo

注:假设提醒权限错误,命令前加sudo,cnpm 是Taobao的开源镜像,本国访谈比npm快。

在您的微型Computer上开创Hexo文本夹,在shell终端中切换来Hexo目录,输入命令 hexo init

$ cd /work/Hexo /work/Hexo $ hexo initINFO Cloning hexo-starter to /work/HexoCloning into '/work/Hexo'...remote: Counting objects: 65, done.remote: Total 65 , reused 0 , pack-reused 65Unpacking objects: 100% , done.Submodule 'themes/landscape' (https://github.com/hexojs/hexo-theme-landscape.git) registered for path 'themes/landscape'Cloning into '/work/Hexo/themes/landscape'...^Cwarning: Clone succeeded, but checkout failed.You can inspect what was checked out with 'git status'and retry the checkout with 'git checkout -f HEAD'INFO See you again

初叶化实现后Hexo的目录结构:

图片 2伊始化后目录结构

在shell中输入指令:git clone https://gitee.com/xiuxiuing/hexo-theme-even themes/even

/work/Hexo $ git clone https://gitee.com/xiuxiuing/hexo-theme-even themes/evenCloning into 'themes/even'...remote: Counting objects: 136, done.remote: Compressing objects: 100% , done.remote: Total 136 , reused 128 Receiving objects: 100% , 264.27 KiB | 556.00 KiB/s, done.Resolving deltas: 100% , done.

仿变成功后,在/Hexo/themes目录下,能够阅览 landscapeeven 四个文本夹。我们所要使用的主旨都以放在那么些目录下,Hexo默许使用的是landscape核心,由于第二步Hexo最先化时焦点未有clone成功,所以大家这一步克隆了even主旨,接下去会动用even主旨张开身先士卒。想得到更加的多宗旨,可在网址: 选取本人喜欢的大旨,根据此步的步骤clone下来。

_config.yml文件修改,保存

图片 3_config.yml

编写翻译项目,输入指令:hexo g运维项目,输入指令:hexo s

$ hexo gINFO Start processingINFO Files loaded in 186 msINFO Generated: archives/2018/08/index.htmlINFO Generated: archives/index.htmlINFO Generated: archives/2018/index.htmlINFO Generated: index.htmlINFO Generated: 2018/08/08/hello-world/index.htmlINFO 5 files generated in 242 ms$ hexo sINFO Start processingINFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

在浏览器中输入`

由来,作者都记得盖老师在读书笔记上写的怎样内容。杰出的语句,他用波浪线画出;语句毛病,他用直线标出并打问号;对于每篇的心体面会,他会在空白页记录。在非常时候,与其说自家欣赏写读书笔记,还不比说笔者更欣赏盖老师在每篇文章前边留下的解说。也便是因为语文先生的认真修改,笔者不独有的去写,高三参与了虎丘区读书笔记大赛,取得了一等奖的好战绩。

1.爬取延禧计策剧本

要赢得原始语料的通用办法正是使用爬虫本事对相应的内容举行爬取,由于这一次爬取的剧情比较轻松,没有要求考虑网站去重、增量爬取等比较难的难题,因而尚未须要选拔scrapy 这种重量级的工具,直接用 request + BeautifulSoup 就能够应付了,代码如下:

# -*- coding: utf-8 -*-# Author:gaozhengjie# Blog:https://www.jianshu.com/u/02877dbc2662# E-mail:gaozhengj@foxmail.com# Python Version:3.6.1# Time:2018/8/29# Description:爬取延禧攻略剧本,并保存在本地import urllib.requestfrom bs4 import BeautifulSoup# 延禧攻略小说的URLurl = 'http://www.pingyaoji.com/yanqing/yxgljb/'res = urllib.request.urlopensoup = BeautifulSoup(res, "html.parser")character_list = soup.select[3]# 开始捕捉具体页面的信息content = ''for each_li in character_list.select: res = urllib.request.urlopen('http://www.pingyaoji.com' + each_li.get soup = BeautifulSoup(res, "html.parser") content = content + soup.select[0].getText()with open(u'延禧攻略剧本.txt', 'w', encoding='utf-8') as fp: fp.write

布局博客到Gitee上

到码云: 上申请登记账号,码云类似国内版的GitHub,所以操作分界面跟GitHub大致,多了一些国产化的事物,这里不做越来越多介绍了,本身钻探下。

图片 4创设项目

创制达成后,在品种中复制项目地址。

deploy: type: git repo: https://gitee.com/xiuxiuing/blog.git branch: master

注意:冒号前边确定要有空格,不然不能够科学识别。

输入指令npm install hexo-deployer-git --save 安装自动布置揭橥工具输入指令hexo clean && hexo g && hexo d 发表博客,第三遍发表要求在shell中输入账号和密码。

在类型的劳务中选取Pages选项

图片 5Pages选择 master分支,点击 部署/更新图片 6配备稍等说话博客就宣布成功啦,访谈博客地址:

url: https://xiuxiuing.gitee.io/blog/root: /blog

再实行命令hexo clean && hexo g && hexo d 就足以啦。

于今,我们的博客就搭建完毕啦!!!在/Hexo/source/_posts目录下就能够写大家的博客啦!!!

民用博客效果参照他事他说加以考察:

进去高校,笔者无缘无故的从文科生转到了理工,高校课堂再也从未文科的读读写写,所以,依据个人兴趣,笔者参预了采访者团编辑部小干事的挑选,自然不用压力的胜利过关。常常参预学校活动,在官方网址发布新闻稿,之后参与长江新媒体音讯写作,成功被评为“辽宁省大学生全媒体十佳新闻报道工作者”称号。也正是因为那样,纵然在理工也绝非落下文字书写。

版权声明:本文由ag真人发布于专项工作,转载请注明出处:意想不到,用word2vec解读延禧攻略人物关系