Giter VIP home page Giter VIP logo

Comments (6)

yuyan2do avatar yuyan2do commented on May 17, 2024

lenpen is used to control the length, larger value make model prefer longer results. There is no argument to choose number of sentences, but you can handle it in post progress.

--lenpen 1.2

from prophetnet.

smita181298 avatar smita181298 commented on May 17, 2024

Thanks a lot @yuyan2do .can you give idea on how to do this ?

from prophetnet.

yuyan2do avatar yuyan2do commented on May 17, 2024

See "Inference and Evaluation" section for how to use argument lenpen.

https://github.com/microsoft/ProphetNet#inference-and-evaluation

from prophetnet.

smita181298 avatar smita181298 commented on May 17, 2024

Thanks and Sorry for the unclear question asked before @yuyan2do. What I meant to ask is can you give an idea on how to handle it in post-progress?

Also, I evaluated the model using a checkpoint created for headline generation on a validation set which has 39 articles.
The key in the below dictionary is the number of words in headline predicted by the model and value is no of articles which has a key number of words in the predicted headline.

lenpen==1.2
{6: 5, 9: 12, 7: 6, 12: 3, 8: 3, 10: 5, 11: 4, 13: 1}

for eg:
The first item of dictionary shows there are 5 articles for which 6 words are there in the predicted headline by prophetnet.

lenpen==2
{8: 6, 10: 7, 11: 6, 7: 3, 12: 3, 6: 2, 9: 11, 13: 1}
lenpen==5
{8: 6, 10: 7, 11: 7, 7: 2, 12: 5, 6: 1, 9: 10, 13: 1}
lenpen==50
{6: 9, 5: 2, 7: 9, 12: 2, 8: 7, 9: 5, 10: 1, 11: 2, 13: 1, 4: 1}

I don't seem to understand the effect of lenpen.

from prophetnet.

Jain-Abhilash avatar Jain-Abhilash commented on May 17, 2024

@smita181298, len_penalty (float, optional): length penalty, where <1.0 favors
shorter, >1.0 favors longer sentences (default: 1.0)
From the fairseq github, they implement it in this manner:
https://github.com/pytorch/fairseq/blob/8b9eaacf6b2d502cd7886dd7bf702a46ab37f058/fairseq/sequence_generator.py#L537

from prophetnet.

smita181298 avatar smita181298 commented on May 17, 2024

Yes I understand that @Jain-Abhilash
len_penalty (float, optional): length penalty, where <1.0 favors shorter, >1.0 favors longer sentences (default: 1.0)

But I don't seem to understand the exact effect of lenpen based on the output of my data using the prophetnet model(which I posted before).
Changing lenpen changes the number of words in the generated headline. But I want to generate a summary, not a headline and the maximum number of words in the headline is 13(as per my post before for my data, considering lenpen=50) which can not be considered as summary.

If drastically changing lenpen could have affected the drastic change in the number of words, it could be considered as summary.

Were you able to generate summary using prophetnet @Jain-Abhilash ?

from prophetnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.