Skip to content

Conversation

@Karyl01
Copy link

@Karyl01 Karyl01 commented May 12, 2025

##目的:
优化 BERT 特征提取性能,解决原项目在处理长文本时速度较慢的问题。

##改动内容:

  • 封装 CachedBertExtractor 模块,支持自动缓存特征结果。
  • 引入 lru_cache 对 BERT 编码进行缓存。
  • 使用 torch.jit.script 加快推理过程。
  • 打包batch块并多线程传入提取BERT特征

##关联 Issue:
Closed #2364

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.

提取文本Bert特征5.16it/s,如何提升处理速度

1 participant