The machine cannot understand words and therefore it needs numerical values so as to make it easier for the machine to process…