Electrical conductivity in ferroelectric thin films