Get sentence ‘B’ predicted, given sentence ‘A’ using Next Sentence Prediction model

Hi all,
Am new to this discussion forum…

I am currently working on a use case wherein given a sentence , i need to predict next sentence for it. NSP task seems to be the one suitable for it.
But :frowning: , I found references of training a NSP model, wherein we give 2 sentences and it gives us output ‘0’ if sentence B follows sentence A and gives output ‘1’ if those two sentences are not related to each other.
(refrence :- How to Fine-Tune BERT With NSP | Towards Data Science)

I want to get sentence ‘B’ as output, given input as sentence ‘A’.

Can someone please help me achieve the same output?
Thanks in advance :blush:

Typically this would be done in two steps. First, use a causal language model to generate a number of candidate sentences. Second, use an NSP model to calculate a probability for each candidate and select the one with the highest probability.