lexpredict-lexnlp icon indicating copy to clipboard operation
lexpredict-lexnlp copied to clipboard

Couldn't able to extract address from text or string

Open Nandinicsgowd opened this issue 4 years ago • 2 comments

I wrote like this. from lexnlp.extract.en.addresses import address_feature str = "Vistra Corporate Services Centre Wickhams Cay II Road Town Tortola VG1110 British Virgin Islands" print("address:", list(lexnlp.extract.en.addresses.address_features.get_word_features(str,part_of_speech="NP"))) but am getting results like this: address: [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] Can you help this, how to extract address for strings or text files???what i need to pass in the palce of part_of_speech???? what is the result am geeting it is binary i can't understand that??bcz am bigginer to nlp thing.am waiting for your positive response. (sorry for my english words).

Nandinicsgowd avatar Sep 09 '20 03:09 Nandinicsgowd

from lexnlp.extract.en.addresses import addresses import nltk nltk.download('punkt') nltk.download('averaged_perceptron_tagger')

print(list(addresses.get_addresses(text)))

debjyoti003 avatar Nov 16 '21 11:11 debjyoti003

Try this you will get it, but I tested it, it is not so accurate.

debjyoti003 avatar Nov 16 '21 11:11 debjyoti003