Giter Site home page Giter Site logo

ner-pytorch-chinese's People

Contributors

shuxinyin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ner-pytorch-chinese's Issues

processors模块问题

from processors.processor import LEBertProcessor, BertProcessor
ModuleNotFoundError: No module named 'processors.processor'
这是安装提示processors in /share/home/.local/lib/python3.7/site-packages (0.0.2)

processors模块应该是processors这个文件夹里的processor.py文件吧 怎么也找不到模块 难受,我直接把processor.py文件拖到了报错的model_class下面 但是我不知道是哪里的路径没改对 他才会找不到processor文件夹呢

这是我的配置,bert_chinese,tencent-ailab-embedding-zh-d200-v0.2.0-s.txt是下载的文件,不知道是不是还缺了要改的地方,运行不起来

  • DEVICE=0
  • LR=1e-5
  • CRF_LR=1e-3
  • ADAPTER_LR=1e-3
  • REPO_PATH=/share/home/NER-Pytorch-Chinese-master
  • DATA_DIR=/share/home/NER-Pytorch-Chinese-master/data
  • OUTPUT_PATH=/share/home/NER-Pytorch-Chinese-master/output
  • PRETRAIN_MODEL=/data/bert_chinese
  • PRETRAIN_EMBED_PATH=/data/tencent-ailab-embedding-zh-d200-v0.2.0-s.txt
  • for DATA_SET in ''''msra''''
  • for MODEL_CLASS in ''''lebert-softmax''''
  • echo ----------------------------------------msra:lebert-softmax----------------------------------------
  • python /share/home//NER-Pytorch-Chinese-master/train/train.py --device gpu --output_path /share/home//NER-Pytorch-Chinese-master/output --add_layer 1 --loss_type lsr --lr 1e-5 --crf_lr 1e-3 --adapter_lr 1e-3 --weight_decay 0.01 --eps 1.0e-08 --epochs 1 --batch_size_train 24 --batch_size_eval 256 --num_workers 0 --eval_step 100 --max_seq_len 150 --max_word_num 3 --max_scan_num 3000000 --data_path /share/home/NER-Pytorch-Chinese-master/data/msra/ --dataset_name msra --model_class lebert-softmax --pretrain_model_path /data/bert_chinese --pretrain_embed_path /data/tencent-ailab-embedding-zh-d200-v0.2.0-s.txt --seed 42 --markup bios --grad_acc_step 1 --max_grad_norm 1.0 --num_workers 0 --warmup_proportion 0.1 --load_word_embed --do_train
    Traceback (most recent call last):
    File "/share/home/NER-Pytorch-Chinese-master/train/train.py", line 21, in
    from model_class import MODEL_CLASS, PROCESSOR_CLASS
    File "/share/home/NER-Pytorch-Chinese-master/train/model_class.py", line 5, in
    from processors.processor import LEBertProcessor, BertProcessor
    ModuleNotFoundError: No module named 'processors.processor'

缺少必要文件

兄弟,代码完善了再上传git呀,有的目录根本没有,程序中还import了~~~~比如:from model_class import MODEL_CLASS, PROCESSOR_CLASS

repo id 错误

您好,我再运行这个train.py文件时,出现以下错误:
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'NER-Pytorch-Chinese-master/data/Learn_Project/Backup_Data/bert_chinese'. Use repo_type argument if needed.
这个错误是为什么呢?需要怎么处理呀?

CRF 如何进行label smoothing?

请问以CRF为解码层的模型是如何进行label smoothing的?我看代码的时候没有看到相关的代码,请大佬指出!

process.py中的文件找不到

您好,在process.py文件中的init函数下(如下代码所示)
def init(self, pretrain_embed_path, output_path, max_scan_num, data_files, label_path, overwrite):
word_embed_path = join(self.data_path, 'word_embedding.pkl')
word_vocab_path = join(self.data_path, 'word_vocab.pkl')
word_vocab_path_ = join(self.data_path,'word_vocab.pkl)
trie_tree_path = join(self.data_path, 'trie_tree.pkl')
以上self.data_path下中的 'word_embedding.pkl'、'word_vocab.pkl‘、'word_vocab.pkl’、'trie_tree.pkl'都找不到是什么原因呢?

bug?

        if args.model_class in ['lebert-crf', 'bert-crf']:
            preds = model.crf.decode(logits, attention_mask).squeeze(0)
            preds = preds[:, 1:].tolist()  # 减去padding的[CLS]

评估函数172行,是不是少了对bert-lstm-crf的decoder解码
image

bert-softmax模型的epoch数

请问在msra和ontonotes两个数据集上实验时,script/train.sh中的epoch数分别是多少呢?超参数都一样吗?可不可以提供下具体的配置文件?
还有,预训练的中文版bert是官方的bert-base-chinese吗?

改成crf运行后都会出现

File "/share/home/NER-Pytorch-Chinese-master-1/train/train.py", line 187, in evaluate
metric.update(pred_paths=[pred], label_paths=[label])
File "../metrics/ner_metrics.py", line 56, in update
pre_entities = get_entities(pre_path, self.id2label,self.markup)
File "../utils/get_entity.py", line 117, in get_entities
return get_entity_bios(seq,id2label)
File "../utils/get_entity.py", line 19, in get_entity_bios
tag_str = id2label[tag]
TypeError: list indices must be integers or slices, not list

softmax没有问题,请问怎么回事呢,对了我是把nbest改成了3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.