syuoni / eznlp

Easy Natural Language Processing
Apache License 2.0
130 stars 21 forks source link

请问我想在您的boundary smoothing 实体抽取代码上进行修改并且重新训练 我应该在命令行中输入什么指令重新训练模型? #43

Closed ShaoZhangHao closed 8 months ago

syuoni commented 9 months ago

你好,

如果你是指在 BERT 的基础上 finetune,可以参考 https://github.com/syuoni/eznlp/blob/master/docs/boundary-smoothing.md ,里面有 finetune 模型的命令。

Boundary smoothing 的核心逻辑在 https://github.com/syuoni/eznlp/blob/29eda45aa2e13adfc76d22b2cbc229ee10fcf02a/eznlp/model/decoder/boundaries.py#L167-L185 你可以根据需要进行修改。

ShaoZhangHao commented 9 months ago

你好,

如果你是指在 BERT 的基础上 finetune,可以参考 https://github.com/syuoni/eznlp/blob/master/docs/boundary-smoothing.md ,里面有 finetune 模型的命令。

Boundary smoothing 的核心逻辑在

https://github.com/syuoni/eznlp/blob/29eda45aa2e13adfc76d22b2cbc229ee10fcf02a/eznlp/model/decoder/boundaries.py#L167-L185

你可以根据需要进行修改。

非常感谢你的帮助 我还想问一下 boundary smoothing是只能运行在English datasets

CoNLL 2003. OntoNotes 5: Download from https://catalog.ldc.upenn.edu/LDC2013T19; Process following Pradhan et al. (2013). ACE 2004: Download from https://catalog.ldc.upenn.edu/LDC2005T09; Process following Lu and Roth (2015). ACE 2005: Download from https://catalog.ldc.upenn.edu/LDC2006T06; Process following Lu and Roth (2015). Chinese datasets

OntoNotes 4: Download from https://catalog.ldc.upenn.edu/LDC2011T03; Process following Che et al. (2013). MSRA: Download from https://github.com/v-mipeng/LexiconAugmentedNER. Weibo NER: Download from https://github.com/hltcoe/golden-horse. Resume NER: Download from https://github.com/jiesutd/LatticeLSTM. 这些数据集上呢 还是说没有提到的conll2004也可以使用?

syuoni commented 9 months ago

Boundary smoothing 论文里在这几个数据集上做了实验,所以这里只列举了这些数据集。 Boundary smoothing 是基于 biaffine 的 span-based NER 方法,理论上所有 flat 或 nested NER 数据集都能跑,但不适用 discontinuous NER。CoNLL 2004 应该是可以用的。

syuoni commented 9 months ago

我不清楚你要做的 CoNLL 2004 具体是哪个版本的,但你可以参考 https://github.com/syuoni/eznlp/blob/master/data/conll2004/demo.conll04_train.json ,这里的格式整理数据,结合代码逻辑,应该就能跑起来了。

ShaoZhangHao commented 9 months ago

我不清楚你要做的 CoNLL 2004 具体是哪个版本的,但你可以参考 https://github.com/syuoni/eznlp/blob/master/data/conll2004/demo.conll04_train.json ,这里的格式整理数据,结合代码逻辑,应该就能跑起来了。

好的非常感谢 我刚接触命名实体识别这方面的论文 数据集格式方面还不太清楚 我会再摸索一下 非常感谢回答