Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Mar 10, 2023. It is now read-only.

Commit 0412c8f

Browse files
committed
Fixed some comments andr eplaced some print functions to logging.
1 parent aa68ef4 commit 0412c8f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

‎train.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,13 @@ def main(argv):
203203
# Decoding.
204204
decoded_outputs = session.run(decoded[0], feed_dict=test_feed)
205205
dense_decoded = tf.sparse_tensor_to_dense(decoded_outputs, default_value=-1).eval(session=session)
206+
test_num = test_texts.shape[0]
206207

207208
for i, sequence in enumerate(dense_decoded):
208209
sequence = [s for s in sequence if s != -1]
209210
decoded_text = utils.sequence_decoder(sequence)
210211

211-
print('Sequence %d'%i)
212+
logging.info("Sequence %d/%d", i+1, test_num)
212213
logging.info("Original:\n%s", test_texts[i])
213214
logging.info("Decoded:\n%s", decoded_text)
214215

‎utils.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def read_text_file(path):
2121
Args:
2222
path: string.
2323
Path to text file.
24-
2524
Returns:
2625
string.
2726
Read text.
@@ -39,7 +38,6 @@ def make_char_array(text, space_token='<space>'):
3938
Given text.
4039
space_token: string.
4140
Text which represents space char.
42-
4341
Returns:
4442
string array.
4543
Split text.
@@ -57,7 +55,6 @@ def normalize_text(text, remove_apostrophe=True):
5755
Given text.
5856
remove_apostrophe: bool.
5957
Whether to remove apostrophe in given text.
60-
6158
Returns:
6259
string.
6360
Normalized text.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /