How can I extract address from raw text using NLTK in python?

前端 未结 3 635
梦如初夏
梦如初夏 2021-02-07 19:30

I have this text

\'\'\'Hi, Mr. Sam D. Richards lives here, 44 West 22nd Street, New York, NY 12345. Can you contact him now? If you ne

3条回答
  •  名媛妹妹
    2021-02-07 20:21

    Pyap works best not just for this particular example but also for other addresses contained in texts.

    text = ...
    addresses = pyap.parse(text, country='US')
    

提交回复
热议问题