tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.5k stars 3.49k forks source link

How to use the t2t-decoder? #1157

Closed Runingtime closed 6 years ago

Runingtime commented 6 years ago

I am trying to use t2t for text summarization. However, I didn't find any documents that describe how to set the hyper-parameters. For example, how to limit the decoding length? So, could someone tell me if there are related descriptions or tutorials? Thanks!

mehmedes commented 6 years ago

decoding.py will provide you with the possibilities:

https://github.com/tensorflow/tensor2tensor/blob/a4f958a887f4f4466644dd0602bdd33985d61dd7/tensor2tensor/utils/decoding.py#L44-L74

You may change these values by adding the flag --decode_hparams="beam_size=1,alpha=0, etc." when running t2t-decoder. I think extra_length defines the decode_length.

afrozenator commented 6 years ago

Thanks for responding @mehmedes ! I hope this answers your question @Runingtime !