I'm looking into PCFG sentence grammar dependency structure parsing using StanfordNLP PCFG parser. It generates tree structures represented as a string like this:
Happy new year => (ROOT (VP (VBN Happy) (NP (JJ new) (NN year))))
Or in a more visual way, the tree structure looks like this:
(VBN (JJ Happy)
(NP (JJ new) (NN year))))
Since some machine learning algorithms are generative, and I'm wondering if I group tree structures into two sets: one set contains sentences with negative emotions, one set on positive emotions. Can I use the machine learning algorithm to get the most commonly occurred subtree structure within each set?
I'm very sorry if I caused any confusion. First of all, I want to know if this problem is solvable in the realm of machine learning.
Remember topic modeling? Where the algorithm reads large chunks of text and generate similar topics and return keyword strings grouped together as a topic? One topic could be:
Gun, ship, sailer, ocean, fish, war, Gulf, oil
It provides an insight into what computer understands what this document might be talking about, so we can compare it with what humans think.
However, what I want to do, is ask the question if I can find common syntactical subtree structures in a sentence that might indicate the attribute of this sentence: negative or positive.
No, I am not asking for a sentiment analysis classifier, and that is not my interest at all.
For example, (this is an unpublished study right now), as us humans, we can say certain things about the future, and it will appear in a special structure, like "I will go to the mall" or "I'm going to jogging." You can see that "will" or "going to" might appear in many sentences, and serve as a common grammatical/syntactical structure. Those structures can be spotted by us human beings (namely linguists), however, is it possible to let machine find such common pattern?
I know in data science, or in realm of machine learning, people use algorithms to find/generate common patterns. I can group my parsed sentences (as tree structures represented above) into two groups: negative group and positive group (NOT emotions, just names for two groups), and then I want to use this algorithm to see if one or multiple subtree structures are very common among the group so I can extract them out.
As I stated before, I only need two things:
- Is this solvable in Machine Learning realm?
- If it is, which algorithm should I use?