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

篇章级nlp任务 #1606

Closed
ZTurboX opened this issue Jan 24, 2022 · 3 comments
Closed

篇章级nlp任务 #1606

ZTurboX opened this issue Jan 24, 2022 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@ZTurboX
Copy link

ZTurboX commented Jan 24, 2022

对于篇章级nlp任务,比如对篇章进行实体识别,把篇章分成句子集,每次请求是句子集,pipline应该怎么做

@TeslaZhao
Copy link
Collaborator

TeslaZhao commented Jan 25, 2022

有厂内同学使用pipeline serving部署过TTS(Text to Speech)。大致的思路如下:有2个模块构成TTS服务:前端模块 + pipeline serving。前端模型将段落划分为多个句子,多线程请求Serving服务,Serving使用多进程并发处理,将全部推理结果返回后,由前端模块生成语音效果。

由于模型要保密,并没有开源,可参考思路

@TeslaZhao TeslaZhao self-assigned this Jan 25, 2022
@TeslaZhao TeslaZhao added the question Further information is requested label Jan 25, 2022
@ZTurboX
Copy link
Author

ZTurboX commented Jan 25, 2022

有厂内同学使用pipeline serving部署过TTS(Text to Speech)。大致的思路如下:有2个模块构成TTS服务:前端模块 + pipeline serving。前端模型将段落划分为多个句子,多线程请求Serving服务,Serving使用多进程并发处理,将全部推理结果返回后,由前端模块生成语音效果。

由于模型要保密,并没有开源,可参考思路

感谢

@ZTurboX
Copy link
Author

ZTurboX commented Jan 26, 2022

有厂内同学使用pipeline serving部署过TTS(Text to Speech)。大致的思路如下:有2个模块构成TTS服务:前端模块 + pipeline serving。前端模型将段落划分为多个句子,多线程请求Serving服务,Serving使用多进程并发处理,将全部推理结果返回后,由前端模块生成语音效果。

由于模型要保密,并没有开源,可参考思路

试了一下,多线程请求会报错
image

def tags_predict(self, batch_texts): feed = {} for i, item in enumerate(batch_texts): feed[str(i)] = item ret = self.client.predict(feed_dict=feed) batch_pred_tags = ret.value[0] batch_result = eval(batch_pred_tags) return batch_result

p = Pool(5) process_pred_tags = p.starmap(self.tags_predict, process_data)

@paddle-bot paddle-bot bot closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants