SenticNet / personality-detection

Implementation of a hierarchical CNN based model to detect Big Five personality traits
http://sentic.net/deep-learning-based-personality-detection.pdf
MIT License
475 stars 167 forks source link

How to use and predict all the five traits? #1

Closed JafferWilson closed 6 years ago

JafferWilson commented 6 years ago

Hi, I was just going through your repository and I like the way you have explain regarding the project. But I can see while training we are just passing one traits number; for example in your sample you have used 2 code and started the training. But what if for others?

Also you have not mentioned anything related to the model usage after training. Kindly answer the questions I have. Thank you in advance.

JafferWilson commented 6 years ago

Is there any one please guide me?

SenticNet commented 6 years ago

Dear Jaffer,

Sorry for belated response. We were all busy with AAAI submissions. The param to select different trait varies from 0 to 4.

JafferWilson commented 6 years ago

Yes I understood that the param are from 0 to 4. But I see only this statement:
python conv_layer_train.py -static -word2vec 2

which I guess is for training only. How the predict statement works. Kindly add it in the Read.me file of your repository. All the Best for your Submissions.

advanced4 commented 6 years ago

Second'ing Jaffer's comment;

Your readme only contains instructions for pre-processing & training. Could you update it to reflect how to actually detect personality traits when given text data?

JafferWilson commented 6 years ago

@advanced4 I didn't got you. Can you please make me understand what you in need of?

naikzinal commented 6 years ago

@JafferWilson you solve the python conv_layer_train.py -static -word2vec 2 ? i got error Traceback (most recent call last): File "conv_net_train.py", line 476, in activations=[Sigmoid]) File "conv_net_train.py", line 179, in train_conv_net allow_input_downcast = True) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/function.py", line 266, in function profile=profile) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 489, in pfunc no_default_updates=no_default_updates) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 241, in rebuild_collect_shared cloned_v = clone_v_get_shared_updates(outputs, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates clone_a(v.owner, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 131, in clone_a clone_v_get_shared_updates(i, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates clone_a(v.owner, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 131, in clone_a clone_v_get_shared_updates(i, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates clone_a(v.owner, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 131, in clone_a clone_v_get_shared_updates(i, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates clone_a(v.owner, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 131, in clone_a clone_v_get_shared_updates(i, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates clone_a(v.owner, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 131, in clone_a clone_v_get_shared_updates(i, copy_inputs_over) File "/home/zinal/.local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 92, in clone_v_get_shared_updates clone_a(v.owner, copy_inputs_over)

can u please help me i did't understand the error .. i

JafferWilson commented 6 years ago

@naikzinal What is the version of your Theano library? I guess the issue is due to the recent library used, the updated one.

naikzinal commented 6 years ago

dear jafferWilson i have check my theano version still i have that issue . can you please help me. thank you

JafferWilson commented 6 years ago

@naikzinal What is the version?

naikzinal commented 6 years ago

@JafferWilson theano 0.7

naikzinal commented 6 years ago

@JafferWilson but i dont understand the meaning theano 0.7(tested) what is the meaning of tested?

JafferWilson commented 6 years ago

@naikzinal I guess, you need a fresh installation. Please try using some other system and then use it. I don't find any problem if your version is correct.

naikzinal commented 6 years ago

which kind of system you used for run the code? @JafferWilson

JafferWilson commented 6 years ago

@naikzinal I have used my Virtual box or Virtual Machine with ubuntu 16.04(updated). What system you have tried?

naikzinal commented 6 years ago

i also use ubuntu 16.04. @JafferWilson

JafferWilson commented 6 years ago

@naikzinal Try once again with fresh installation. Better use VM for your experiment then on the right machine.

naikzinal commented 6 years ago

ok i will try . thank you

naikzinal commented 6 years ago

heloo, while running the conv_net_train.py i found the error

loading data... data loaded! model architecture: CNN-static using: word2vec vectors [('image shape', 153, 300), ('filter shape', [(200, 1, 1, 300), (200, 1, 2, 300), (200, 1, 3, 300)]), ('hidden_units', [200, 200, 2]), ('dropout', [0.5, 0.5, 0.5]), ('batch_size', 50), ('non_static', False), ('learn_decay', 0.95), ('conv_non_linear', 'relu'), ('non_static', False), ('sqr_norm_lim', 9), ('shuffle_batch', True)] Traceback (most recent call last): File "conv_net_train.py", line 477, in activations=[Sigmoid]) File "conv_net_train.py", line 123, in train_conv_net convfeats, = theano.scan(fn= convolve_user_statuses, sequences= layer0_input) File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan.py", line 745, in scan condition, outputs, updates = scan_utils.get_updates_and_outputs(fn(args)) File "conv_net_train.py", line 115, in convolve_user_statuses layer1_inputs.append(conv_layer.set_input(input=relv_input).flatten(2)) File "conv_net_classes.py", line 393, in set_input conv_out = conv.conv2d(input=input, filters=self.W,filter_shape=self.filter_shape, image_shape=self.image_shape) File "/usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/conv.py", line 151, in conv2d return op(input, filters) File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 507, in call node = self.make_node(inputs, **kwargs) File "/usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/conv.py", line 628, in make_node "inputs(%s), kerns(%s)" % (_inputs.dtype, _kerns.dtype)) NotImplementedError: The image and the kernel must have the same type.inputs(float64), kerns(float32)

please any one can help me. thank you

naikzinal commented 6 years ago

dear @JafferWilson heloo, while running the conv_net_train.py i found the error

loading data... data loaded! model architecture: CNN-static using: word2vec vectors [('image shape', 153, 300), ('filter shape', [(200, 1, 1, 300), (200, 1, 2, 300), (200, 1, 3, 300)]), ('hidden_units', [200, 200, 2]), ('dropout', [0.5, 0.5, 0.5]), ('batch_size', 50), ('non_static', False), ('learn_decay', 0.95), ('conv_non_linear', 'relu'), ('non_static', False), ('sqr_norm_lim', 9), ('shuffle_batch', True)] Traceback (most recent call last): File "conv_net_train.py", line 477, in activations=[Sigmoid]) File "conv_net_train.py", line 123, in train_conv_net convfeats, = theano.scan(fn= convolve_user_statuses, sequences= layer0_input) File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan.py", line 745, in scan condition, outputs, updates = scan_utils.get_updates_and_outputs(fn(args)) File "conv_net_train.py", line 115, in convolve_user_statuses layer1_inputs.append(conv_layer.set_input(input=relv_input).flatten(2)) File "conv_net_classes.py", line 393, in set_input conv_out = conv.conv2d(input=input, filters=self.W,filter_shape=self.filter_shape, image_shape=self.image_shape) File "/usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/conv.py", line 151, in conv2d return op(input, filters) File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 507, in call node = self.make_node(inputs, **kwargs) File "/usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/conv.py", line 628, in make_node "inputs(%s), kerns(%s)" % (_inputs.dtype, _kerns.dtype)) NotImplementedError: The image and the kernel must have the same type.inputs(float64), kerns(float32)

And i want to know that which device you used for run the code gpu or cpu?i think i have a problem in Theanorc file what is yr configuration for Theanorc file? thank you

JafferWilson commented 6 years ago

My system works on CPU and GPU. But I ran the process on CPU.

naikzinal commented 6 years ago

@JafferWilson ok, thank you for a reply. what is your theanorc file configuration?

radhikakuttala commented 6 years ago

@JafferWilson Did you got output after running the conv_net_train.py? I am struck ed in this step.can you please help.

Thanks in advance.

JafferWilson commented 6 years ago

@radhikakuttala I tried it way before.. Now I do not have anything. Frankly, its results wasted time. Hence, do not want to discuss about it. For your answer, yes I got the output.

nitinbhardwaj2489 commented 6 years ago

Hi Guys

While running the conv_net_train.py I found the error

loading data... data loaded! model architecture: CNN-static using: word2vec vectors [('image shape', 153, 300), ('filter shape', [(200, 1, 1, 300), (200, 1, 2, 300), (200, 1, 3, 300)]), ('hidden_units', [200, 200, 2]), ('dropout', [0.5, 0.5, 0.5]), ('batch_size', 50), ('non_static', False), ('learn_decay', 0.95), ('conv_non_linear', 'relu'), ('non_static', False), ('sqr_norm_lim', 9), ('shuffle_batch', True)] Traceback (most recent call last): File "conv_net_train.py", line 477, in activations=[Sigmoid]) File "conv_net_train.py", line 123, in train_conv_net convfeats, = theano.scan(fn= convolve_user_statuses, sequences= layer0_input) File "/usr/local/lib/python2.7/dist-packages/theano/scan_module/scan.py", line 745, in scan condition, outputs, updates = scan_utils.get_updates_and_outputs(fn(args)) File "conv_net_train.py", line 115, in convolve_user_statuses layer1_inputs.append(conv_layer.set_input(input=relv_input).flatten(2)) File "conv_net_classes.py", line 393, in set_input conv_out = conv.conv2d(input=input, filters=self.W,filter_shape=self.filter_shape, image_shape=self.image_shape) File "/usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/conv.py", line 151, in conv2d return op(input, filters) File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 507, in call node = self.make_node(inputs, **kwargs) File "/usr/local/lib/python2.7/dist-packages/theano/tensor/nnet/conv.py", line 628, in make_node "inputs(%s), kerns(%s)" % (_inputs.dtype, _kerns.dtype)) NotImplementedError: The image and the kernel must have the same type.inputs(float64), kerns(float32)

I am using theano 0.7, pandas 0.18.0 and Python 2.7 ( which is mentioned in the read me file). I have tried all combinations of these three ( Python 2.7 and 3.5), Theano ( 0.7,0.8,0.9,1.0) and pandas( 0.18.0,0.22.0)

Can you help me with this issue ? Also how can I use these to get all the five personality traits in one go using the trained model ? Thanks for your help! Nitin

mr-yamraj commented 6 years ago

@JafferWilson Are you able to find the answer to this issue? Can you please share it with us.

ahmedabdelbadie commented 6 years ago

this is exactly what i want @JafferWilson how to use and predict all the five traits throws this code if you found or create any solution for this problem

mgene123 commented 6 years ago

Hi @SenticNet i read your papers and do my effort to run the code but i have some questions 1)what is content of mairesse file and how get it 2)how use this code to get big five traits through text input

mgene123 commented 6 years ago

Hi @JafferWilson did you found any solution to your problem

mgene123 commented 6 years ago

@SenticNet

nmder commented 6 years ago

Please check the pre-processing section of readme to know about the generation of mairesse feature.

sg1719 commented 5 years ago

Hi @JafferWilson, if you can help me please with the code used to predict the five traits using trained model. @SenticNet