5

I'm looking for a way to computationally find any actionable clauses within a body of text. Ideally there is a library I could use that I just give a body of text and it spits out the actions that it finds. Next best, would be if there is an algorithm described somewhere that does this which I could try to implement. I don't know much about NLP, but here is what I've found/thought/tried so far.

Most actions occur in imperative sentences, so detecting whether a sentence is imperative or not could help. I'm not sure how best to detect this, but one idea that was given to me was to use the Stanford parser and look for any instances of nsubj. If none are found, then this would be considered an action. Just from some testing I did with some sample sentences, I found that some sentences that I consider actions contain instances of nsubj. Are there more rules I could possibly add to this to improve the precision? I also have no clue how this will fare in terms of recall rate either. Are there any other completely different approaches you could recommend?

Some example sentences that I would like to detect as actions:

Please pass on the enclosed instructions to your teams who are interested.

In the above example, it finds nsubj(interested-12, who-10).

Can you prepare a Powerpoint presentation for 3pm today?

In the above example, it finds nsubj(prepare-3, you-2).

Remember to pick up some milk at the store.

This doesn't contain nsubj.

4
  • "Actionable clause" could be interpreted as "clause which would give you grounds to sue". Do you mean clauses that describe actions as opposed to states? If so, it is not the case that most "actions" occur in imperative clauses, since most clauses aren't imperative ("I ate a sandwich" is not imperative). What you may want to do is reject clauses with stative verbs like "sleep" or be plus adjective constructions. The first step is to clearly define what you want to include and to exclude.
    – user6726
    Jan 15 '15 at 19:27
  • I'm looking for the type of actions which you would expect in a list of tasks or TODOs. "I ate a sandwich" would not be considered an action in this case. "Eat a sandwich" would be. I'm not sure what the appropriate terminology for that type of action is. Maybe "commands" are a better term?
    – MahlerFive
    Jan 15 '15 at 20:24
  • I assume "He should dig a hole" is in, "He dug a hole" (esp. reporting that he did the assigned job) is out. Functionally, "That hole isn't gonna dig itself" has the force of "You should dig that hole", it's just more indirect. What about self-commands ("I should dig a hole") or questions ("Should I / he dig a hole?")?
    – user6726
    Jan 15 '15 at 20:33
  • Actually I think both of those first cases are out. What I'm mostly interested in is direct commands like "Do X" ("Create Powerpoint presentation by 3pm" or "Please create a Powerpoint presentation by 3pm") and commands in the form of a question like "Can you do X?" ("Can you create a Powerpoint presentation by 3pm?"). Those types would be the minimum I would like to detect. I honestly wouldn't expect to be able to detect things like "That hole isn't gonna dig itself", though if I could detect "You should dig that hole", that would be good.
    – MahlerFive
    Jan 15 '15 at 20:40
4

The area of research you want to look at is local grammars (an approach developed in the late 1990s). It's been used for identifying things like commands, definitions, etc. in text. The idea is that certain functional areas can be identified through certain construction patterns and keywords based on their distribution in a corpus. These patterns constitute a sort of island of regularity (a local grammar) and can be spotted in the text.

Here is an example of their application and here's some more background.

I think the linguistic community outside NLP and corpus studies should pay more attention to local grammars because they have the potential to reveal aspects of how humans deal with complex patterns in texts.

3

I think that what you're looking at is a task that resembles intent determination. I would peruse some literature on that topic. For instance, it might be good to approach this as a classification task for verb phrases (is the verb phrase an action item or not?). It seems to me that the heuristic, parser-based approach has some problems and the solution is definitely not as trivial as looking for nsubj. You've already found some problematic cases, and there are many more.

The reason your "action" sentence "Please pass on the enclosed instructions to your teams who are interested" contains an nsubj is that it contains a subordinate clause, the relative clause indicated by "who". In the case of the example, if you treat the clauses separately, you'll find that you do indeed have an action item in the clause that doesn't contain nsubj

[Please pass on the enclosed instructions to your teams] who are interested.
(Action item exists in the selected clause)

Please pass on the enclosed instructions to your [teams who are interested].
(Action item doesn't exist in the selected clause)

It seems to me that a more problematic case would concern e.g. modals:

I should eat a sandwich
I think you should eat a sandwich
Please pass on the enclosed instructions to your teams who must attend the meeting.

I would argue that each of these three examples contains the action phrases you're trying to find (and in case of the third sentence, it could contain two such phrases). Each meets your criteria for being a "To do" list type of item. However, each of them contains nsubj.

Furthermore, the Stanford parser gives you an nsubj in this case of what might look like a definite action item:

Do an assignment

You get nsubj(do-1, assignment-3)

3
  • For your first point - is there a way to detect that there is a subordinate clause so I could ignore it? For your last example Do an assignment I don't get a nsubj, but I do get a dsubj (using their online parser).
    – MahlerFive
    Jan 16 '15 at 14:47
  • 2
    Oh boy, seems like if you parse "do an assignment" you get a different parse than if you use "Do an assignment". With the capitalized sentence I get the parse one might expect, with a dobj. This certainly doesn't make things more convenient... Regarding the subordinate clauses, you'd have to do some generalization and come up with some heuristics based on what subordinate clauses tend to look like. If you're familiar with wh-movement, you can use that idea to think about them, or do a more basic generalization of "clause begins with a wh-word? subordinate!"
    – aalto
    Jan 16 '15 at 23:40
  • The wh-word approach sounds promising. How do you actually break the sentence into clauses though? Is there a parser out there that can do this?
    – MahlerFive
    Jan 19 '15 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.