Getting Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException while retraining the stanford sentiment RNN -
i trying retrain stanford sentiment rnn own dataset have converted ptb format using buildbinarizeddataset stanford-core-nlp jar (3.8)
here first few lines of training data:
(9 (9 (5 very) (7 well)) (5 handled))
(7 (6 engineers) (4 (4 to) (5 (6 answer) (6 (5 very) (3 carefully)))))
(9 (9 (9 (8 fast) (5 and)) (9 reliable)) (9 (4 response) (9 great)))
(8 (7 prompt) (7 (5 responses) (8 (5 fixed) (1 (4 the) (0 issue)))))
this command used :
java -cp "*"
-mx8g edu.stanford.nlp.sentiment.sentimenttraining
-gradientcheck
-trainpath train_s.txt -equivalenceclasses 0,1,2,3,4,5;6,7,8,9,10
-equivalenceclassnames negative,neutral,positive
-numhid 25
-batchsize 78
-numclasses 2
-classnames negative,positive
-train
-model modeltrial.ser.gz
and exception:
exception in thread "main" java.lang.arrayindexoutofboundsexception: 9
@ org.ejml.data.d1matrix64f.set(unknown source) @ org.ejml.simple.simplebase.set(unknown source) @ edu.stanford.nlp.sentiment.sentimentcostandgradient.backpropderivativesanderror(sentimentcostandgradient.java:376) @ edu.stanford.nlp.sentiment.sentimentcostandgradient.backpropderivativesanderror(sentimentcostandgradient.java:354) @ edu.stanford.nlp.sentiment.sentimentcostandgradient.scorederivatives(sentimentcostandgradient.java:223) @ edu.stanford.nlp.sentiment.sentimentcostandgradient.calculate(sentimentcostandgradient.java:249) @ edu.stanford.nlp.optimization.abstractcachingdifffunction.ensure(abstractcachingdifffunction.java:140) @ edu.stanford.nlp.optimization.abstractcachingdifffunction.derivativeat(abstractcachingdifffunction.java:151) @ edu.stanford.nlp.optimization.abstractcachingdifffunction.gradientcheck(abstractcachingdifffunction.java:39) @ edu.stanford.nlp.sentiment.sentimenttraining.rungradientcheck(sentimenttraining.java:129) @ edu.stanford.nlp.sentiment.sentimenttraining.main(sentimenttraining.java:226)
these options working with
general options
randomseed=1659449035
wordvectors=null
unkword=unk
randomwordvectors=true
numhid=25
numclasses=2
lowercasewordvectors=false
usetensors=true
simplifiedmodel=true
combineclassification=true
classnames=negative,positive
equivalenceclasses=0,1,2,3,4,5;6,7,8,9,10
equivalenceclassnames=negative,neutral,positive
train options
batchsize=78
epochs=400
debugoutputepochs=8
maxtraintimeseconds=86400
learningrate=0.01
scalingforinit=1.0
classweights=null
regtransformmatrix=0.001
regtransformtensor=0.001
regclassification=1.0e-4
regwordvector=1.0e-4
initialadagradweight=0.0
adagradresetfrequency=1
shufflematrices=true
initialmatrixlogpath=null
nthreads=1
test options
ngramrecordsize=0
ngramrecordmaximumlength=0
printlengthaccuracies=false
my training data has around 4800 sentences. first time working stanford core nlp , far no other links have helped me.
Comments
Post a Comment