huanghonggit / mask-language-model Goto Github PK
View Code? Open in Web Editor NEWpytorch; mask language model ; bert
License: Apache License 2.0
pytorch; mask language model ; bert
License: Apache License 2.0
When we run preprocess.py with arguments -i . Here which corpus.txt you are referring to. I have read all the readme files from (data/sst-2/original). still have some questions.
需不需要把词表按照高低频 做Adaptive Softmax呢?
我实际预测的时候发现,模型Top10基本都是高频词,mask低频词的时候基本猜不出来
我跳过0步骤,直接执行1,2步骤,出现了下面的错误
Traceback (most recent call last):
File "D:\XH\NLP\Correct\LuckyHouse-Mask-Language-Model-master_org\Mask-Language-Model\driver\pretrain.py", line 105, in train
mask_lm_output, attn_list = self.model.forward(data["mlm_input"], data["input_position"])
File "D:\XH\NLP\Correct\LuckyHouse-Mask-Language-Model-master_org\Mask-Language-Model\model\language_model.py", line 23, in forward
x, attn_list = self.bert(x, pos)
File "C:\ProgramData\Miniconda3\envs\tensorflow\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "D:\XH\NLP\Correct\LuckyHouse-Mask-Language-Model-master_org\Mask-Language-Model\model\bert.py", line 50, in forward
pos = self.pos_emb(pos)
File "C:\ProgramData\Miniconda3\envs\tensorflow\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "C:\ProgramData\Miniconda3\envs\tensorflow\lib\site-packages\torch\nn\modules\sparse.py", line 118, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "C:\ProgramData\Miniconda3\envs\tensorflow\lib\site-packages\torch\nn\functional.py", line 1454, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: index out of range at c:\n\pytorch_1559129895673\work\aten\src\th\generic/THTensorEvenMoreMath.cpp:191
还有个问题为什么最小单位是字母而不是单词?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.