alasdairtran / transform-and-tell

[CVPR 2020] Transform and Tell: Entity-Aware News Image Captioning
https://transform-and-tell.ml/
91 stars 14 forks source link

Run your model on a single new piece of news #18

Closed zmykevin closed 2 years ago

zmykevin commented 3 years ago

Hi Tran, Thank you for making this cool project available! I notice that on the demo, you have allow users to provide a single link of a new piece of news and generate the caption accordingly. I wonder if you also have a script in this github repo that allows us to use your pre-trained model to generate a caption for one new news sample? Thanks!

alasdairtran commented 3 years ago

I haven't written up a self-contained script to generate a caption from arbitrary input yet. But that's a good idea - I'll put it on my to-dos.

In the meantime, all of the demo app code is included in the repo here. The backend object that's responsible for generating the caption is here. You probably can clean up that file a bit to make it self-contained. Basically when we query the backend, the method CaptioningWorker.generate_captions(articles) in that file is called and it returns generated captions.

zmykevin commented 3 years ago

That is very helpful! I am actually already working on writing up a full pipeline to process a single source of news with all the input information in a json format. If I make it work, I will let you know~