oposum icon indicating copy to clipboard operation
oposum copied to clipboard

When would the code to train and test models be added?

Open Akhila-Yerukola opened this issue 4 years ago • 8 comments

Akhila-Yerukola avatar Oct 23 '19 22:10 Akhila-Yerukola

I am also trying to run this code for the MATE model.

After running prep_mate.sh I continued with the following :

python prep_hdf5.py --w2v ../w2v/tv.bin --name ../data/preprocessed/TV_MATE --data ../data/train/tv.trn --lemmatize

python prep_hdf5_test.py --data ../data/gold/aspects/tv-tst.asp --name ../data/preprocessed/TV_MATE_TEST --vocab ../data/preprocessed/TV_MATE_word_mapping.txt --products ../data/preprocessed/TV_MATE_product_mapping.txt --lemmatize

if running on python 3.6 , in prep_hdf5.py and prep_hdf5_test.py this line (line 186 in prep_hdf5_test, and 302 in prep_hdf5) data, labels, products, scodes, original = zip(*sorted(sample(zip(data, labels, products, scodes, original), len(data)),key=lambda x:len(x[0])))

should be changed to this: data, labels, products, scodes, original = zip(*sorted(sample(zip(data, labels, products, scodes, original), len(data)),key=lambda x:len(x[0])))

data, products, scodes, original = zip(*sorted(sample(list(zip(data, products, scodes, original)) , len(data)),key=lambda x:len(x[0])))

Also the following lines

scodes.append(scode) original.append(orig[i])

should be changed to the following (because of the No conversion path for dtype: dtype error)

scodes.append(scode.encode('utf8')) original.append(orig[i].encode('utf8'))

raspberryjoy avatar Dec 02 '19 13:12 raspberryjoy

Hi raspberryjoy, Do you know any script example for training/evaluating the model?

shramezani avatar Dec 19 '19 02:12 shramezani

Hi raspberryjoy, Do you know any script example for training/evaluating the model?

Hello, I am trying to train the aspect encoder using the following command.

python mate.py ../data/preprocessed/TV_MATE --test_data ../data/preprocessed/TV_MATE_TEST --min_len 2 --aspects 10 --aspect_seeds ../data/seeds/tv.5-weights.txt --recon_method centr --kmeans --kmeans_iter 5 --attention --negative 20 --fix_w_emb --fix_a_emb --epochs 10 --lr 0.001 --l 1

raspberryjoy avatar Dec 20 '19 07:12 raspberryjoy

Thank you :)

shramezani avatar Jan 08 '20 05:01 shramezani

Hi raspberryjoy, Do you know any script example for training/evaluating the model?

Hello, I am trying to train the aspect encoder using the following command.

python mate.py ../data/preprocessed/TV_MATE --test_data ../data/preprocessed/TV_MATE_TEST --min_len 2 --aspects 10 --aspect_seeds ../data/seeds/tv.5-weights.txt --recon_method centr --kmeans --kmeans_iter 5 --attention --negative 20 --fix_w_emb --fix_a_emb --epochs 10 --lr 0.001 --l 1

Thank you for your response. Another question; Did you get F1~ 50% for aspect extraction using mate model? the result I'm getting is really bad ( less than 20%)

shramezani avatar Jan 09 '20 03:01 shramezani

I have not been able to evaluate the model. I am still having some issues trainning the mate model in my cuda setup.

raspberryjoy avatar Jan 09 '20 16:01 raspberryjoy

Did you pursue this further and were able to train/evaluate the models?

janpf avatar Jun 24 '21 09:06 janpf

Hello, No, I gave up ...

raspberryjoy avatar Jun 24 '21 11:06 raspberryjoy