BERT-NER-Pytorch icon indicating copy to clipboard operation
BERT-NER-Pytorch copied to clipboard

Chinese NER(Named Entity Recognition) using BERT(Softmax, CRF, Span)

Results 70 BERT-NER-Pytorch issues
Sort by recently updated
recently updated
newest added

运行报错 run_ner_crf.py: error: the following arguments are required: --task_name, --data_dir, --model_type, --model_name_or_path, --output_dir 然后看get_argparse():函数里面的内容 ```python parser.add_argument("--task_name,", default=None, type=str, required=True, help="The name of the task to train selected in the list:...

`do_lower_case`参数用于判断是否对输入文本小写,传递给tokenizer。 ```python tokenizer = tokenizer_class.from_pretrained(args.model_name_or_path, do_lower_case=args.do_lower_case,) ``` 参数在`tokenizer.tokenize`方法中发挥作用,本项目中直接使用了`tokenizer.convert_tokens_to_ids`方法,实际上并没有起作用,因此需要手动处理。 ```python def convert_examples_to_features(...): ... if tokenizer.do_lower_case: tokens = [x.lower() for x in tokens] ... input_ids = tokenizer.convert_tokens_to_ids(tokens) ```

如果 start_positions (假设batch size=1, 忽略batch这个纬度) 为 tensor([0, 0, 0, 2, 0, 8, 0, 0, 0, 0]) end_positions 为 tensor([0, 0, 0, 0, 2, 0, 0, 8, 0, 0]) 那么 label_logits...

看过tf的tokenizer的代码,输入的是句子或者单个char,返回的是单个句子或者单个char 而torch的输入输入的是句子或者单个char,返回的是单个句子list或者单个char的list 重要的问题是,如果输入的单个char本身是unk类型的字符,pytorch的tokenizer.tokenize(char) 居然返回的为空而不是[UNK]? 好奇pytorch为啥这样搞,这样直接导致训练数据x和label没办法对齐了......

![image](https://user-images.githubusercontent.com/59439162/174578114-446439f2-dcb4-4a4f-bbe5-ee450df89f76.png) 您好,请问label标签里面有一个'X'是出于什么考虑呢?

在自己数据集上运行script/run_ner_crf.sh, 运行之后就卡在这里了,求大佬建议 Some weights of the model checkpoint at ./BERT-NER-Pytorch-master/prev_trained_model/bert-base-chinese were not used when initializing BertCrfForNer: ['cls.seq_relationship.weight', 'cls.seq_relationship.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.bias', 'cls.predictions.decoder.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.transform.LayerNorm.weight'] - This IS expected if you...

运行结束后得到了准确率之类的指标,但是由于是新手不知道如何拿模型结果去跑新的数据去预测,求大神指点。 比如输入一个句子,输出句子里面的实体,这种效果。

样本的长度为128,经过DataLoader后就变成了27,请问这个是什么原因呢?

请问我将这个代码下载下来,然后下载的cluener数据,我在运行 sh scripts/run_ner_softmax.sh 但是在验证集的的所有要素的召回率,准确率,f1都是为0