def METHOD_NAME(args):
    paddle.set_device(args.device)
    # Create dataset, tokenizer and dataloader.
    train_examples, predict_examples = load_dataset("msra_ner", split=("train", "test"))
    column_names = train_examples.column_names
    tokenizer = BertTokenizer.from_pretrained(args.model_name_or_path)
    label_list = train_examples.features["ner_tags"].feature.names
    label_num = len(label_list)
    no_entity_id = 0
    def tokenize_and_align_labels(examples):
        tokenized_inputs = tokenizer(
            examples["tokens"],
            max_seq_len=args.max_seq_length,
            # We use this argument because the texts in our dataset are lists of words (with a label for each word).
            is_split_into_words="token",
            return_length=True,
        )
        labels = []
        for i, label in enumerate(examples["ner_tags"]):
            label_ids = label
            if len(tokenized_inputs["input_ids"][i]) - 2 < len(label_ids):
                label_ids = label_ids[: len(tokenized_inputs["input_ids"][i]) - 2]
            label_ids = [no_entity_id] + label_ids + [no_entity_id]
            label_ids += [no_entity_id] * (len(tokenized_inputs["input_ids"][i]) - len(label_ids))
            labels.append(label_ids)
        tokenized_inputs["labels"] = labels
        return tokenized_inputs
    batchify_fn = DataCollatorForTokenClassification(tokenizer)
    id2label = dict(enumerate(label_list))
    predict_examples = predict_examples.select(range(len(predict_examples) - 1))
    predict_ds = predict_examples.map(tokenize_and_align_labels, batched=True, remove_columns=column_names)
    predict_data_loader = DataLoader(
        dataset=predict_ds, collate_fn=batchify_fn, num_workers=0, batch_size=args.batch_size, return_list=True
    )
    # Define the model netword
    model = BertForTokenClassification.from_pretrained(args.model_name_or_path, num_classes=label_num)
    if args.init_checkpoint_path:
        model_dict = paddle.load(args.init_checkpoint_path)
        model.set_dict(model_dict)
    model.eval()
    pred_list = []
    len_list = []
    for step, batch in enumerate(predict_data_loader):
        logits = model(batch["input_ids"], batch["token_type_ids"])
        pred = paddle.argmax(logits, axis=-1)
        pred_list.append(pred.numpy())
        len_list.append(batch["seq_len"].numpy())
    preds = parse_decodes(predict_examples, id2label, pred_list, len_list)
    file_path = "results.txt"
    with open(file_path, "w", encoding="utf8") as fout:
        fout.write("\n".join(preds))
    # Print some examples
    print("The results have been saved in the file: %s, some examples are shown below: " % file_path)
    print("\n".join(preds[:10]))