I'm trying to extract triplet subject, predicate, and object from sentence. I need more references on how to do this.
3 Answers
The most basic way to do this, with acceptable result is to do shallow parsing and then extracting NOUN-VERB-NOUN triples. This should work for all SVO (subject–verb–object) languages like English. Some tuning may be required to extract only the first triple from a sentence, or not extract in case of comas. It is a very fast solution, because shallow POS tagging usually is O(n) - 0.01 per sentence, instead of deep parsing(Open NLP, Stanford Parser) which is O(n^3) - 0.4 sec per sentence.

- 49,044
- 25
- 144
- 182

- 14,489
- 21
- 77
- 126
-
What tool I should use to perform this shallow parsing? Can you explain me this Noun Triples? How can I extract a noun triples from sentence? Is it enough using just POS Tag? – Khairul Nov 26 '11 at 09:42
-
1Not "noun triples" but "NOUN-VERB-NOUN" triples. As many language are SVO (subject–verb–object) extracting those parts POS chunk mean you extracting predicates. – yura Nov 29 '11 at 10:56
-
1I did as you suggest, and my problem was solved. Much obliged. – Khairul Nov 30 '11 at 09:12
you can use Stanford parser API or Open NLP to make part of speech tagging and some other NLP operations
and for the triplet extraction you can implement one of the techniques in the papers available on the internet , i know a good one to implement : http://ailab.ijs.si/delia_rusu/Papers/is_2007.pdf

- 2,121
- 4
- 29
- 47
-
Actually I already read paper above and tried to implement but I got stuck in EXTRACT-ATTRIBUTES. I tried to extract triplet from sentence "I go to bed". I got the predicate "go" while I expect "go to bed". In the paper if type of word is verb then attributes is all ADVP sibling. Meanwhile tag of "to bed" is PP. Have you ever implement them? If yes would you mind share them? – Khairul Nov 09 '11 at 11:49
-
did you tried the Parser in OpenNLP then you should get go to bed. – ShrekOverflow Nov 09 '12 at 04:00
-
(http://ailab.ijs.si/delia_rusu/Papers/is_2007.pdf) The link is not working any more. – Ruthwik Mar 10 '16 at 12:05
-
@Ruthwik since 2011 (the date of this answer) there has been lots of new advancements, I would recommend taking a look on the sate of the art systems in tasks like (knowledge base population) or if you want off the shelf software i would think of [Stanford OpenIE](http://nlp.stanford.edu/software/openie.html) system or [OLLIE](https://knowitall.github.io/ollie/) – Hady Elsahar Mar 11 '16 at 12:13
-
1Please don't just post some tool or library as an answer. At least demonstrate [how it solves the problem](http://meta.stackoverflow.com/a/251605) in the answer itself. – Baum mit Augen Jun 12 '17 at 21:05
I'm working on a similar problem, i am working in visual basic. Firstly : I have a list of Subjects / NOUNS Secondly : when i extract the predicate i extract the between phrase...
(a cat) (Sat on ) (The mat)
by building the Subject list with nouns and noun phrases their positions can be replaced with (learning pattern) then if the subjects are not detected the learned predicate may have previously been detected.
Perhaps this is similar to the snowball Algorithm.

- 31
- 2