The nuclear spectroscopic factor characterizes the properties and occupancy of single-particle orbits of nuclei and other information, which is also an essential physical quantity connecting nuclear structure, nuclear reactions, and astrophysics. The spectroscopic factor is sensitive to the many-body wave function obtained from the theoretical models, and the standard shell model is usually chosen. With the development of supercomputers and nuclear many-body methods, nuclear
ab initio methods have been successfully employed to study the properties of atomic nuclei with great success. In the present paper, we study the nuclear spectroscopic factor of light nuclei with
ab initio no-core shell model based on the realistic nucleon-nucleon interaction. Firstly, the energies of low-lying states in
A=6 and 7 nuclei are calculated and compared with standard shell model calculations, and the convergence of the no-core shell model is also investigated. The results show that the no-core shell model calculations are in good agreement with the experimental data and well describe the properties of binding energy and excitation spectra. Afterward, we perform systematic calculations of overlap functions and spectroscopic factors in
^7\rmLi and
^7\rmBe and check the the convergence of spectroscopic factor with
ab initio no-core shell model. The results indicated that the convergence of spectroscopic factor of the no-core shell model calculation is slow with the increase of model space. The calculated spectroscopic factors of
^7\rmLi with the no-core shell model agree with available experimental data. Finally, systematic calculations of energies and spectroscopic factors of low-lying states in
A=6,\,7, and 8 nuclei are performed, and the input quantities for nuclear reaction and astronomy studies are provided.