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

How to tokenize Chinese in Node.Js? #7

Open
deemeetree opened this issue May 30, 2018 · 0 comments
Open

How to tokenize Chinese in Node.Js? #7

deemeetree opened this issue May 30, 2018 · 0 comments

Comments

@deemeetree
Copy link

deemeetree commented May 30, 2018

Hello, I'm trying to use your module, but I don't understand how to get the same results in Node.Js as your demo in Chinese in Javascript.

Do I have to train the model each time? Is it possible to do some simple use, that I could just put in the Chinese text and it would just give me the morphemes out, without any training?

I'm using the following code:

var RakutenMA = require('rakutenma');
var fs = require('fs');
var model = JSON.parse(fs.readFileSync("node_modules/rakutenma/model_zh.json"));
var rma = new RakutenMA(model, 1024, 0.007812);
rma.featset = RakutenMA.default_featset_zh;
rma.hash_func = RakutenMA.create_hash_func(15);

console.log(rma.tokenize('叙利亚毒气攻击遭到导弹回应'));

Thank you!

@deemeetree deemeetree changed the title How to tokenize Chinese? How to tokenize Chinese in Node.Js? May 30, 2018
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

No branches or pull requests

1 participant