This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 175
Update simple_seq2seq.py #90
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
ebbbae6
Update simple_seq2seq.py
wlhgtc 2f3da86
Update simple_seq2seq.py
wlhgtc d0d86cd
Update CHANGELOG.md
wlhgtc b63f595
Update simple_seq2seq.py
wlhgtc d6b0882
Update simple_seq2seq.py
wlhgtc 417d4db
reformat code
wlhgtc 592859c
remove unused code
wlhgtc ccd2942
fix shape bug
wlhgtc de0a82c
fix lstm bug
wlhgtc bdb089b
fix type error
wlhgtc 125bb76
fix top-k bug
wlhgtc 1c9724e
adjust test code
wlhgtc c694b48
add test cases
wlhgtc 2d40bee
fix group_size error
wlhgtc 9c2525d
merge master
wlhgtc 38e63ea
Merge branch 'allenai-master'
wlhgtc 4aec709
adjust change log
wlhgtc c4330ef
fix bug
wlhgtc ccfeb75
Merge branch 'master' into master
dirkgr dbea690
Merge branch 'master' into wlhgtc-master
dirkgr ea037ba
Merge branch 'master' into master
epwalsh c7a4de3
Update allennlp_models/generation/models/simple_seq2seq.py
wlhgtc d02a317
format doc
wlhgtc 72959a7
format doc
wlhgtc a587a30
reformat doc
wlhgtc 609f7aa
Merge branch 'master' into master
dirkgr dc57b16
Merge branch 'master' into master
dirkgr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,8 @@ def test_uses_named_inputs_with_simple_seq2seq(self): | |
predicted_tokens = result.get("predicted_tokens") | ||
assert predicted_tokens is not None | ||
assert isinstance(predicted_tokens, list) | ||
assert all(isinstance(x, str) for x in predicted_tokens) | ||
for predicted_token in predicted_tokens: | ||
assert all(isinstance(x, str) for x in predicted_token) | ||
Comment on lines
+22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it contains top n sequences, could see in here |
||
|
||
def test_uses_named_inputs_with_composed_seq2seq(self): | ||
inputs = {"source": "What kind of test succeeded on its first attempt?"} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the extra loop necessary now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code only return top1 result for beam_search. It's not convenient if we want eval top5 score (or we want choose result by some hand-craft algorithm). So I use the code segment in copy-net to get all results.