I need to solve the following using NLP, can you give me pointers on how to achieve this using OpenNLP API
a. How to find out if a sentence implies a certain action in the past, present or future.
(e.g.) I was very sad last week - past
I feel like hitting my neighbor - present
I am planning to go to New York next week - future
b. How to find the word which corresponds to a person or company or country
(e.g.) John is planning to specialize in Electrical Engineering in UC Berkley and pursue a career with IBM).
Person = John
Company = IBM
Location = Berkley
Thanks
I can provide solution of
Solution of b.
Here is code :
and you want location also then import location model also that is available on openNLP source Forge. you can download and you can use them.
I am not sure about what will be probability of Name, Location, and Organization Extraction but almost it recognize all names,location,organization.
and if don't find openNLP sufficient then use Stanford Parser for Name Entity Recognization.
Finding the literal tense of the sentence is not trivial, but doable in some cases. The OpenNLP parser will create a sentence structure from which you can attempt to extract the head verb, and a bit of morphological analysis will tell you whether the verb is present or past (in English), and a bit more mucking about for the model "will" will give you future tense in some circumstances. But it's not always that simple. For instance, in "Going to Paris drained my bank account", you have an embedded event (going to Paris) which happened in the past, but it's tricky to figure that out. And your future example ("I am planning...") requires some real-world understanding of what the word "plan" means, which is quite complicated. This sort of thing is a topic of ongoing research in natural language processing.