Comments (6)
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.
Thanks a lot @yuyan2do .can you give idea on how to do this ?
from prophetnet.
See "Inference and Evaluation" section for how to use argument lenpen.
https://github.com/microsoft/ProphetNet#inference-and-evaluation
from prophetnet.
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.
@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.
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)
- Can use_fp16 be used?
- Why is the GENIE result in AR-diffusion very different from the original paper? Also, you come from a team. HOT 1
- Character level
- Can't Find Pretrained Checkpoint of Prophetnet: HOT 1
- Unable to load the GENIE model HOT 1
- The datasets have no dev set? HOT 1
- Options Employed for Training or Inference on the CNN/DM Dataset HOT 1
- It seems that the core code of CRITIC, particularly the part involving Google API search, is not implemented HOT 4
- Missing key documents for AR-Diffusion HOT 1
- where is "mbr_select.py" in AR-Diffusion HOT 1
- Unable to run Genie_Finetune.py HOT 1
- “load_fairseq” not found in "AR-Diffusion/data_utils" HOT 3
- Question for GENIE Finetuning, how to specify epochs for training/finetuning? HOT 1
- “load_fairseq” not found in "AR-Diffusion/data_utils" HOT 1
- [AR-Diffusion] predict_xstart vs predict_x_start HOT 3
- AR-Diffusion data.name and exp.name HOT 2
- Request the execution code of llama2
- AR-diffusion: where the code for algorithm 1 is located? HOT 4
- (AR-Diffusion) RuntimeError: Error(s) in loading state_dict for CrossAttention_Diffusion_LM HOT 3
- what is the need for `num_samples` parameter in inference? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prophetnet.