kcws icon indicating copy to clipboard operation
kcws copied to clipboard

能不能提供一个通用Python训练代码啊

Open forever1dream opened this issue 7 years ago • 4 comments

train_cws.py 训练 输入特征:字的 word2vec向量表示 train_pos.py 训练 输入特征是:词的 word2vec向量表示,文档写的最大50个词,向量的1-50是词的word2vec表示,不够的用0填充;字的word2vec向量表示,每个词最大5个词,超过5个字的用最后一个字代替第五个字,就是一个50X5的向量;词性标注结果个词的向量长度一致50,所以训练语料是长度为350的向量,1-50是词,51-300是字,301-350是预测结果。 想写一个train NE 的代码模仿train_pos.py: 1-50词,51-300字,301-350词性,NE表示和字序列类似每个最大长度15,就是15X50,351-1100是预测结果,但是改代码失败了 能不能一个train.py, 准备好训练语料之后,自定义特征以及对应的特征长度,还有定义输出 对Python不熟悉,想用这个训练model之后C++直接调用,求大神指教。

forever1dream avatar Apr 03 '18 09:04 forever1dream

我这边最近在使用,所以把训练和使用模型封装了下: https://github.com/AlleyEli/kcws 你可以看readme最上面加的部分,进行操作!

AlleyEli avatar May 16 '18 02:05 AlleyEli

Alley [email protected]于2018年5月16日 周三10:13写道:

我这边最近在使用,所以把训练和使用模型封装了下: https://github.com/AlleyEli/kcws 你可以看readme最上面加的部分,进行操作!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/koth/kcws/issues/115#issuecomment-389372620, or mute the thread https://github.com/notifications/unsubscribe-auth/ADxsF9nsGVobAWgoskSTmlWks23aCoylks5ty4tMgaJpZM4TEtOC .

好的,多谢啦

forever1dream avatar May 18 '18 02:05 forever1dream

@forever1dream 不好意思,才发现两边同一个人 嘿嘿! 有缘

AlleyEli avatar May 18 '18 03:05 AlleyEli

@AlleyEli 哈哈 我不怎么会Python

forever1dream avatar May 18 '18 03:05 forever1dream