1. Create aclass InvertedIndexto act as an abstract data type for the inverted index data structure, Itshould include the following member functions/support these operation on its data: Anormalize(term)method that takes astrobject stored intermand returns a stemmed version of thatword suitable for a kev in the inverted index .Anaddterm(ternm docID):method that adds the unnormalizedstrobjecttermto the index if need beand records that the document with integraldocIDcontains that term .Anadddocument(document, id)method that takes a document as astrobject with integralidand addsa tokenized normalized version of the document to the inverted index. Stopwords in the document are notindexed. .Abuildindex(corpus)method that takes a corpus as alistof documents and usesadddocumentasnecessary to build the index. A document's ID is its index in the listcorpus, so the first document has ID 0,next 1, and so on. .An object of typeInvertedIndexshould support the operator termlfor term lookup. In other words, ifobjectiiwas constructed viaii Invertedlndex0and a suitable index buil theniil'Kimmer']wouldreturn the list of document IDs containing the search term 'Kimmer'. Hint: magic methods 1. Create aclass InvertedIndexto act as an abstract data type for the inverted index data structure, Itshould include the following member functions/support these operation on its data: Anormalize(term)method that takes astrobject stored intermand returns a stemmed version of thatword suitable for a kev in the inverted index .Anaddterm(ternm docID):method that adds the unnormalizedstrobjecttermto the index if need beand records that the document with integraldocIDcontains that term .Anadddocument(document, id)method that takes a document as astrobject with integralidand addsa tokenized normalized version of the document to the inverted index. Stopwords in the document are notindexed. .Abuildindex(corpus)method that takes a corpus as alistof documents and usesadddocumentasnecessary to build the index. A document's ID is its index in the listcorpus, so the first document has ID 0,next 1, and so on. .An object of typeInvertedIndexshould support the operator termlfor term lookup. In other words, ifobjectiiwas constructed viaii Invertedlndex0and a suitable index buil theniil'Kimmer']wouldreturn the list of document IDs containing the search term 'Kimmer'. Hint: magic methods