# Bert pretrained tokenizer: how to preserve hyphened words?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbert-pretrained-tokenizer-how-to-preserve-hyphened-words%2F16536%3E%5C
**Category:** Beginners\
**Created:** [April 6, 2022, 12:48pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbert-pretrained-tokenizer-how-to-preserve-hyphened-words%2F16536 "2022-04-06T12:48:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![orkenstein](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/orkenstein/32/4439_2.png) [@orkenstein](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Forkenstein)%5C
**Post date:** [April 6, 2022, 12:48pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbert-pretrained-tokenizer-how-to-preserve-hyphened-words%2F16536%2F1 "2022-04-06T12:48:28Z")

</div>

I’m building a model for NER task and use tokenizer like this:

```python
model_name = "bert-large-cased"  
tokenizer = AutoTokenizer.from_pretrained(model_name)

sequence = ['Ash', 'punches', 'three', 'buttons', '.', 'An', 'X-ray', 'image', 'appears', '.']
inputs = tokenizer(sequence, is_split_into_words=True, return_tensors="pt")
tokens = inputs.tokens()
print(inputs.tokens())
---
#['[CLS]', 'Ash', 'punches', 'three', 'buttons', '.', 'An', 'X', '-', 'ray', 'image', 'appears', '.', '[SEP]']

```

As you can see, the tokenizer _splits_ the word **X-ray** even if I feed it already split sequence.  
How to keep it together or better split like `['X', '##-', '##ray']` instead?
