This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlwt | |
import random | |
import demo_night | |
ROOT_PATH = r"C:\Users\t-midu\PycharmProjects\Scenario_detecter" | |
RESOURCE_PATH = os.path.join(ROOT_PATH, "resource") | |
file_path = os.path.join(RESOURCE_PATH, "stories.json.txt") | |
# Crating a new sheet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os # Get system method | |
import shutil # Recursive traversing file path | |
import tensorflow as tf # Neural Network2 | |
import numpy as np # Matrix Computing | |
from skimage.io import imsave # Image operation | |
from tensorflow.examples.tutorials.mnist import input_data | |
data = input_data.read_data_sets('MNIST_data/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
“不许动,在动我们就开枪了!”一名尉官模样持枪大喝道。 | |
“刷刷刷”周围的几十名士兵此刻也是拉动的手中的枪栓,打开了保险,枪头此刻也是瞄准着唐铭。 | |
唐铭闯入了军区之中,军区中的警报四响,无数的士兵更是纷纷拿起的枪支准备迎敌。唐铭一路快速的轻功赶路正好在此处遇见了收到了警报的士兵。 | |
“指挥部,我三连四排在***地点发现可疑人员,请求指示。。。。”尉官也是急忙的对着胸口前的对讲上报情况。 | |
唐铭没有理会士兵的警告,更是不急不缓的继续的向前走去。 | |
“啪”枪响了,一发子弹从枪**击而出,打在了唐铭脚前的地面上,露出了一个冒着白烟的深洞。 | |
“不许动,再敢动一步,信不信我一枪杀了你。”尉官手中的枪口更是向上抬了一台,警告道。 | |
唐铭停了一步,随即又仿佛没看到一般,再次的向前走去。 | |
“啪”又是一枪响起,这一枪直奔唐铭的膝盖而去,军队的规矩是第一次鸣枪警告,警告无效第二次便是直接开枪击毙,但这尉官见唐铭手中并无武器和其他威胁,便是心软了一下,想要打中他的腿,制止他的行动。 | |
“啪”的一声,子弹打空的,打在的地面之上,而唐铭此时却消失在了原地。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################# | |
Wanxiang Che, Zhenghua Li, Ting Liu. | |
LTP: A Chinese Language Technology Platform. | |
In Proceedings of the Coling 2010:Demonstrations. 2010.08, pp13-16, Beijing, China. | |
############################# | |
import requests | |
def fetch(sentence): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
import pandas as pd | |
from bert_serving.client import BertClient | |
from keras.layers import Conv1D | |
from keras.layers import Dense, Activation, Dropout, Flatten, AveragePooling1D | |
from keras.models import Sequential | |
from keras.optimizers import RMSprop | |
from keras.utils import np_utils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cut_sent(para): | |
para = para.replace(u'\u3000', '') | |
para = re.sub('([。!?\?])([^”’])', r"\1\n\2", para) # 单字符断句符 | |
para = re.sub('(\.{6})([^”’])', r"\1\n\2", para) # 英文省略号 | |
para = re.sub('(\…{2})([^”’])', r"\1\n\2", para) # 中文省略号 | |
para = re.sub('([。!?\?][”’])([^,。!?\?])', r'\1\n\2', para) | |
para = para.rstrip() | |
return [sentence for sentence in para.split("\n") if sentence] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import gensim | |
import numpy as np | |
from keras.layers import Dense, Activation, Dropout | |
from keras.models import Sequential | |
from keras.optimizers import RMSprop | |
from keras.utils import np_utils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -H pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com ipython | |
pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com ipython |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open("FILE_NAME", MODE, encoding="utf-8") as file_fd: | |
for item in file_fd.readlines(): | |
print(item) |
NewerOlder