fastNLP icon indicating copy to clipboard operation
fastNLP copied to clipboard

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.

Results 69 fastNLP issues
Sort by recently updated
recently updated
newest added

你好,我在用Msra数据训练NER任务时,batchsize=8时训练就报cuda内存错误,batchsize=4可正常训练,就是训练迭代次数特别多,使用四GPU2080显卡也是这样问题,分布训练也太慢了,想问下,Msra数据这么吃内存吗,有更好的办法解决没,求教?

代码完全一致,都是自定义了vocab。 ``` with open('checkpoints/vocab_2020-10-09-23-11-21.pickle', 'rb') as f: vocab = pickle.load(f) tst_df = pd.read_csv('data/xxx.csv') tst_data = DataSet(tst_df.to_dict(orient='list')) tst_data.apply(lambda x: list(transform(x['event1'], f2h=False, fb=False)) + ['[SEP]'] + list(transform(x['event2'], f2h=False, fb=False)), new_field_name='words', is_input=True) tst_data.apply(lambda...

dev 分支是我们最新的开发进展,欢迎大家提交 PR。

enhancement

Description:简要描述这次PR的内容 Bugfix embed_loader.py Main reason: 做出这次修改的原因 Some lines in the glove file do not contain an embedded word. There're only embedding vectors in these lines. For these lines, len(line) equals...

Description: Add a training trick: Halve the learning rate if the performance on metrics not improving for [halve_lr_epochs] epochs, and then restart training by loading the previous best model. "halve_lr_epochs"...

Description: Add the YellowFin optimizer,called YFOptimizer. YellowFin is an auto-tuning optimizer based on momentum SGD which requires no manual specification of learning rate and momentum. It measures the objective landscape...

Description:修改StaticEmbedding类中的_load_with_vocab方法,首先读取所有预训练词向量,然后遍历vocab中的word,依次判断原始word、全小写的word、全大写的word以及首字母大写的word是否存在于预训练词向量中,即:原始word匹配失败的话就为word分配一个语义尽可能相似的预训练词向量,从而提升vocab中word匹配到预训练词向量的概率。 Main reason: 原始的_load_with_vocab方法只在读入预训练词向量时,对预训练词向量中的word与vocab中的word进行硬匹配,因此匹配成功率很低,对最终的实验效果影响很大。 Checklist 检查下面各项是否完成 Please feel free to remove inapplicable items for your PR. - [x] The PR title starts with [$CATEGORY] (例如[bugfix]修复bug,[new]添加新功能,[test]修改测试,[rm]删除旧代码) - [x] Changes are complete...

**Describe the bug** 原数据是这样的: 截流 进入 最后 冲刺 ( 附 图片 1 张 ) 天然气 产量 达到 201亿立方米 。 处理后的id转换为汉字是这样的: ['截', '流', '进', '入', '最', '后', '冲', '刺', '(', '附',...

我在用BertForQuestionAnswering 预测时 我是想要答案的,但是结果返回一堆数字 代码如下: `from fastNLP.embeddings import BertEmbedding from fastNLP.models import BertForQuestionAnswering from fastNLP.core.losses import CMRC2018Loss from fastNLP.core.metrics import CMRC2018Metric from fastNLP.io.pipe.qa import CMRC2018BertPipe from fastNLP import Trainer, BucketSampler from...

在demo 使用Bert进行文本匹配,怎么调参数, 给定两句话判断前一句是否和后一句具有因果关系或是否是矛盾关系;或者给定两句话判断两句话是否 具有相同的意思 完成这几个任务