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

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

Open
Akhila-Yerukola opened this issue Oct 23, 2019 · 8 comments
Open

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

Akhila-Yerukola opened this issue Oct 23, 2019 · 8 comments

Comments

@Akhila-Yerukola
Copy link

No description provided.

@raspberryjoy
Copy link

raspberryjoy commented Dec 2, 2019

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'))

@shramezani
Copy link

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

@raspberryjoy
Copy link

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

@shramezani
Copy link

Thank you :)

@shramezani
Copy link

shramezani commented Jan 9, 2020

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%)

@raspberryjoy
Copy link

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

@janpf
Copy link

janpf commented Jun 24, 2021

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

@raspberryjoy
Copy link

Hello,
No, I gave up ...

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

4 participants