Claude-Liu / ReLM

Rephrasing Language Model for CSC (AAAI 2024)
34 stars 4 forks source link

老师您好! 一些复现方面的问题想要请教! #4

Closed Duer666 closed 3 months ago

Duer666 commented 4 months ago

您好!复现论文结果时需要加载relm-m0.3.bin文件并配合README中的参数吗 如果需要的话是使用default=""还是state_dict=torch.load("relm-m0.3.bin")

Claude-Liu commented 4 months ago

你好,

“复现论文结果时需要加载relm-m0.3.bin文件并配合README中的参数吗”: 不需要加载relm-m0.3.bin文件。

readme中的参数是ecspell上微调时的参数。论文中ECSpell的结果是没有使用relm-m0.3.bin的参数。

如果你想基于预训练的结果(relm-m0.3.bin)进行微调,可以使用https://github.com/gingasan/lemon 中的run.py:

from autocsc import AutoCSCReLM

model = AutoCSCReLM.from_pretrained("bert-base-chinese", state_dict=torch.load("relm-m0.3.bin"), cache_dir="cache")

https://github.com/gingasan/lemon 中AutoCSCReLM 和 这里run_relm.py中 对ReLM的代码细节有差异,relm-m0.3.bin是前者训练得到的checkpoints,所以relm-m0.3.bin不能在run_relm.py中直接加载。

----- Mail original ----- De: "Duer666" @.> À: "Claude-Liu/ReLM" @.> Cc: "Subscribed" @.***> Envoyé: Mardi 4 Juin 2024 14:09:19 Objet: [Claude-Liu/ReLM] 老师您好! 一些复现方面的问题想要请教! (Issue #4)

您好!复现论文结果时需要加载relm-m0.3.bin文件并配合README中的参数吗 如果需要的话是使用default=""还是state_dict=torch.load("relm-m0.3.bin")

-- Reply to this email directly or view it on GitHub: https://github.com/Claude-Liu/ReLM/issues/4 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

Duer666 commented 4 months ago

感谢老师的回答! 但目前复现结果与文章稍有出入 是设备或者其他方面的原因吗

Claude-Liu commented 4 months ago

你好,   可以放一下你复现的结果。   另外设置prompt_length可以提高模型的表现 比如 --prompt_length 10  

-----Message original-----

De: Duer666 @.> à: Claude-Liu @.> Cc: Claude-Liu @.>; Comment @.> Envoyé: mardi 4 juin 2024 15:47 CEST Sujet : Re: [Claude-Liu/ReLM] 老师您好! 一些复现方面的问题想要请教! (Issue #4)

  感谢老师的回答! 但目前复现结果与文章稍有出入 是设备或者其他方面的原因吗 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Duer666 commented 4 months ago

感谢您不吝赐教! 按照README中微调的参数复现 使用设备3090 F1分数最高的三次如下: Global step = 1700 | eval precision = 84.18 | eval recall = 94.34 | eval f1 = 88.97 | eval fp rate = 14.89 Global step = 1800 | eval precision = 83.67 | eval recall = 94.72 | eval f1 = 88.85 | eval fp rate = 15.74 Global step = 1900 | eval precision = 84.75 | eval recall = 94.34 | eval f1 = 89.29 | eval fp rate = 14.47 我应当设置prompt_length吗

Claude-Liu commented 4 months ago

对 设置 prompt_length = 10。

----- Mail original ----- De: "Duer666" @.> À: "Claude-Liu/ReLM" @.> Cc: "Claude-Liu" @.>, "Comment" @.> Envoyé: Mercredi 5 Juin 2024 05:17:39 Objet: Re: [Claude-Liu/ReLM] 老师您好! 一些复现方面的问题想要请教! (Issue #4)

感谢您不吝赐教! 按照README中微调的参数复现 使用设备3090 F1分数最高的三次如下: Global step = 1700 | eval precision = 84.18 | eval recall = 94.34 | eval f1 = 88.97 | eval fp rate = 14.89 Global step = 1800 | eval precision = 83.67 | eval recall = 94.72 | eval f1 = 88.85 | eval fp rate = 15.74 Global step = 1900 | eval precision = 84.75 | eval recall = 94.34 | eval f1 = 89.29 | eval fp rate = 14.47 我应当设置prompt_length吗

-- Reply to this email directly or view it on GitHub: https://github.com/Claude-Liu/ReLM/issues/4#issuecomment-2148777883 You are receiving this because you commented.

Message ID: @.***>