-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 Taskflow word_segmentation and ner tasks #1666
Conversation
…eNLP into add_autosplitter
@@ -21,12 +21,16 @@ | |||
import itertools | |||
|
|||
import numpy as np | |||
import jieba |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议不要直接import jieba,只有在JiebaTask里面使用结巴,并且没有安装进行提示
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如沟通,jieba为默认依赖
self.predictor.run() | ||
pred_tags = self.output_handle[0].copy_to_cpu() | ||
all_pred_tags.extend(pred_tags.tolist()) | ||
with dygraph_mode_guard(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为啥是动态图了? 不应该是静态图吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
all_preds_can.extend([pred_id_can.tolist()]) | ||
pred_ids.extend([pred_id_can[:, 0].tolist()]) | ||
|
||
with dygraph_mode_guard(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
tags_ids = self.output_handle[0].copy_to_cpu() | ||
results.extend(tags_ids.tolist()) | ||
lens.extend(seq_len.tolist()) | ||
with dygraph_mode_guard(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
Others
Description
新增快速、精确模式分词
新增快速模式NER
NER任务支持只返回实体词
新增AutoSplitter/AutoJoiner功能支持无限长文本自动切分: