I'm working on a use case where the user will be provided a text box to enter the details of the transaction application.
For Example user might enter the below text and I have to parse the data and accordingly create the transaction. (I took basic example as a startup)

Ex 1 : Transfer $100 from Account 1 into Account 2
Ex 2: Move Money of total 400 dollars into account owned by Mr.xxxx from Acct#
Ex 3: Deposit an amount of five thousand dollars into acct#

For above examples I have to parse and convert into a tabular format like Trx_Type (Deposit or Transfer), Amt, From_Acct#, To_Acct#, Acct_Holder_Name,etc.

I'm trying to look options by doing Named Entity (NER) or Classifier modelling using NLTK in python. Can someone please share ideas from where to start and guide me with a draft way to proceed.
Looking forward for a response. Thanks!


My answer is based on couple of assumptions:

  • user input is more or less standard, so there won't be "Ex 20000"
  • you have at least majority of forms of input covered

In every representative example of transaction description you would need to mark words of interest, be it name of holder and account number. You can start small with 10-20 examples for start, and then, when you have all required fields marked, you can train a sequence labelling model, or, say it, custom Named Entity Recognition model, which will parse new text and extract required data for you.

How to train actual model is answered in that question: Help regarding NER in NLTK , and how to mark up the data - is more of a question you should answer, since only you do know, what should be marked as account number, account holder etc.

If you would be digging into NER training, I would advise you not to rely only on current word features, but add some regexp-alike features and dictionaries as features, since task seems very limited in terms of context variation.

  • $\begingroup$ I'm a newbie to the subject of NLP, so I couldn't really understand the answer completely. Can you please guide me to some resource or any link where I could learn more about Sequence Label Modelling and also how or where can i leverage the regex features / dictionaries using NLTK. Also, you had mentioned about marking up the data? Can you please elaborate on this on how to approach? Also, is NLTK right choice for this problem or any other nlp tools? Thanks! $\endgroup$ – pydnltk Jan 8 '16 at 2:21

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.