|
9 | 9 | # |
10 | 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
11 | 11 | # |
12 | | -# 本项目仅限于技术交流用途,包括所有开源部分,禁止用于任何商业用途 |
| 12 | +# 本项目仅限于技术交流用途,包括所有开源部分,禁止用于任何商业用途 |
| 13 | +# |
| 14 | +# In order to prevent the EssayKiller framework from being maliciously registered, used or |
| 15 | +# copied, we are using legal aid and strict copyright protection. |
| 16 | +# |
| 17 | +# If you have academic needs, please bring an individual or institution's academic research |
| 18 | +# statement and send an email to [email protected]. We are glad to help~ |
| 19 | +# |
| 20 | +# Thanks for understanding. |
13 | 21 | ##################################################################### |
14 | 22 |
|
15 | 23 |
|
16 | | - |
17 | | -# 使用搭载好的EssayKilelrBrain各个模块构造pipeline,端到端输出文本 |
18 | | -# 部分核心代码已加密,若要获取完整版本请附上个人/研究机构链接证明 |
19 | | - |
20 | | -from absl import app |
21 | | -from absl import flags |
22 | | -import collections |
23 | | -import tensorflow as tf |
24 | | -import sys |
25 | | -import requests |
26 | | -import numpy as np |
27 | | -import pandas as pd |
28 | | -import time |
29 | | -import random |
30 | | -import logging |
31 | | - |
32 | | -from AutoBrainBase import * |
33 | | -from RecognizaitonNetwork.text_detection_video import * |
34 | | -from RecognizaitonNetwork.crnn import * |
35 | | -from RecognizaitonNetwork.train import * |
36 | | -from LanguageNetwork.GPT2.scripts import * |
37 | | -from LanguageNetwork.BERT.models import * |
38 | | -from LanguageNetwork.BERT.utils import * |
39 | | -from ScoringNetwork.AutoFormatter import * |
40 | | -from ScoringNetwork import * |
41 | | - |
42 | | -from utils import * |
43 | | - |
44 | | -tf.logging.set_verbosity(tf.logging.ERROR) |
45 | | -tf.get_logger().setLevel('INFO') |
46 | | -tf.autograph.set_verbosity(1) |
47 | | - |
48 | | -FLAGS = flags.FLAGS |
49 | | -flags.DEFINE_string('gpu', None, 'comma separated list of GPU(s) to use.') |
50 | | - |
51 | | -result = [] |
52 | | - |
53 | | -class EssayKillerPipeline(AutoBrainBase): |
54 | | - """ |
55 | | - @params |
56 | | - input_feed: text input_feed |
57 | | - sequence_len: sequence length |
58 | | - ... |
59 | | - In order to prevent the EssayKiller framework from being maliciously registered, used or |
60 | | - copied, the pipeline core code and construction classes are temporarily not open-sourced |
61 | | -
|
62 | | - If you have academic needs, please bring an individual or institution's academic needs |
63 | | - statement and send an email to [email protected]. According to the stated information, |
64 | | - I will send the full version of the code and test data to the given mailbox. |
65 | | - |
66 | | - Thanks for understanding. |
67 | | -
|
68 | | - 为防止自动化写作框架被人恶意抢注、利用或复刻,pipeline核心代码与构造类暂不开源 |
69 | | - 若有学术需要,请带上个人或机构的学术需求陈述,发送邮件到[email protected] |
70 | | - 根据陈述信息,我将会发送完整版的代码与测试数据到给定的邮箱。 |
71 | | - |
72 | | - 感谢理解~ |
73 | | - """ |
74 | | - def __init__(): |
75 | | - self.config = FLAGS.config |
76 | | - pass |
77 | | - |
78 | | - def enable_textdetect(self): |
79 | | - ''' |
80 | | - 开启视频检测,从硬件输入端获取视频流文件 |
81 | | - 硬件配置:Logitech C930C |
82 | | - @params:video视频流输入端口 |
83 | | - ''' |
84 | | - pass |
85 | | - |
86 | | - def generage_text_from_videostream(self): |
87 | | - pass |
88 | | - |
89 | | - def preprocess_exam(self): |
90 | | - pass |
91 | | - |
92 | | - def summarize_exam_topic(self): |
93 | | - pass |
94 | | - |
95 | | - def sentence2network(self): |
96 | | - pass |
97 | | - |
98 | | - def essay_writter_core(self): |
99 | | - pass |
100 | | - |
101 | | - def scoring_to_best_essay(self): |
102 | | - pass |
103 | | - |
104 | | - def formatting_essay_output(self): |
105 | | - pass |
106 | | - |
107 | | - |
108 | | - |
109 | | -def main(argv): |
110 | | - del argv |
111 | | - if FLAGS.gpu: |
112 | | - os.environ['CUDA_VISIBLE_DEVICES'] = FLAGS.gpu |
113 | | - else: |
114 | | - print('Please assign GPUs.') |
115 | | - exit() |
116 | | - |
117 | | -print("test sample in trained model...") |
118 | | -if __name__ == "__main__": |
119 | | - try: |
120 | | - pass |
121 | | - except: |
122 | | - print("pipeline has failed...") |
123 | | - #dicts = result[0].split(":") |
124 | | - #plexity = result.get['ppl'] |
125 | | - print("the final ppl score is: \n",scores ) |
126 | | - print("the final text output as :", text) |
127 | | - print(sum(result)) |
0 commit comments