I am trying to classify sentences using machine and deep learning methods. Am using this script - https://github.com/17765670591/twitter-suicidal-ideation-detection/blob/main/Notebook/Twitter_Suicidal_Ideation_Detection.ipynb

However, I am not getting any reasonable results since syntactically the two sets of sentences (see below) is very similar.

Am now wondering whether to use ML/DL methods or try to code in an NLP rule-based approach, such as here https://github.com/nature-of-eu-rules/regulatory-statement-classification/blob/main/rule-based-classification.py

There are many keywords, based on which these sentences are captured.

One way to differentiate the following sentences more clearly is the context around the 'keyword' which is different.

I just want to know how to proceed as ML/DL approaches may not apply. Or maybe there is a setting within the ML/DL (BERT) that I can set that focuses on the keyword are the NLP POS.

Or should I try to manually analyse the sentences for each keyword, and identify and code the NLP POS patterns for each to capture them?

For the keyword 'hang', these are the sentences that are labelled as 'dangerous'

I want to hang quite badly.

It looks like you tired to hang yourself!

I tried to hang myself before I found him.

I've seen photos of people after they hang themselves and it's disturbing and undignified.

Was just looking up at the rafters of my garage and wondering if I could hang myself.

At this stage I came downstairs, followed him outside where I realised he was trying to hang himself using his truck which had a crane on the back.

For the same keyword, these are the sentences that are labelled as 'not dangerous'

I don’t like my social life, the people I hang out with are great and my friends care about me, but I feel like i have a sort of social anxiety where I feel uncomfortable around people even thought I’ve known for quiet some time.

im weak and i hang on her every word, i fell for her and i feel psychotic because it was so fast, but noones really ever showed me compassion or love before.

For these moments, if you are lucky enough to have someone to reach out to tell you to hang on in there, just to sit with you and be present, to hold your hand, to give you a hug, whilst you eventually come to, and return to reality and tell you that YOUR LIFE IS WORTH LIVING, then yes, I BELIEVE you can get through it.

I did some dishes and hang up the laundry from 2 days ago.

More Pankajeshwara Sharma's questions See All
Similar questions and discussions