google-research / pegasus

Apache License 2.0
1.6k stars 316 forks source link

TensorFlow Serving support #65

Open akashjaswal opened 4 years ago

akashjaswal commented 4 years ago

Any plans of extending Pegasus to export models as TFHub modules or to run directly with TensorFlow Server? Tensor2Tensor has an easy to use model exporter/server which plugs into the tensorflow-serving-api to provide easy ways to query.

JingqingZ commented 4 years ago

Hi, I am sorry there is no recent plan to export PEGASUS to TFHub from our side.

TheRockXu commented 4 years ago

@akashjaswal I created a servable model by training cnn_dailymail on pegasus, you can download it here. It works with tf2. You can try to deploy it if you want.

I also created a repo that you can try an end to end summarization demo.

codemeterr commented 4 years ago

Thank you, @TheRockXu ! However, when I try to run this, I receive the following Syntax error (with arrow head pointing to colon after encoder_type):

Traceback (most recent call last): File "test_example.py", line 2, in import public_parsing_ops File "/Users/emiel/pegasus-demo-master/public_parsing_ops.py", line 29 def create_text_encoder(encoder_type: str, vocab_filename: str): ^ SyntaxError: invalid syntax

TheRockXu commented 4 years ago

@codemeterr Did you use Python2.7 to run the code? Please use Python3 because it supports typed parameters.

codemeterr commented 4 years ago

Thank you, @TheRockXu , that seems to work! However, the summary seems to be extractive, rather than abstractive. Do you know what's up with that?

TheRockXu commented 4 years ago

@codemeterr For some yes. It could probably perform better if it was trained longer and it depends on the dataset. If it was trained on gigaword dataset, it'd be highly abstractive. I'll put up that model later.

chetanambi commented 4 years ago

@TheRockXu Could you please share the steps for fine-tuning on gigaword. I tried to follow the steps mentioned in README.md but I am running into issues. Could you please share the steps.