'How to extract offer details out of an offer text?

I want to extract offer details from the raw offer text. These offers could give cashback or discount or both. Some examples:

  1. Flat 60% off
  2. Get 10% off on a minimum purchase of Rs 400
  3. Get 20% cashback of up to Rs 50
  4. Flat Rs 100 off on a minimum purchase of Rs 1000
  5. Flat 25% + Rs 150 off coupon code

I'm looking for a parser that returns the details from such raw text. These constructs are discount amount/percent, cashback amount/percent, minimum transaction amount, maximum discount/cashback, etc. One important consideration to keep here is that these offer constructs are limited. Should I go for a rule-based engine or NLP or something else altogether? What is my best bet and what should the output dictionary look like?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source