Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to presever the words. #344

Open
Opperessor opened this issue Mar 7, 2024 · 0 comments
Open

Not able to presever the words. #344

Opperessor opened this issue Mar 7, 2024 · 0 comments

Comments

@Opperessor
Copy link

wanted to retain the format of few entities, unable to do.

text = "My phone number is +44(123)-1451-1231ext02 and my credit card is 1234-1235(2352), my policy number is 1234-12CAR-12 and my account number is 004421234-12"

def keyboard_aug():
    protected_entities = ["+44(123)-1451-1231ext02", "1234-1235(2352)", "1234-12CAR-12", "004421234-12"]
    aug = nac.KeyboardAug(stopwords=protected_entities)
    augmented_text = aug.augment(text)
    print("Original text:")
    print(text)
    print("Augmented text:")
    print(augmented_text)

output:
Original text:
My phone number is +44(123)-1451-1231ext02 and my credit card is 1234-1235(2352), my policy number is 1234-12CAR-12 and my account number is 004421234-12
Augmented text:
['My phone numneG is + 44 (123) - 1#R1 - 1231ext02 and my credit cx#d is 1234 - 1235 (2Et2 ), my 9Plicy n7kber is 12$# - 12CAR - 12 and my acc*ujR mumbdr is 00e4W123e - 12']

I am unable to perserve the format of the words. I did use the stopwords, still facing the issue. Very new to this nlpaug, A Little help will be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant