Git Product home page Git Product logo

guwenbert's Introduction

Ethan-yt

Hey 👋, I'm Ethan!

I'm an algorithm engineer from China, who is interested in Natural Language Processing, Deep Learning, Information Retrieval, and Full-stack Development.

Visitor Count

Visitor Count

guwenbert's People

Contributors

ethan-yt 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  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  avatar  avatar  avatar  avatar  avatar

guwenbert's Issues

去停用词的问题

在做红楼梦对话的情感分析的时候找到了您的文章,想问一下,您这个项目在分词时有没有进行去停用词处理,如果用到了,方便参考一下您的去停用词表嘛。(本人纯小白,刚上手nlp方向,有较多疑惑,望您多包涵)

请问从huggingface下载的模型怎么使用

你好:
我从huggingface上面下载了guwen-punc的模型,通过readme获得到了tokenizer和model。请问我该怎么才能或得到像在huggingface上面api那样或得到json呢

预训练模型的问题

你好,我在调用你的guwenbert-tf的时候 会给我报错 如图
795c7cddecea5de7d833f6b7a61fd60

但是我用roberta的时候并不会

输入两个句子导致索引越界

使用其他模型名字可以使用(代码只改了模型名,全部使用transfomer 的Auto类),使用chinese-bert-wwm或者其他模型可以,但是使用guwenbert报cuda出错,在模型前馈计算时出错
image

添加新的标签

您好!请问如何添加新的标签?我希望增加新的标签,如[POS] [NEG],但是添加在vocab.txt里tokenizer还是无法识别,只能读取成'[' '[UNK]' ']'这样。而且如果增加了vocab.txt的行数,将token输入模型时还会报错index超界。

关于新建词表

看到说明说是基于现代汉语的参数训练的,可词表是重新排序后更新的,请问这样也能work吗?

关于未来的工作计划

古文预训练模型真正的用途是下游任务的处理,目前这个repo只展示了语言模型和专名识别的结果,其中专名识别数据集按照主办方要求是不能公开的,所以未来的工作安排如下:

  1. 根据不同的下游任务整理规范的、划分好的数据集。目前数据来源我只知道可以通过daizhige获取,如果有推荐的其他开放数据源可以回帖补充。整理标准的数据集对整个古文研究都有很大的推进作用,可以便于评测和对比不同的模型表现。
  2. 断句任务。数据集可以通过移除标点生成。
  3. 加注标点任务。数据集生成方式同上。
  4. 书名识别任务。数据集通过抓取字典生成。

欢迎各位补充其他下游任务,注意任务必须是NLU类型任务,暂时不考虑生成式任务。

当然这些工作只有我一个人完成是比较困难的,欢迎有兴趣的朋友联系我,或者在Github留言,一起为促进古文研究的发展作出贡献。

sequence大小问题

您好,我想请教一下如果输入是一段很长的很长的古文(大于512),该如何处理序列呢

感觉效果不太好

fill-mask mask_token:
[CLS] 晋 太 元 中 , 武 [MASK]人 捕 鱼 为 业 。 [SEP]

[CLS] 晋 太 元 中 , 武 昌 人 捕 鱼 为 业 。 [SEP] 0.407
[CLS] 晋 太 元 中 , 武 陵 人 捕 鱼 为 业 。 [SEP] 0.199
[CLS] 晋 太 元 中 , 武 康 人 捕 鱼 为 业 。 [SEP] 0.147
[CLS] 晋 太 元 中 , 武 进 人 捕 鱼 为 业 。 [SEP] 0.082
[CLS] 晋 太 元 中 , 武 阳 人 捕 鱼 为 业 。 [SEP]

预训练语料

问一下,
1.你在预训练阶段使用的什么语料?大概多大规模?
2.预训练时,阶段1和阶段2使用的是相同的语料吗?阶段1训练时是否掺入了现代汉语的语料?

Mask值

你好,我想问一下mask处格式是什么啊,比如输入是 [0, 55, 34, 76, 89, 1, 1, 1, 1],对应的mask是 [1, 1, 1, 1, 1, 0, 0, 0, 0]还是[0, 0, 0, 0, 0, 1, 1, 1, 1]呢?

想请教一下模型结构的问题,为什么模型权重从pooler层之后就没有了

我发现您的模型与原本的roberta模型相比,从pooler层之后就少了一些层(用于MLM训练的一些层)。由于我本人需要用tensorflow版的checkpoint,所以将您的checkpoint转化为了tensorflow版,(可以确保转换脚本没有问题)但是发现在pooler层后少了以下最后几层:
cls/predictions/output_bias (DT_FLOAT) [21128]
cls/predictions/transform/LayerNorm/beta (DT_FLOAT) [768]
cls/predictions/transform/LayerNorm/gamma (DT_FLOAT) [768]
cls/predictions/transform/dense/bias (DT_FLOAT) [768]
cls/predictions/transform/dense/kernel (DT_FLOAT) [768,768]
cls/seq_relationship/output_bias (DT_FLOAT) [2]
cls/seq_relationship/output_weights (DT_FLOAT) [2,768]
global_step (DT_INT64) []
所以当我load权重的时候报错:
tensorflow.python.framework.errors_impl.NotFoundError: Key cls/predictions/transform/dense/kernel not found in checkpoint
意思是'cls/'这几层在checkpoint里没有。这是为什么呢?为什么您的权重会从pooler层后就没有了。。我开始以为是我的转换脚本有问题,后来直接去读您的pytorch checkpoins发现最后也确实是只有pooler那两层:
pooler.dense.weight
pooler.dense.bias
pooler层后面就没有Roberta TensorFlow checkpoint 'cls/'这几层,导致我的模型加载不了TensorFlow checkpoint, 很难受。。为什么会没有呢, 按理说在做MLM预训练的时候这几层必然是要有的才对,我也需要接着您的权重做MLM训练。

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.