Add comprehensions to convert weight names and values correctly