# to include first single word in bigram or not?

in a text such as

"The deal with Canada's Barrick Gold finalised in Toronto over the weekend"

When I try to break it into bigram model, I get this

"The deal"
"deal with"
"Barrick Gold"
"Gold finalised"
"finalised in"
"in Toronto"
"Toronto over"
"over the"
"the weekend"


my question

shall I include the first word and the last word as single words

"* The"
"Weekend *"

• Making an analogy with 2D convolutions used in computer vision, I would say you could, however I doubt here that this can improve the accuracy of your model so I would not do it. This is just my intuition to help you going. If you are not in a hurry, you can try both and compare the results. – Jeanba Nov 18 '19 at 10:44
• What are you intending to do with the bigram model? If you need to be able to predict the first word of a sentence for instance, you will ideally have a simple way to model that. – Neil Slater Nov 18 '19 at 11:52

What you describe is called padding and is indeed used frequently in language modeling. For instance if one represents the sequence "A B C" with trigrams:

# # A
# A B
A B C
B C #
C # #