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

我使用BiLSTMCRF做ner任务,embedding为cn-Bert-base-wwm, 模型开始训练时,Trainer设置save_path 为"./save_model" ,训练完成后生成文件:best_BiLSTMCRF_f_2021-07-06-12-14-12-018221; 随后我想加载现有训练结果继续训练,遂编写callback 为CheckPointCallback(save_path='./save_model/best_BiLSTMCRF_f_2021-07-06-12-14-12-018221') 并在trainer中设置callbacks=[callback]; 在训练报错:/fastNLP/core/callback.py line 949 in on_train_begin, model.load_statea-dict(states['model']) TypeError: 'BiLSTMCRF' object is not subscriptable. 不知道是哪里配置出了问题,请排查一下

我发现读取数据的时候会忽略以#开头的行,这似乎代表#开头的是注释的含义? 但实际上读取的都是数据文件,而不是代码,考虑注释是没必要的吧 更重要的一点,如果数据格式中有以#开头的行,那这样就会跳过本应读取的数据了 我认为#开头的行也应该被读取才合理

在使用StaticEmbedding时,为了兼顾最终模型能够被导出成TorchScript供线上CPP服务使用的时候,遇到一个问题,主要是在创建字典vocab vocab.from_dataset的时候,如果使用了官方推荐的no_create_entry_dataset参数,后续在导出向量weight的时候,其大小会比vocab尺寸更小,使得我在模型中将weight权重赋值给torch原生的nn.Embedding对象后,对某一些越界的token的index就无法解析了,看了一下源码,创建StaticEmbedding传入的vocab对象没有办法被更新(如果这里能够被更新,使得其大小与weight矩阵的大小一致,那么后续对token做index的时候,使用这个更小的vacab,也可以避免这个问题)。 由于显示问题,我把测试样例代码放附件了,更为细节的问题描述也放在了文件中 [test.txt](https://github.com/fastnlp/fastNLP/files/6316645/test.txt)

当使用带有GPU的服务跑代码,保存模型后,放在本地没有gpu的电脑进行模型预测时,报错。 RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your...

enhancement

**Describe the bug** name 'fitlog' is not defined **Screenshots** ![image](https://user-images.githubusercontent.com/5669444/117630385-b6d80100-b1ad-11eb-977c-2ba031ac3aa2.png) **Desktop (please complete the following information):** centos 7

hi,请问_BertWordModel这个类为什么需要利用训练、测试数据的vocab,来重写调整BERT模型的embedding?这种相对于直接用原始的bert有什么优势吗?我发现只是训练字表减小了,这会有什么收益吗?

I saw that there is a Hierarchical Attention Network model included in the directory: reproduction/text_classification/model/HAN.py. I realized that the input for HAN is different from other models (LSTM and CNN):...

非常感谢您提供这个方便快捷的NLP工具,使用fastNLP工具包可以快速实现相关NLP任务。我查看了fastNLP中的说明文档,发现其中的`Tester`方法只支持带标签的数据,没有找到关于对**无标注**数据集的**预测/推理**的功能,希望可以增加此项功能。期待您的回复!

文档里面只有CSVLoader,没有CSVPipe这个类,因为我的csv中只有两列,然后看到文本分类的样例中是情感分类的数据,也是两列数据,所以想问下,我这块可不可以直接使用(不确定性来自情感分类第一列是target,数字类型。而我的第一列全部是字)

enhancement

from fastNLP.embeddings import StaticEmbedding word2vec_embed=StaticEmbedding(None, model_dir_or_name='cn-char-fastnlp-100d') Traceback (most recent call last): File "d:\data\node_with_att_bert_data_tunnel.py", line 175, in word2vec_embed=StaticEmbedding(None, model_dir_or_name='cn-char-fastnlp-100d') File "E:\ProgramData\Anaconda3\lib\site-packages\fastNLP\embeddings\static_embedding.py", line 96, in __init__ super(StaticEmbedding, self).__init__(vocab, word_dropout=word_dropout, dropout=dropout) File "E:\ProgramData\Anaconda3\lib\site-packages\fastNLP\embeddings\embedding.py",...

enhancement