Dollar weakens after data shows U.S. inflation moderating