1

I am making a project in NLP. But found a problem. I saw that google assistant or cortana has a feature where you tell them them to remind you for a work. For example: You tell Cortana "Remind me to water the plants tomorrow at 6PM". Then cortana creates a work named "Water the plants".

This is the thing I am trying to understand :

enter image description here

Then sets the time, date etc. But how does it find the title "Water the plants". Is there any way where I can extract the title of given task using NLP in python? Please help me if you anything about this or what is called.

Beso
  • 1,176
  • 5
  • 12
  • 26
Nahid Khan
  • 11
  • 2

1 Answers1

0

There are probably quite a few ways to tackle this:

  1. I suppose your problem could generally fall under the span identification umbrella. A classic approach, used in NER for example, would be to do token-level labeling of the titles within each text and train a model to predict those labels.

  2. You could also use chunking to get verb or noun 'chunks', which may suffice as titles. Here is an article on noun chunking with NLTK and here is NLTK's own chapter on chunking (shared in this answer to another question).

  3. You could also use a rule-based system if the language used is fairly predictable. For example, you can hand-craft custom regexes to capture the essential parts of the task (e.g. everything after phrases like 'remind me to' and excluding temporal expressions like 'tomorrow at 6pm'). This is a limited and less flexible approach but can work well in certain cases.

  4. Another approach would be to create a dataset of full texts paired with their 'titles', and train a language model (maybe even QA-style?) to predict these titles from texts. Here is a blog post about someone working on a task involving extraction of a phrase from a larger text, which is quite different but may still have relevant sections.

  5. It could also be worth looking into text summarization (e.g. with huggingface), although I'm not sure how well that would work on mostly short texts like these and how useful the outputs would be.

There are likely more options out there too, but these are the first that come to mind.