Text this: Discovering the building blocks of atomic systems using machine learning: application to grain boundaries