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

Add NPTag #1246

Merged
merged 27 commits into from
Nov 10, 2021
Merged

Add NPTag #1246

merged 27 commits into from
Nov 10, 2021

Conversation

linjieccc
Copy link
Contributor

@linjieccc linjieccc commented Oct 27, 2021

PR types

New features

PR changes

Models

Description

  1. Add ErnieCtmNptagModel & ErnieCtmMLMHead
  2. Add ErnieCtmNptag pretrained model parameters & weights
  3. Add knowledge_mining-nptag task for Taskflow
  4. Support static mode inference for ErnieCtmNptagModel
  5. Add NPTag finetune example (train + predict + deploy)

@wawltor wawltor self-requested a review October 28, 2021 07:29
task(string): The name of task.
model(string): The model name in the task.
batch_size(int): Numbers of examples a batch.
linking(bool): Returns the categories. The fine-grained labels (cls_label) will link with the coarse-grained labels (category).
Copy link
Member

Choose a reason for hiding this comment

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

需要注明If true xxxx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

for i in range(1, m + 1):
for j in range(1, n + 1):
if s1[i - 1] != s2[j - 1]:
if len(s1) == 1 or len(s2) == 1:
Copy link
Member

Choose a reason for hiding this comment

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

这个dp的判断是必须的吗?想这种长度唯一的边界判断是不是在初始化时候就可以完成了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed



class BurkhardKellerNode(object):
"""Node implementation.
Copy link
Member

Choose a reason for hiding this comment

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

丰富下这里的注释

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@linjieccc linjieccc marked this pull request as ready for review November 8, 2021 12:26
ZeyuChen
ZeyuChen previously approved these changes Nov 10, 2021
Copy link
Member

@ZeyuChen ZeyuChen left a comment

Choose a reason for hiding this comment

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

LGTM



class BurkhardKellerNode(object):
"""Node implementatation for BK-Tree. A BK-Tree node stores the information of current word, and its approximate words calculated by levenstein distance.
Copy link
Member

Choose a reason for hiding this comment

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

代码格式这里有yapf过吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

代码已整体yapf扫描

@ZeyuChen ZeyuChen self-assigned this Nov 10, 2021
@CLAassistant
Copy link

CLAassistant commented Nov 10, 2021

CLA assistant check
All committers have signed the CLA.

@ZeyuChen ZeyuChen merged commit 06bf0e4 into PaddlePaddle:develop Nov 10, 2021
@linjieccc linjieccc deleted the add_nptag branch November 10, 2021 06:44
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.

None yet

3 participants