[MusicBERT]: How to fill masked tokens in an input sequence after training?
See original GitHub issueHello again,
I have fine-tuned MusicBERT on masked language modeling using a custom dataset. I have loaded the fine-tuned checkpoint using:
roberta = RobertaModel.from_pretrained( # MusicBERTModel.from_pretrained also works
'.',
checkpoint_file=sys.argv[1],
data_name_or_path=sys.argv[2],
user_dir='musicbert'
)
What I want to do is to give it an input sequence, mask one or more tokens before passing the input to the model and somehow predict them. Something like masked language modeling, but with control over which tokens I want to mask and predict.
What I cannot understand is what format the input sequence should be in order to be passed to the model, and how to make the model predict the masked tokens in the input. I have tried to replicate it by looking at the fairseq’s training code since I want to do something similar, but it’s too complicated.
Thanks in advance.
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Fine-tuning a masked language model - Hugging Face Course
When training models for masked language modeling, one technique that can be used is to mask whole words together, not just individual tokens....
Read more >Masked-Language Modeling With BERT | by James Briggs
In many cases, we might be able to take the pre-trained BERT model ... we actually give BERT that input sentence — we...
Read more >End-to-end Masked Language Modeling with BERT - Keras
Masked Language Modeling is a fill-in-the-blank task, where a model uses the context words surrounding a mask token to try to predict what ......
Read more >Large-scale Pre-training for Symbolic Music Understanding
We employ the mask language modeling (MLM) pre-training strategy of BERT, randomly masking 15% tokens of an input sequence, and asking the Transformer...
Read more >(PDF) Multi-modal, Multi-task, Music BERT: A Context-Aware ...
After pre-training using masked reconstruction and self-attention ... BERT reconstructs masked input sequences in its pre-training stage;.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @mlzeng and @tripathiarpan20 I’ll be closing this issue as it is more than resolved. The MIDIformers project is indeed brilliant!
Hi @tripathiarpan20
The MIDI remixing tool works well. It’s a brilliant project! I have added the links in
README.md
.