go-ego / gse

Go efficient multilingual NLP and text segmentation; support English, Chinese, Japanese and others.
Apache License 2.0
2.57k stars 215 forks source link

加载一个8m的字典,但是整个seg就占用很大的内容,整个项目占用内存最大的,有没有什么办法优化? #178

Closed brookxs closed 1 year ago

brookxs commented 1 year ago
  1. Please speak English (English only), this is the language everybody of us can speak and write.
  2. Please take a moment to search that an issue doesn't already exist.
  3. Please ask questions or config/deploy problems on our Gitter channel: https://gitter.im/go-ego/ego
  4. Please give all relevant information below for bug reports, incomplete details will be handled as an invalid report.

You MUST delete the content above including this line before posting, otherwise your issue will be invalid.

//go:embed zh/dictionary.txt
var zhSimpleDict string
var (
    seg gse.Segmenter
)
func Init() (err error) {
    return seg.LoadDictEmbed(zhSimpleDict)
}