在python中,从不同字符串中提取关键字的最佳方法是什么?

在python中,从不同字符串中提取关键字的最佳方法是什么?,python,text,nlp,text-processing,data-extraction,Python,Text,Nlp,Text Processing,Data Extraction,我希望从一组文本中提取重要的关键字,这些文本实际上是任何交易后收到的文本消息。 下面是一个示例数据集: {"message": "*boi star sandesh* rs 20 has been debited to your account xx2136 from pos-paytm.com on 08-11-2014.available balance 275.00.", "number": "boiind"} {"message": "your a/c xxxxx388847 debit

我希望从一组文本中提取重要的关键字,这些文本实际上是任何交易后收到的文本消息。 下面是一个示例数据集:

{"message": "*boi star sandesh* rs 20 has been debited to your account xx2136 from pos-paytm.com on 08-11-2014.available balance 275.00.", "number": "boiind"}
{"message": "your a/c xxxxx388847 debited inr 7,500.00 on 12/08/16 -transferred to mr. rajendra kurmi . a/c balance inr 1,314.45", "number": "amcbssbi"}
{"message": "an amount of rs.10,000.00 has been debited from your account  number xxxx1152 for an online payment txn done using hdfc bank netbanking.", "number": "dmhdfcbk"}
{"message": "your a/c no. xxxxxxxx1152 is debited for rs. 10,000.00 on 11-08-16 and a/c xxxxxxx847 credited (imps ref no 622421331357)", "number": "vkhdfcmp"}
{"message": "one time password for netbanking transaction is 785516. please use the password to complete the transaction. pls do not share this with anyone. ref no- xxxx4763", "number": "imhdfcbk"}
{"message": "your a/c no. xxxxxxxx3962 is debited for rs.20000.00 on 11-08-16 and a/c of unregistered has been credited (imps ref no 622421342625).", "number": "dmaxisbk"}
我需要从消息中提取有关交易金额、余额、日期和交易类型的信息

我应该采取什么方法,什么模块是最好的

仅供参考,来自相同号码的消息具有相同的消息格式,但我必须处理大量的格式,因此为每个号码编写代码将是重复和耗时的。

从模块中使用

例如,为了找到每个字符串的日期,我们可以使用regex模式


是的,我已经用regex完成了日期部分和帐号部分,但是如何获取交易金额和其他详细信息?因为每个号码的消息格式不同。我想你应该试试,也许可以用你的代码问一个新问题。所以这不是免费的编码服务。编辑:我想指出,你不会找到一个简单的答案。如果有很多变化,就没有办法避免进行多次搜索。事情就是这样。