bert-addresses / README.md
ctrlbuzz's picture
Update README.md
9250843
|
raw
history blame
542 Bytes

Basic Usage

from transformers import BertTokenizer, AutoModelForTokenClassification from transformers import pipeline

tokenizer = BertTokenizer.from_pretrained('bert-base-cased') model = AutoModelForTokenClassification.from_pretrained("ctrlbuzz/bert-addresses") nlp = pipeline("ner", model=model, tokenizer=tokenizer) example = "While Maria was representing Johnson & Associates at a conference in Spain, she mailed me a letter from her new office at 123 Elm St., Apt. 4B, Springfield, IL.",

ner_results = nlp(example) print(ner_results)