7
$\begingroup$

I have a data set like this:

postID  Sentence                                         drugYesOrNo
1       He went out with his friends    
2       He behaved nicely while talking with me 
3       He stopped using drugs after a while                 1
4       He did not meet any friend during last week 
1       He slowly cut usage of drugs                         1
2       He smiled like he is good   
3       He did not seem happy with his situation    

As you see there is two features. the first feature is our sentence and the second feature shows is this sentence is a sign that patient has stopped his drug or not.

the first column shows that sentence which are part of a paragraph. for example HERE sentence 1-4 are one paragraph in which we have splited them to see which sentence exactly show the stopping of drugs. so sentence 3 in first paragraph shows this.

In the second case, sentence 1-3 is part of a paragraph. here sentence one shows that this person stopped using drugs(which is not good the person should continue)

so my goal is to apply a deep learning text classifier on my text data and make a model and so when I received A NEW PARAGRAPH, I will be able to predict if the person has stopped his drugs or not.

first question, with this case study, which deep learning text classifier may work best?

Secondly, as you see we have cut the paragraph in to series of the sentences. but in reality we will give a paragraph to test the model. in your idea what will be the best approach to deal with this?

the thing that came to my mind is that while testing and receiving a paragraph, we again split the paragraph to sentences and give those sentences to the model but I am not sure it is a good approach.

we have 900 of these sentences, again Im not sure with this much of data it will be goof to apply deep learning classifier on it.

I appreciate it if you give me your point of view:)

Update after reading comments

I asked a couple of guys to make such a dataset for me. I mean looking at paragraph, spliting, then saying which sentence has that meaning(stopping drugs or not). what if I did not ask them to explicitly say which sentence does have that meaning and just point which paragraph does have that meaning(stopping drugs or not). do you think labeling exactly which sentence does have that meaning has been a good idea rather than which paragraph does have that meaning? I hope I am clear enough :)

$\endgroup$

1 Answer 1

5
$\begingroup$

Yes, you should split the paragraph to sentences and give those sentences to the model. Your deep structure should be like this:

In the first layer, you must put a word embedding layer to represent a sentence as a sequence of vectors. In the second layer, you must put LSTM to be able to model your sequence vector as a single vector. Now, you can add successive layers with linear, relu or sigmoid activation functions to make your model deeper. In the last layer, you must use sigmoid activation function to do binary classification.

$\endgroup$
10
  • $\begingroup$ Thanks for your answer. do you think 1000 paragraph or almost 5000 sentence is enough for LSTM to give a good result? $\endgroup$
    – Maria
    May 30, 2018 at 20:22
  • $\begingroup$ You’re welcome. Yes, it seems enough. $\endgroup$
    – pythinker
    May 31, 2018 at 5:10
  • $\begingroup$ Why you did not suggest not look at the paragraphs as aseries of sentences but look at that as a paragraph. so in this case we have a paragraph and pass the whole paragraph to the model. then if there was any sentence on the paragraph which shows the patient stopped using drugs it is 1 otherwise it is 0. I mean do you think spliting like this in which shows which sentence has that information may help the model to accurately predict? sorry I just want to make sure and it becomes logical work to do.:) $\endgroup$
    – Maria
    May 31, 2018 at 13:45
  • $\begingroup$ To be more accurate, when you are dealing with a paragraph, you must split it to sub-paragraphs so each sub-paragraph corresponds to only on label (using or not using drugs). Then, you must pass each sub-paragraph to the model as a single observation. $\endgroup$
    – pythinker
    May 31, 2018 at 13:55
  • $\begingroup$ I guess I did not get what do u mean exactly:| you can also say in persian I will get to the point ;). lets back to the question, I asked a couple of guys to make such a dataset for me. I mean looking at paragraph, spliting, then saying which sentence has that meaning. what if I did not ask them to explicitly say which sentence does have that meaning and just point which paragraph does have that meaning(stopping drugs or not). do you think labling exactly which sentence does have that meaning has been a good idea rather than which paragraph does have that meaning? I hope I am clear enough :) $\endgroup$
    – Maria
    May 31, 2018 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.