參考文獻查重

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的修改步驟如下:

  1. 將正文部分中,所有箭頭右的引用(上文10)編號改爲箭頭左的引用(上文2)
  2. 刪除參考文獻部分箭頭右的引用(上文10)
  3. ctrl a全選全文,更新域。
發佈了63 篇原創文章 · 獲贊 180 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章