<p>There are probably quite a few ways to tackle this:</p>
<ol>
<li><p>I suppose your problem could generally fall under the <em><a href="https://arxiv.org/abs/2010.02587" rel="nofollow noreferrer">span identification</a></em> 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.</p>
</li>
<li><p>You could also use chunking to get verb or noun 'chunks', which may suffice as titles. <a href="https://streamhacker.com/2009/02/23/chunk-extraction-with-nltk/" rel="nofollow noreferrer">Here</a> is an article on noun chunking with NLTK and <a href="https://www.nltk.org/book/ch07.html#fig-chunk-segmentation" rel="nofollow noreferrer">here</a> is NLTK's own chapter on chunking (shared in <a href="https://stackoverflow.com/a/2642400/8758205">this answer</a> to another question).</p>
</li>
<li><p>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 <em>like</em> 'remind me to' and excluding temporal expressions <em>like</em>
'tomorrow at 6pm'). This is a limited and less flexible approach but
can work well in certain cases.</p>
</li>
<li><p>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. <a href="https://medium.com/analytics-vidhya/extract-the-right-phrase-from-sentence-29aa5f8b9182" rel="nofollow noreferrer">Here</a> 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.</p>
</li>
<li><p>It could also be worth looking into text summarization (e.g. <a href="https://huggingface.co/transformers/usage.html#summarization" rel="nofollow noreferrer">with huggingface</a>), although I'm not sure how well that would work on mostly short texts like these and how useful the outputs would be.</p>
</li>
</ol>
<p>There are likely more options out there too, but these are the first that come to mind.</p>
How to get task title using python
<p>I am making a project in NLP. But found a problem. I saw that google assistant or <strong>cortana</strong> has a feature where you tell them them to remind you for a work. For example:
You tell Cortana &quot;<em>Remind me to water the plants tomorrow at 6PM</em>&quot;. Then <strong>cortana</strong> creates a work named &quot;<em>Water the plants</em>&quot;.</p>
<p>This is the thing I am trying to understand :</p>
<p><a href="https://i.stack.imgur.com/3ZmWk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3ZmWk.png" alt="enter image description here" /></a></p>
<p>Then sets the time, date etc. But how does it find the title &quot;<em>Water the plants</em>&quot;. 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.</p>