mayabot / fastText4j

Implementing Facebook's FastText with java
159 stars 23 forks source link

fasttext的序列化 #11

Closed guanleiming closed 4 years ago

guanleiming commented 5 years ago

你好,因为lateinit修饰wordVector会导致FastText对象序列化失败,采用fastjson的Json.toJsonString,为什么要使用这个修饰符?或者有其他的使用的序列化方法吗?我好放在缓存里面使用,谢谢

guanleiming commented 5 years ago

default 反序列化也有问题,FastText类没有构造函数呀

jimichan commented 5 years ago

贴上代码吧 你是把Fasttext对象整个序列化?

guanleiming commented 5 years ago

default 就是这些了,会报错,没办法序列化

jimichan commented 5 years ago

fastText对象有保存到磁盘的模型文件的方法,不要使用序列化