[英]deeplearning4j - use Word2Vec for named entity recognition
I am trying to replicate the paper NLP (almost) from scratch using deeplearning4j. 我试图使用deeplearning4j 从头开始复制纸张NLP(差不多) 。 I have done the following steps:
我已完成以下步骤:
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.seed(seed).iterations(iterations)
.learningRate(1e-8f)
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.list(2)
.layer(0, new DenseLayer.Builder()
.nIn(wordVecLayers * windowSize).nOut(hiddenSize)
.activation("relu")
.weightInit(WeightInit.DISTRIBUTION)
.dist(new UniformDistribution(-2.83 / Math.sqrt(hiddenSize), 2.83 / Math.sqrt(hiddenSize)))
.biasInit(0.0f).build())
.layer(1, new OutputLayer.Builder(LossFunction.NEGATIVELOGLIKELIHOOD)
.nIn(hiddenSize).nOut(types.size())
.activation("softmax").weightInit(WeightInit.DISTRIBUTION)
.dist(new UniformDistribution(-2.83 / Math.sqrt(hiddenSize), 2.83 / Math.sqrt(hiddenSize)))
.biasInit(0.0f).build())
.backprop(true).pretrain(false)
.build();
I have tried many different configurations but none of them worked for me. 我尝试了很多不同的配置,但没有一个适合我。 The model keep predicting all words with the 'O'-tag.
该模型使用'O'-tag预测所有单词。 I would appreciate if you can point out what's wrong with my approach?
如果你能指出我的方法有什么问题,我将不胜感激? And what steps I should do next?
接下来我应该采取什么措施? Thank you!
谢谢!
Our word2vec sentiment example is a good place to start: https://github.com/deeplearning4j/dl4j-0.4-examples/tree/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/recurrent/word2vecsentiment 我们的word2vec情绪示例是一个很好的起点: https : //github.com/deeplearning4j/dl4j-0.4-examples/tree/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/recurrent/word2vecsentiment
This covers doing sequence labeling ove word vectors (which is also NER) 这包括对字向量进行序列标记(也是NER)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.