d8269a336571d652f7b47728578fc8b8549b6725,pycorrector/seq2seq_attention/infer.py,,,#,52
Before Change
source_texts, target_texts = create_dataset(config.train_path, None)
source_seq, source_word2id = tokenize(source_texts, config.maxlen)
target_seq, target_word2id = tokenize(target_texts, config.maxlen)
dataset = tf.data.Dataset.from_tensor_slices((source_seq, target_seq)).shuffle(len(source_seq))
dataset = dataset.batch(config.batch_size, drop_remainder=True)
example_source_batch, example_target_batch = next(iter(dataset))
model = Seq2SeqModel(example_source_batch, source_word2id, target_word2id, embedding_dim=config.embedding_dim,
After Change
"会能够大幅减少互相抱怨的情况。"
]
source_word2id = load_word_dict(config.save_src_vocab_path)
target_word2id = load_word_dict(config.save_trg_vocab_path)
model = Seq2SeqModel(source_word2id, target_word2id, embedding_dim=config.embedding_dim,
hidden_dim=config.hidden_dim,
batch_size=config.batch_size, maxlen=config.maxlen, checkpoint_path=config.model_dir,
gpu_id=config.gpu_id)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: shibing624/pycorrector
Commit Name: d8269a336571d652f7b47728578fc8b8549b6725
Time: 2019-12-31
Author: xuming624@qq.com
File Name: pycorrector/seq2seq_attention/infer.py
Class Name:
Method Name:
Project Name: shibing624/pycorrector
Commit Name: 1dfa6c004e1ddb171725910ad38fe83814f6ad0f
Time: 2018-03-14
Author: 507153809@qq.com
File Name: pycorrector/__init__.py
Class Name:
Method Name:
Project Name: shibing624/pycorrector
Commit Name: b9b28080281ff6bbf613620559709f762fd3ef0b
Time: 2018-05-17
Author: 507153809@qq.com
File Name: pycorrector/rnn_lm/infer.py
Class Name:
Method Name: generate
Project Name: shibing624/pycorrector
Commit Name: b9b28080281ff6bbf613620559709f762fd3ef0b
Time: 2018-05-17
Author: 507153809@qq.com
File Name: pycorrector/rnn_lm/infer.py
Class Name:
Method Name: ppl