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

结构化的自注意句子嵌入 #177

Open
ziwang-com opened this issue Jul 7, 2023 · 0 comments
Open

结构化的自注意句子嵌入 #177

ziwang-com opened this issue Jul 7, 2023 · 0 comments

Comments

@ziwang-com
Copy link
Owner

https://github.com/kaushalshetty/Structured-Self-Attention
结构化的自注意句子嵌入
论文A Structured Self-Attentive Sentence Embedding的实现,该论文发表在ICLR 2017:https://arxiv.org/abs/1703.03130 上。

image

用法:
对于 imdb 数据集上的二进制情绪分类,请运行:python classification.py "binary"

对于路透社数据集上的多类分类,请运行:python classification.py "multiclass"

您可以在文件中更改模型参数,例如注意力跳数等。model_params.json fileconfig.json

如果要使用预训练手套嵌入,请将参数设置为 ,默认设置为 False。不要忘记下载并将其放在手套文件夹中。use_embeddings"True"glove.6B.50d.txt

实现:
使用自我注意进行分类
使用弗罗贝尼乌斯范数的正则化
渐变剪切
可视化注意力权重

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

No branches or pull requests

1 participant