Update language_modeling.py
Title: Add truncate_seq_pair function to TextDatasetForNextSentencePrediction

Description:
This PR adds a `truncate_seq_pair()` function to the `TextDatasetForNextSentencePrediction` class, inside the `create_examples_from_document()` function. This function truncates the sequences if they exceed the maximum number of tokens, which is useful when dealing with very long input texts. By including this function, the generated examples will adhere to the maximum sequence length constraint, which is important for the proper functioning of the model during pre-training.

Fixes # (issue)

## Before submitting
- [x] I read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section.
- [x] I wrote any new necessary tests.

## Who can review?
- text models: @ArthurZucker and @younesbelkada
- tokenizers: @ArthurZucker
- trainer: @sgugger

Please let me know if there are any changes or improvements needed.
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_23200). All of your documentation changes will be reflected on that endpoint.<|||||>This code is deprecated and not maintained anymore. To preprocess your data, we recommend you use the `datasets` library.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.