yangsaisai
7 years ago
| 0 | # input: | |
| 1 | # your_param_name: | |
| 2 | # value_type: 'int' | |
| 3 | # output: | |
| 4 | # your_result_name: | |
| 5 | # value_type: 'int' | |
| 6 | ||
| 7 | ||
| 8 | 0 | input: |
| 9 | 1 | Chinese_word: |
| 10 | 2 | value_type: "str" |
| 11 | 3 | style: |
| 12 | value_type: "[str]" | |
| 4 | value_type: "str" | |
| 13 | 5 | value_range: ['藏头诗', '藏字诗'] |
| 14 | 6 | output: |
| 15 | 7 | Poetry: |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | class WritePoem(): |
| 15 | def __init__(self,args): | |
| 15 | def __init__(self, args): | |
| 16 | 16 | self.args = args |
| 17 | 17 | |
| 18 | 18 | logging.basicConfig(stream=sys.stdout, |
| 34 | 34 | w2v_file = os.path.join(base_path, "vectors_poem.bin") |
| 35 | 35 | self.w2v = Word2Vec(w2v_file) |
| 36 | 36 | |
| 37 | RhymeWords.read_rhyme_words(os.path.join(base_path,'rhyme_words.txt')) | |
| 37 | RhymeWords.read_rhyme_words(os.path.join(base_path, 'rhyme_words.txt')) | |
| 38 | 38 | |
| 39 | 39 | if args.seed >= 0: |
| 40 | 40 | np.random.seed(args.seed) |
| 1 | 1 | Chinese_word: |
| 2 | 2 | value_type: "str" |
| 3 | 3 | style: |
| 4 | value_type: "[str]" | |
| 4 | value_type: "str" | |
| 5 | 5 | value_range: ['藏头诗', '藏字诗'] |
| 6 | 6 | output: |
| 7 | 7 | Poetry: |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | class WritePoem(): |
| 15 | def __init__(self,args): | |
| 15 | def __init__(self, args): | |
| 16 | 16 | self.args = args |
| 17 | 17 | |
| 18 | 18 | logging.basicConfig(stream=sys.stdout, |
| 34 | 34 | w2v_file = os.path.join(base_path, "vectors_poem.bin") |
| 35 | 35 | self.w2v = Word2Vec(w2v_file) |
| 36 | 36 | |
| 37 | RhymeWords.read_rhyme_words(os.path.join(base_path,'rhyme_words.txt')) | |
| 37 | RhymeWords.read_rhyme_words(os.path.join(base_path, 'rhyme_words.txt')) | |
| 38 | 38 | |
| 39 | 39 | if args.seed >= 0: |
| 40 | 40 | np.random.seed(args.seed) |