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

关于RetrievalRE复现的问题 #22

Closed
Facico opened this issue Nov 15, 2022 · 5 comments
Closed

关于RetrievalRE复现的问题 #22

Facico opened this issue Nov 15, 2022 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@Facico
Copy link

Facico commented Nov 15, 2022

您好,非常感谢你们能提供代码以及详细的文档,不过我在复现RetrievalRE相关的时候遇到了些问题。

我在复现Standard RE(文中table3)的semeval时,由于没有提供相关的脚本,我简单的复用k-shot的脚本如下

CUDA_VISIBLE_DEVICES=0 python main.py --max_epochs=30  --num_workers=8 \
    --model_name_or_path roberta-large \
    --accumulate_grad_batches 1 \
    --batch_size 16 \
    --data_dir dataset/semeval/ \
    --check_val_every_n_epoch 1 \
    --data_class WIKI80 \
    --max_seq_length 256 \
    --model_class RobertaForPrompt \
    --t_lambda 0.001 \
    --litmodel_class BertLitModel \
    --task_name wiki80 \
    --lr 3e-5 \
    --use_template_words 0 \
    --init_type_words 0 \
    --output_dir output/semeval/all

得到了0.8895692105838618,经过knn_combine之后得到了0.8916030534351145,和table3中的90.4对不上,可能是相关的setting不对,能提供一下正确的setting吗,非常感谢。

@zxlzr zxlzr added question Further information is requested help wanted Extra attention is needed and removed question Further information is requested labels Nov 15, 2022
@flow3rdown
Copy link
Contributor

您好,可以尝试下batch_size=8进行训练

@Facico
Copy link
Author

Facico commented Nov 15, 2022

我试了一下batch_size=8,纯prompt的方法是0.8922544353093899,和knn retrieval结合是 0.8942598187311178,由于不知道retrieval的方法到底能提升多少,不过看表格来说纯prompt的方法应该不会太高,所以可能是retrieval部分setting的问题?

CUDA_VISIBLE_DEVICES=0 python main.py  --num_workers=8 \
    --model_name_or_path roberta-large \
    --batch_size 16 \
    --data_dir dataset/semeval/ \
    --data_class WIKI80 \
    --max_seq_length 256 \
    --model_class RobertaForPrompt \
    --litmodel_class GetEntityEmbeddingLitModel \
    --task_name wiki80 \
    --use_template_words 0 \
    --init_type_words 0 \
    --best_model ./output/semeval/all/epoch=4-Eval/f1=0.88.ckpt


kshot=16-1
knn_topk=64
knn_lambda=0.5

CUDA_VISIBLE_DEVICES=0 python main.py  --num_workers=8 \
    --model_name_or_path roberta-large \
    --batch_size 8 \
    --data_dir dataset/semeval \
    --data_class WIKI80 \
    --max_seq_length 256 \
    --model_class RobertaForPrompt \
    --litmodel_class CombineEntityEmbeddingLitModel \
    --task_name wiki80 \
    --use_template_words 0 \
    --init_type_words 0 \
    --knn_topk $knn_topk \
    --knn_lambda $knn_lambda \
    --best_model ./output/semeval/all/epoch=4-Eval/f1=0.88.ckpt



@flow3rdown
Copy link
Contributor

用这个脚本纯prompt方法是可以跑到0.899的,retrieval的部分可以调一下knn_lambda

CUDA_VISIBLE_DEVICES=0 python main.py --max_epochs=12  --num_workers=8 \
    --model_name_or_path roberta-large \
    --accumulate_grad_batches 1 \
    --batch_size 8 \
    --data_dir dataset/semeval \
    --check_val_every_n_epoch 1 \
    --data_class WIKI80 \
    --max_seq_length 256 \
    --model_class RobertaForPrompt \
    --t_lambda 0.001 \
    --litmodel_class BertLitModel \
    --task_name wiki80 \
    --lr 3e-5 \
    --use_template_words 0 \
    --init_type_words 0 \
    --output_dir output/semeval/full/

@Facico
Copy link
Author

Facico commented Nov 15, 2022

ok,我知道了,我之前跑的数小是因为被earlystop了导致用的epoch都比较小,改了一下就好了。
thanks

@Facico Facico closed this as completed Nov 15, 2022
@yiyi1333
Copy link

您好,非常感谢你们能提供代码以及详细的文档,不过我在复现RetrievalRE相关的时候遇到了些问题。

我在复现Standard RE(文中table3)的semeval时,由于没有提供相关的脚本,我简单的复用k-shot的脚本如下

CUDA_VISIBLE_DEVICES=0 python main.py --max_epochs=30  --num_workers=8 \
    --model_name_or_path roberta-large \
    --accumulate_grad_batches 1 \
    --batch_size 16 \
    --data_dir dataset/semeval/ \
    --check_val_every_n_epoch 1 \
    --data_class WIKI80 \
    --max_seq_length 256 \
    --model_class RobertaForPrompt \
    --t_lambda 0.001 \
    --litmodel_class BertLitModel \
    --task_name wiki80 \
    --lr 3e-5 \
    --use_template_words 0 \
    --init_type_words 0 \
    --output_dir output/semeval/all

得到了0.8895692105838618,经过knn_combine之后得到了0.8916030534351145,和table3中的90.4对不上,可能是相关的setting不对,能提供一下正确的setting吗,非常感谢。

你好,请问你在复现的时候是否有遇到loss不降低的问题,我的loss一直保持在3.00左右,且f1一直处于0.10左右

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants