Skip to content

Commit 16b1b10

Browse files
author
xuming06
committed
add demo.
1 parent 1a6c889 commit 16b1b10

5 files changed

Lines changed: 77 additions & 1 deletion

File tree

tool/compare_each_in_set.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
@author:XuMing([email protected])
4+
@description:
5+
"""
6+
7+
8+
def get_pairs(input_lst):
9+
out_lst = []
10+
for i in range(len(input_lst)):
11+
m = input_lst[i]
12+
for j in range(i, len(input_lst)):
13+
n = input_lst[j]
14+
if m == n: continue
15+
out_lst.append([m, n])
16+
return out_lst
17+
18+
19+
lst = ['a','b']
20+
print(get_pairs(lst))

tool/fake.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ def check_RateRule(rule_set, source_str):
199199

200200

201201
def main():
202-
# 执行凤巢数据检测
203202
# wordseg_agent = wordseg_init()
204203
rule_set1 = load_comb_rule_vocabs("./data/Inputdata/jjy.rule.txt") # 规则库1,金融教育医疗行业,gb18030格式,转为unicode
205204
rule_set2 = load_comb_rule_vocabs("./data/Inputdata/quanhangye.rule.txt") # 规则库3,其他行业,gb18030格式,转为unicode

tool/parrots_demo.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
@author:XuMing([email protected])
4+
@description:
5+
"""
6+
import parrots
7+
8+
print(parrots.speak('给老人让坐'))
9+

tool/pycorrector_demo.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
@author:XuMing([email protected])
4+
@description:
5+
"""
6+
import pycorrector
7+
8+
print(pycorrector.correct('给老人让坐'))
9+

tool/rocket_demo.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
@author:XuMing([email protected])
4+
@description:
5+
"""
6+
import base64
7+
import os
8+
import time
9+
10+
import numpy as np
11+
import tensorflow as tf
12+
from keras.layers import Conv2D, UpSampling2D, InputLayer
13+
from keras.models import Sequential
14+
from keras.preprocessing.image import img_to_array, load_img
15+
from skimage.color import rgb2lab, lab2rgb
16+
from skimage.io import imsave
17+
18+
19+
def build_model():
20+
model = Sequential()
21+
model.add(InputLayer(input_shape=(None, None, 1)))
22+
model.add(Conv2D(8, (3, 3), activation='relu', padding='same', strides=2))
23+
model.add(Conv2D(8, (3, 3), activation='relu', padding='same'))
24+
model.add(Conv2D(16, (3, 3), activation='relu', padding='same'))
25+
model.add(Conv2D(16, (3, 3), activation='relu', padding='same', strides=2))
26+
model.add(Conv2D(32, (3, 3), activation='relu', padding='same'))
27+
model.add(Conv2D(32, (3, 3), activation='relu', padding='same', strides=2))
28+
model.add(UpSampling2D((2, 2)))
29+
model.add(Conv2D(32, (3, 3), activation='relu', padding='same'))
30+
model.add(UpSampling2D((2, 2)))
31+
model.add(Conv2D(16, (3, 3), activation='relu', padding='same'))
32+
model.add(UpSampling2D((2, 2)))
33+
model.add(Conv2D(2, (3, 3), activation='tanh', padding='same'))
34+
model.compile(optimizer='adam', loss='mse')
35+
return model
36+
37+
build_model()
38+
39+

0 commit comments

Comments
 (0)