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

update layoutxlm/modeling.py #2285

Merged
merged 2 commits into from
May 31, 2022
Merged

update layoutxlm/modeling.py #2285

merged 2 commits into from
May 31, 2022

Conversation

Intsigstephon
Copy link
Contributor

PR types

Function optimization

PR changes

Models

Description

Add a new model to use Sequence feature to do SER task.

feature_block, axis=0)
start_idx = i

if input_ids[batch_id, i] == 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@@ -911,6 +939,73 @@ def forward(
return outputs


class LayoutXLMForSequenceClassification(LayoutXLMPretrainedModel):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 class 名称改为 LayoutXLMForSegmentClassification 更加合适些

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yingyibiao 为什么呢?不和HF保持一直的目的是?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HF 里面 LayoutXLMForSequenceClassification class 对应的是图片分类任务,这个 PR 里面的则为文本段落分类任务,所以建议换个名字。

@ZeyuChen
Copy link
Member

Merge then fix by PaddleNLP Team. @yingyibiao

@ZeyuChen ZeyuChen merged commit e1014ee into PaddlePaddle:develop May 31, 2022
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

Successfully merging this pull request may close these issues.

3 participants