Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
66eb1018
Commit
66eb1018
authored
Mar 24, 2017
by
Neal Wu
Browse files
Make textsum compatible with Python 3
parent
40a5739a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
textsum/batch_reader.py
textsum/batch_reader.py
+2
-1
textsum/beam_search.py
textsum/beam_search.py
+2
-1
textsum/seq2seq_attention_decode.py
textsum/seq2seq_attention_decode.py
+2
-1
textsum/seq2seq_attention_model.py
textsum/seq2seq_attention_model.py
+2
-2
No files found.
textsum/batch_reader.py
View file @
66eb1018
...
@@ -16,12 +16,13 @@
...
@@ -16,12 +16,13 @@
"""Batch reader to seq2seq attention model, with bucketing support."""
"""Batch reader to seq2seq attention model, with bucketing support."""
from
collections
import
namedtuple
from
collections
import
namedtuple
import
Queue
from
random
import
shuffle
from
random
import
shuffle
from
threading
import
Thread
from
threading
import
Thread
import
time
import
time
import
numpy
as
np
import
numpy
as
np
from
six.moves.queue
import
Queue
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
import
data
import
data
...
...
textsum/beam_search.py
View file @
66eb1018
...
@@ -21,10 +21,11 @@ K*K results, and start over again until certain number of results are fully
...
@@ -21,10 +21,11 @@ K*K results, and start over again until certain number of results are fully
decoded.
decoded.
"""
"""
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow
as
tf
FLAGS
=
tf
.
flags
.
FLAGS
FLAGS
=
tf
.
flags
.
FLAGS
tf
.
flags
.
DEFINE_bool
(
'normalize_by_length'
,
True
,
'Whether normalize'
)
tf
.
flags
.
DEFINE_bool
(
'normalize_by_length'
,
True
,
'Whether
to
normalize'
)
class
Hypothesis
(
object
):
class
Hypothesis
(
object
):
...
...
textsum/seq2seq_attention_decode.py
View file @
66eb1018
...
@@ -18,9 +18,10 @@
...
@@ -18,9 +18,10 @@
import
os
import
os
import
time
import
time
import
tensorflow
as
tf
import
beam_search
import
beam_search
import
data
import
data
from
six.moves
import
xrange
import
tensorflow
as
tf
FLAGS
=
tf
.
app
.
flags
.
FLAGS
FLAGS
=
tf
.
app
.
flags
.
FLAGS
tf
.
app
.
flags
.
DEFINE_integer
(
'max_decode_steps'
,
1000000
,
tf
.
app
.
flags
.
DEFINE_integer
(
'max_decode_steps'
,
1000000
,
...
...
textsum/seq2seq_attention_model.py
View file @
66eb1018
...
@@ -18,9 +18,9 @@
...
@@ -18,9 +18,9 @@
from
collections
import
namedtuple
from
collections
import
namedtuple
import
numpy
as
np
import
numpy
as
np
import
tensorflow
as
tf
import
seq2seq_lib
import
seq2seq_lib
from
six.moves
import
xrange
import
tensorflow
as
tf
HParams
=
namedtuple
(
'HParams'
,
HParams
=
namedtuple
(
'HParams'
,
'mode, min_lr, lr, batch_size, '
'mode, min_lr, lr, batch_size, '
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment