word文件里的样例参考文献如下:
先将参考文献复制到reference.txt里,如下:
[1] S. Ren, K. He, R. Girshick, and J. Sun, “Faster r-cnn: Towards real-time object detection with region proposal networks,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 39, pp. 1137–1149, June 2017.
[2] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You only look once: Unified, real-time object detection,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 779–788, June 2016.
[3] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg, “Ssd: Single shot multibox detector,” in Computer Vision – ECCV 2016 (B. Leibe, J. Matas, N. Sebe, and M. Welling, eds.), (Cham), pp. 21–37, Springer International Publishing, 2016.
[4] R. Girshick, J. Donahue, T. Darrell, and J. Malik, “Rich feature hierarchies for accurate object detection and semantic segmentation,” in 2014 IEEE Conference on Computer Vision and Pattern Recognition, pp. 580–587, June 2014.
[5] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei, “Imagenet large scale visual recognition challenge,” Inter-national Journal of Computer Vision, vol. 115, pp. 211–252, Dec 2015.
[6] R. Girshick, “Fast r-cnn,” in 2015 IEEE International Conference on Computer Vision (ICCV), pp. 1440–1448, Dec 2015.
[7] K. He, G. Gkioxari, P. Dollr, and R. Girshick, “Mask r-cnn,” in 2017 IEEE International Conference on Computer Vision (ICCV), pp. 2980–2988, Oct 2017.
[8] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, June 2016.
[9] T. Lin, P. Dollr, R. Girshick, K. He, B. Hariharan, and S. Belongie,“Feature pyramid networks for object detection,” in 2017 IEEE Con-ference on Computer Vision and Pattern Recognition (CVPR), pp. 936–944, July 2017.
[10] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You only look once: Unified, real-time object detection,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 779–788, June 2016.
运行查重代码,如下:
import re
with open('reference.txt', encoding='utf-8') as f:
ref_list_raw = f.readlines()
ref_dict = dict()
print('重复引用如下')
for ref in ref_list_raw:
result = re.findall('\[(\d{1,3})\]\t(.+)', ref)
result = result[0]
if result[1] not in ref_dict:
ref_dict[result[1]] = result[0]
else:
print("%s<-%s:%s" % (ref_dict.get(result[1]), result[0], result[1]))
输出重复的引用如下:
重复引用如下
2<-10:J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You only look once: Unified, real-time object detection,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 779–788, June 2016.
对应word的修改步骤如下:
- 将正文部分中,所有箭头右的引用(上文10)编号改为箭头左的引用(上文2)
- 删除参考文献部分箭头右的引用(上文10)
- ctrl a全选全文,更新域。