cript to save tags used in each item for test and validation set