Language implimentation
Hi, I am trying to implement Russian language.
I've created train data in Russian and trained the model using .Train() (init.go) function previously added TrainRussianModel() line inside of it. Then I used go-bindata to generate a file and replaced bindata.go with it. bindata.zip this is my version of the compiled model containing Russian language.
The problem is when I am trying to restore the model I am getting this error
panic: json: cannot unmarshal object into Go struct field NaiveBayes.tokenizer of type text.Tokenizer
in this code
models, err := sentiment.Restore()
if err != nil {
panic(err)
}
result := models.SentimentAnalysis("Это отличный фильм!", sentiment.Russian)
mt.Println(result)
The model works if I train it and use it right away after training without trying to save it on the disk.
Someone else had a similar issue a day or two ago. I’m busy right now but can look into it in the next couple of days. I suspect the issue is that this was developed a couple years ago on an earlier version of Go, and hence might need to be updated, but I could be wrong. On Wed, Jun 6, 2018 at 6:09 PM Daniil [email protected] wrote:
Hi, I am trying to implement Russian language.
I've created train data in Russian and trained the model. Then I used go-bindata to generate a file and replaced bindata.go with it. bindata.zip https://github.com/cdipaolo/sentiment/files/2078615/bindata.zip this is my version of the compiled model containing Russian language.
The problem is when I am trying to restore the model I am getting this error
panic: json: cannot unmarshal object into Go struct field NaiveBayes.tokenizer of type text.Tokenizer
in this code
models, err := sentiment.Restore()if err != nil { panic(err) }result := models.SentimentAnalysis("Это отличный фильм!", sentiment.Russian) mt.Println(result)
The model works if I train it and use it right away after training without trying to save it on the disk.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cdipaolo/sentiment/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AI5T9vJJr6vCpYSTv-1a503m9dUnW4XBks5t6H1SgaJpZM4Udlpa .
Hello,
Has there been any updates regarding this issue? I am not trying to implement a new language, but am just changing to a different data set. I am getting the same error and cannot get around it. I have also tried persisting the default model.json to a file and that throws the same error when trying to unmarshal it.
None has been initiated in Nepali translation yet, I want to contribute to this one if that's OK. :) As I am from Nepal, I am good at speaking or writing Nepali.