How can I change the sentence prefix "I'm working on [X]" so that it has the correct sentence structure for all X?

I want the user to be able to enter the task, and I will prefix it accordingly so that it has the correct sentence structure.

eg.

I am working on [making the world a better place] 

... It sounds good.

 I am working on [discuss draft proposal] 

... doesn't sound good. In this case, he would like the program to respond to something like:

 I am discussing a draft proposal 

Basically, as people write assignments or todos, it seems necessary (for example, to take milk, write an essay, etc.) or just a noun (for example, assignment 1, a meeting of clients, etc.). I want to convert them to Present Progressive .

I'm currently studying the natural language processing area, but I was wondering if there was any API access that would do what I needed, or if someone had experience with a similar problem.

+7
source share
1 answer

In addition to natural language processing, you are also asking about natural language generation: http://en.wikipedia.org/wiki/Natural_language_generation

You can try using a parser (such as the Stanford parser ) to figure out which phrase you have and determine the main verb, if any. You can simply return to targeting parts of speech for this. In English, you will also want to define "helping" verbs (called "aids" in technical articles), such as "will", "can", "may", etc., which are often right in front of the verb, as they can change the time as well.

If this is just a nominal phrase, β€œI'm working on X,” it’s likely to be fine. If this is a nominal value (if the Stanford parser gives you only NN without any NP or NNP or DET inside the top NP), then this might seem better with an attached article. For example. "pepper project" β†’ "I'm working on a pepper project." You would not do this for the "Pepper project" or if it is already a "pepper project" or for most of your own nouns. However, there are always difficult cases.

If it's a verb phrase: If it's already progressive, great. Else:

Use a lemmatizer (or lower yourself onto the stalker) to get the root form of the main verb.
Expand this root form into true progressive. For this, several heuristics are likely to be sufficient, based on whether or not the lemma ends with a vowel or consonant that doubles. For example. "walk" β†’ "walking", "running" β†’ "running" (double n), "fly" β†’ "flying" (y in this case does not behave like a vowel), "glide" β†’ "sliding" (discard the last e after consonant), but β€œrun” β†’ β€œrun” (not after the vowel). The most complete place to look for patterns and exceptions is the Full English Grammar or similar online resource. Tools for this include morphg and MorphAdorner .

Finally, remove all auxiliary verbs and replace the existing progressive form for the main verb. Although it will not be perfect, it will probably look smarter than most.

If this is an entire article (a sentence as a thing with a subject) or a question or some other thing, you can figure it out and just use a common prefix, for example, "Right now: Jenn back to me?" "Right now: I have to leave!"

I am not an expert, so maybe I missed some tools that already exist for this kind of thing, and if so, I hope to find out from others. This is not an easy task, but it is very useful. There will always be errors, and they can be annoying for your users, or maybe they will find fancy caresses. If you put something together, will you put the API here?

+2
source

All Articles