Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问词表怎么使用呢? #13

Closed
braveryCHR opened this issue Aug 20, 2019 · 3 comments
Closed

请问词表怎么使用呢? #13

braveryCHR opened this issue Aug 20, 2019 · 3 comments
Labels
question Further information is requested

Comments

@braveryCHR
Copy link

作者你好,我之前finetune过bert,但是我拿到您的xlnet后,发现其词表和bert的形式(txt格式)不一样,我想知道该如何使用这个预训练模型呢,有相关的库吗,例如pytorch_pretrained_bert这个库(我用pytorch)?

@ymcui ymcui added the question Further information is requested label Aug 20, 2019
@ymcui
Copy link
Owner

ymcui commented Aug 20, 2019

需要搭配sentencepiece工具使用,参考 https://github.com/ymcui/Chinese-PreTrained-XLNet#生成词表

@NealRichardRui
Copy link

作者你好,我之前finetune过bert,但是我拿到您的xlnet后,发现其词表和bert的形式(txt格式)不一样,我想知道该如何使用这个预训练模型呢,有相关的库吗,例如pytorch_pretrained_bert这个库(我用pytorch)?

安装pytorch_transformers

from pytorch_transformers import XLNetTokenizer
tokenizer = XLNetTokenizer.from_pretrained('你下载的预训练文件夹')

@braveryCHR
Copy link
Author

作者你好,我之前finetune过bert,但是我拿到您的xlnet后,发现其词表和bert的形式(txt格式)不一样,我想知道该如何使用这个预训练模型呢,有相关的库吗,例如pytorch_pretrained_bert这个库(我用pytorch)?

安装pytorch_transformers

from pytorch_transformers import XLNetTokenizer
tokenizer = XLNetTokenizer.from_pretrained('你下载的预训练文件夹')

太谢谢啦~感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants