SPECTROSCOPIC STUDY OF STAR-FORMING GALAXIES IN FILAMENTS AND THE FIELD AT z ∼ 0.5: EVIDENCE FOR ENVIRONMENTAL DEPENDENCE OF ELECTRON DENSITY