models icon indicating copy to clipboard operation
models copied to clipboard

TextSum does not actually check the presence of Tags in vocabulary

Open pranay360 opened this issue 10 years ago • 7 comments

https://github.com/tensorflow/models/blob/master/textsum/seq2seq_attention.py#L163

The way of checking presence of required tokens is wrong because WordToId function returns ID of Unknown token (which might be >=0 for most of the cases) if the that particular token is not found, hence the scripts validates a wrong vocabulary file.

I am training the TextSum algorithm on CNN Dataset and would also like to know about the presence of in sample Toy Vocabulary, what should be the location/use of in the data? Can someone provide a sample format for data including the token, because I don't have it in my vocabulary. I would like to know how to include it in the data.

Possible Fix: Raising an error if the WordToID function when the word is not found.

pranay360 avatar Nov 08 '16 09:11 pranay360

@peterjliu Can you comment?

girving avatar Nov 14 '16 17:11 girving

Yes, you're right about the assertions. There should be another method that checks membership in the vocabulary instead. Do you want to send a pull request? (cc @panyx0718)

peterjliu avatar Nov 15 '16 00:11 peterjliu

PAD should never appear in the data. It is to pad sequence of difference length to the max_length.

On Mon, Nov 14, 2016 at 4:12 PM, Peter Liu [email protected] wrote:

Yes, you're right about the assertions. There should be another method that checks membership in the vocabulary instead. Do you want to send a pull request? (cc @panyx0718 https://github.com/panyx0718)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/621#issuecomment-260505909, or mute the thread https://github.com/notifications/unsubscribe-auth/ACwQe9pD3WNh6TgruGYeVwC-KN544mhqks5q-Pj7gaJpZM4KsNXs .

Thanks Xin

panyx0718 avatar Nov 15 '16 01:11 panyx0718

@peterjliu , Yeah sure, I'll send a pull request. @panyx0718 according to you PAD should not appear in the vocabulary, then it's presence need not be checked?

pranay360 avatar Nov 15 '16 06:11 pranay360

It should not appear in "data". It should appear in "vocab"

On Mon, Nov 14, 2016 at 10:30 PM, Pranay Mathur [email protected] wrote:

@peterjliu https://github.com/peterjliu , Yeah sure, I'll send a pull request. @panyx0718 https://github.com/panyx0718 according to you should not appear in the vocabulary, then it's presence need not be checked?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/621#issuecomment-260558995, or mute the thread https://github.com/notifications/unsubscribe-auth/ACwQe2njA8ztwCcHFQSpNP4W0leuvg3vks5q-VGNgaJpZM4KsNXs .

Thanks Xin

panyx0718 avatar Nov 15 '16 18:11 panyx0718

Hi everyone! Please refer PR #725 for the fix. Sorry for the late response, was busy in academic examinations. Thanks for answering the query @panyx0718 @peterjliu

pranay360 avatar Dec 08 '16 15:12 pranay360

Hi,

I couldn't find any more relevant bit of info anywhere about the pad token than here. I get that should not appear in the data but in the vocabulary file. What I need to know based on what I should count them. Should I count one for every shorter article than the maximum input size (which is enc_timesteps and set to 120) or should I count as many pad chars as the article falls short from the maximum input size character-wise?

aanilpala avatar Feb 02 '17 16:02 aanilpala