GithubHelp home page GithubHelp logo

lm_ner's Introduction

Nice to meet U 👋

tree's GitHub stats

lm_ner's People

Contributors

wzzzd 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lm_ner's Issues

验证集acc为0,预测结果全部都错了

metrics: lab:DISEASE, precision:0.0 recall:0.0 f1:0.0
metrics: precision:0.0 recall:0.0 f1:0.0

训练的时候,每个epoch的验证结果都是这样的,我把预测结果打印了,确实全部预测错了
是哪里出问题了??

A Seeming Bug

image
i was wondering if there is a bug in the function BIMES2BIO( ) in eval.py as was circled in the picture :-)
it does make some difference in the answers in my situation

关于多卡通信问题

image
我看不到有在用多卡
image

登录方式用的python -m torch.distributed.launch run.py
self.visible_device = '0,1,2,3' # 可见的GPU卡号
self.device = 'cuda:0' # 主卡号

是哪里还需要修改吗?

求解答 关于output出现的错误

[CLS]当前第一位是要切实安排好受灾群众的生活,一定要让受灾群众有饭吃,有水喝,有衣穿,有病能得到医治。[SEP] [('ORG', '。[SEP]', [48, 95])] []
[CLS]因此,路易斯和赫苏斯两兄弟有[UNK]合成毒品大王[UNK]之称。[SEP] [('ORG', '。[SEP]', [25, 95]), ('PER', '路易斯', [4, 6]), ('PER', '赫苏斯', [8, 10])] [('PER', '路易斯', [4, 6]), ('PER', '赫苏斯', [8, 10])]
[CLS]其次,他不具高人一头的身材,腿与上身的比例也不尽如人意,作为男舞员很吃亏。[SEP] [('ORG', '。[SEP]', [37, 95])] []
[CLS]大部分人主张把钱分了,靠拿银行利息过日子比过去种地强。[SEP] [('ORG', '。[SEP]', [27, 95])] []
[CLS]所有这一切,又被作家凝缩和提升为哲理性的思索。[SEP] [('ORG', '。[SEP]', [23, 95])] []
[CLS]他们赶到出事现场,只见一个女青年正在水中拼命挣扎。[SEP] [('ORG', '。[SEP]', [25, 95])] []

这是部分output的数据,里面有很多的ORG。[SEP]这种 是因为什么会造成这样阿

请问预测时候pad都预测成index=0的标签了,怎么解决。

自己看了很多遍代码,还是无法解决,期待你的回复
预测输入:[[101, 3851, 3736, 4689, 3343, 2336, 2356, 677, 1814, 3777, 1773, 6125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102]
预测label:[['O', 'B-prov', 'I-prov', 'E-prov', 'B-city', 'I-city', 'E-city', 'B-district', 'E-district', 'B-road', 'I-road', 'E-road', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O']
预测结果:[['O', 'B-prov', 'I-prov', 'E-prov', 'B-city', 'I-city', 'E-city', 'B-district', 'E-district', 'B-road', 'I-road', **'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov', 'B-prov']

deberta的NER

你好,请问下如果想搭建deberta的NER的话,config里面的BertConfig.py还适配嘛,还是要自己重新写一个config文件呢

麻烦博主帮忙看一下,英文数据训练问题

使用英文数据集训练出现如下错误,看了好久不知道怎么解决:
Traceback (most recent call last):
File "run.py", line 42, in
trainer.train()
File "F:\Files\lm_ner-main\process\Trainer.py", line 220, in train
loss = self.step(bs)
File "F:\Files\lm_ner-main\process\Trainer.py", line 248, in step
outputs = self.model(input_ids, labels=labels, attention_mask=attention_mask) #
File "F:\software_of_computer_learning\Anaconda\install_path\envs\Bert_BiLstm\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "F:\software_of_computer_learning\Anaconda\install_path\envs\Bert_BiLstm\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "F:\biyesheji\lm_ner-main\model\transformer_crf.py", line 52, in forward
loss = -1 * self.crf(emissions = logits, tags=labels, mask=attention_mask)
File "F:\software_of_computer_learning\Anaconda\install_path\envs\Bert_BiLstm\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "F:\software_of_computer_learning\Anaconda\install_path\envs\Bert_BiLstm\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "F:\Files\lm_ner-main\model\layers\crf.py", line 100, in forward
numerator = self._compute_score(emissions, tags, mask)
File "F:\Files\lm_ner-main\model\layers\crf.py", line 213, in _compute_score
last_tags = tags[seq_ends, torch.arange(batch_size)]
IndexError: index 1065 is out of bounds for dimension 0 with size 256

博主 看一下吧

博主 就是我用了你的代码跟数据去跑的bert-crf 然后出现的情况就是padding全部变成了某一个label了,输出到了output,我看上面有人说遇到同样的情况,他说改成torchcrf就行,我想问问这部分代码怎么改呀 我看你改过这部分 是注释了的 我换成你写的那部分了 运行不了 能解决一下吗

求解答!!!

想问一下怎么开多卡呀 我把那个可见的gpu=【1,2,3,0】,但是跑起来的还是只有1 gpu 为什么阿

关于output的问题

src predict label
[CLS]1979年9月参加工作,[SEP] [('TITLE', ',[SEP]', [12, 127])] []
[CLS]华泰集团有限公司总裁;[SEP] [('TITLE', '总裁;[SEP]', [9, 127]), ('ORG', '华泰集团有限公司', [1, 8])] [('TITLE', '总裁', [9, 10]), ('ORG', '华泰集团有限公司', [1, 8])]
[CLS]陈倩女士,女,[SEP] [('TITLE', ',[SEP]', [7, 127]), ('NAME', '陈倩', [1, 2])] [('NAME', '陈倩', [1, 2])]
[CLS]1959年出生,大专学历。[SEP] [('TITLE', '。[SEP]', [13, 127]), ('EDU', '大专学历', [9, 12])] [('EDU', '大专学历', [9, 12])]
[CLS]严文俊先生简历严文俊,男,[SEP] [('TITLE', ',[SEP]', [13, 127]), ('NAME', '严文俊', [1, 3]), ('NAME', '严文俊', [8, 10])] [('NAME', '严文俊', [1, 3]), ('NAME', '严文俊', [8, 10])]
[CLS]历任中航供销汉中公司财务科员、副科长、科长(经理)、副总会计师,汉航集团财务部副部长、人力资源部部长、财务审计部部长。[SEP] [('TITLE', '财务科员', [11, 14]), ('TITLE', '副科长', [16, 18]), ('TITLE', '科长', [20, 21]), ('TITLE', '经理', [23, 24]), ('TITLE', '副总会计师', [27, 31]), ('TITLE', '财务部副部长', [37, 42]), ('TITLE', '人力资源部部长', [44, 50]), ('TITLE', '财务审计部部长。[SEP]', [52, 127]), ('ORG', '中航供销汉中公司', [3, 10]), ('ORG', '汉航集团', [33, 36])] [('TITLE', '财务科员', [11, 14]), ('TITLE', '副科长', [16, 18]), ('TITLE', '科长', [20, 21]), ('TITLE', '经理', [23, 24]), ('TITLE', '副总会计师', [27, 31]), ('TITLE', '财务部副部长', [37, 42]), ('TITLE', '人力资源部部长', [44, 50]), ('TITLE', '财务审计部部长', [52, 58]), ('ORG', '中航供销汉中公司', [3, 10]), ('ORG', '汉航集团', [33, 36])]
[CLS]姜华方,[SEP] [('TITLE', ',[SEP]', [4, 127]), ('NAME', '姜华方', [1, 3])] [('NAME', '姜华方', [1, 3])]

老哥 你看这是我用的robert_Crf那个模型跑出来的结果 我训练了20个epoch,loss=0.5,f1=.95,这么看他的预测结果是准确的 但是为什么我发现这个里面有很多都是('TITLE', ',[SEP]', [句尾,规定的max_len]), 这是为什么啊 能帮忙改一下吗谢谢 急!!!

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.